Merge pull request #10742 from filecoin-project/asr/merge-release-into-master
chore: merge releases into master
This commit is contained in:
commit
3a6c385b50
@ -795,17 +795,11 @@ workflows:
|
||||
suite: itest-mempool
|
||||
target: "./itests/mempool_test.go"
|
||||
- test:
|
||||
name: test-itest-migration_nv17
|
||||
name: test-itest-migration
|
||||
requires:
|
||||
- build
|
||||
suite: itest-migration_nv17
|
||||
target: "./itests/migration_nv17_test.go"
|
||||
- test:
|
||||
name: test-itest-migration_nv18
|
||||
requires:
|
||||
- build
|
||||
suite: itest-migration_nv18
|
||||
target: "./itests/migration_nv18_test.go"
|
||||
suite: itest-migration
|
||||
target: "./itests/migration_test.go"
|
||||
- test:
|
||||
name: test-itest-mpool_msg_uuid
|
||||
requires:
|
||||
@ -1004,6 +998,8 @@ workflows:
|
||||
- build
|
||||
suite: itest-wdpost
|
||||
target: "./itests/wdpost_test.go"
|
||||
get-params: true
|
||||
|
||||
- test:
|
||||
name: test-itest-wdpost_worker_config
|
||||
requires:
|
||||
|
@ -547,6 +547,9 @@ workflows:
|
||||
[[- if or (eq $name "worker") (eq $name "deals_concurrent") (eq $name "wdpost_worker_config")]]
|
||||
executor: golang-2xl
|
||||
[[- end]]
|
||||
[[- if (eq $name "wdpost")]]
|
||||
get-params: true
|
||||
[[end]]
|
||||
[[- end ]][[- end]]
|
||||
|
||||
[[- range $suite, $pkgs := .UnitSuites]]
|
||||
|
479
CHANGELOG.md
479
CHANGELOG.md
@ -1,8 +1,24 @@
|
||||
# Lotus changelog
|
||||
|
||||
# UNRELEASED
|
||||
# v1.23.0 / 2023-04-21
|
||||
|
||||
## Execution Trace Format Changes
|
||||
This is the stable feature release for the upcoming MANDATORY network upgrade at `2023-04-27T13:00:00Z`, epoch `2809800`. This feature release delivers the nv19 Lighting and nv20 Thunder network upgrade for mainnet, and includes numerous improvements and enhancements for node operators, ETH RPC-providers and storage providers.
|
||||
|
||||
## ☢️ Upgrade Warnings ☢️
|
||||
|
||||
Please read carefully through the **upgrade warnings** section if you are upgrading from a v1.20.X release, or the v1.22.0 release. If you are upgrading from a v1.21.0-rcX these warnings should be familiar to you.
|
||||
|
||||
- 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`.
|
||||
- **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 during a network upgrade is 24. 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
|
||||
|
||||
### 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:
|
||||
|
||||
@ -154,6 +170,463 @@ New <code>ExecutionTrace</code>:
|
||||
|
||||
</details>
|
||||
|
||||
**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 into 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: Pause compaction when out of sync ([filecoin-project/lotus/#10641](https://github.com/filecoin-project/lotus/pull/10641))
|
||||
- Pause the SplitStore compaction if the node is out of sync. Resumes the compation when its back in sync.
|
||||
- feat: splitstore: limit moving gc threads (#10621) ([filecoin-project/lotus/#10621](https://github.com/filecoin-project/lotus/pull/10621))
|
||||
- Makes moving gc less likely to cause node falling out of sync.
|
||||
- feat: splitstore: Update config default value (#10605) ([filecoin-project/lotus/#10605](https://github.com/filecoin-project/lotus/pull/10605))
|
||||
- Sets Splitstore HotStoreMaxSpaceTarget config to 650GB as default
|
||||
- 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/filecoin-project/go-state-types (v0.10.0 -> v0.11.0-alpha-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):
|
||||
- chore: deps: update to go-state-types v0.11.0-alpha-3 (([filecoin-project/lotus#10606](https://github.com/filecoin-project/lotus/pull/10606))
|
||||
- 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 <<network>> 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))
|
||||
|
||||
## 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.22.1 / 2023-04-23
|
||||
|
||||
## Important Notice
|
||||
|
||||
This is a MANDATORY hotfix release that fixes a consensus-critical bug that was in v1.22.0 -- the necessary fix is https://github.com/filecoin-project/ref-fvm/pull/1750 and it is integrated into lotus via https://github.com/filecoin-project/lotus/pull/10735.
|
||||
You can NOT use 1.22.0 for the nv19 upgrade, you MUST be on 1.22.1 or higher.
|
||||
|
||||
## About This Release
|
||||
|
||||
This is the stable release of Lotus v1.22.1 for the upcoming MANDATORY network upgrade at `2023-04-27T13:00:00Z`, epoch `2809800`. This release delivers the nv19 Lighting and nv20 Thunder network upgrade for mainnet.
|
||||
|
||||
Note that you must be on a go version higher than Go 1.18.8, but lower than Go v1.20.0. We would recommend Go 1.19.7.
|
||||
|
||||
The Lighting and Thunder upgrade introduces the following Filecoin Improvement Proposals (FIPs), delivered by builtin-actors v11 (see actors [v11.0.0](https://github.com/filecoin-project/builtin-actors/releases/tag/v11.0.0-rc2)):
|
||||
|
||||
- [FIP 0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md) - Thirty day market deal maintenance interval
|
||||
- [FIP 0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0061.md) - WindowPoSt grindability fix
|
||||
- [FIP 0062](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0062.md) - Fallback method handler for multisig actor
|
||||
|
||||
## Expedited nv19 Lightning ⚡️ rollout
|
||||
|
||||
In light of the recent degraded chain quality on the mainnet [an expedited nv19 upgrade has been proposed and accepted](https://github.com/filecoin-project/core-devs/discussions/123#discussioncomment-5642909) to roll out the market cron mitigation ([FIP0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md)) that will improve block validation times, and with that the delay in block production that is causing a decrease in the chain quality currently.
|
||||
|
||||
With this expedited roll out we want to inform you of some **key changes and important dates:**
|
||||
|
||||
- Accelerate the nv19-upgrade on **mainnet** from May 11th to **April 27th**.
|
||||
- Derisk nv19 by descoping the sector info migration, activation epoch fixes and drop [[FIP0052 - Extend sector/deal max duration to 3.5 year.](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)
|
||||
- By descoping these changes we can greatly derisk the network upgrade itself by removing a heavy migration that could cause instability for storage providers and node operators during the network upgrade.
|
||||
- Increase the rollover period for [[FIP0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md) from 1 week to 3 weeks on mainnet. The rollover period is the duration between nv19 and nv20 which both old proofs (v1) and the new proofs (v1_1) proofs will be accepted by the network.
|
||||
|
||||
The Lighting and Thunder upgrade now implements the following Filecoin Improvement Proposals (FIPs), delivered by builtin-actors v11 (see actors [v11.0.0](https://github.com/filecoin-project/builtin-actors/releases/tag/v11.0.0)):
|
||||
|
||||
- [FIP 0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md) - Thirty day market deal maintenance interval
|
||||
- [FIP 0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0061.md) - WindowPoSt grindability fix
|
||||
- [FIP 0062](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0062.md) - Fallback method handler for multisig actor
|
||||
|
||||
## v11 Builtin Actor Bundles
|
||||
|
||||
Make sure that your lotus actor bundle matches the v11 actors manifest by running after upgrading:
|
||||
|
||||
```
|
||||
lotus state actor-cids --network-version 19
|
||||
Network Version: 19
|
||||
Actor Version: 11
|
||||
Manifest CID: bafy2bzacecnhaiwcrpyjvzl4uv4q3jzoif26okl3m66q3cijp3dfwlcxwztwo
|
||||
|
||||
Actor CID
|
||||
datacap bafk2bzacebslykoyrb2hm7aacjngqgd5n2wmeii2goadrs5zaya3pvdf6pdnq
|
||||
init bafk2bzaceckwf3w6n2nw6eh77ktmsxqgsvshonvgnyk5q5syyngtetxvasfxg
|
||||
reward bafk2bzacebwjw2vxkobs7r2kwjdqqb42h2kucyuk6flbnyzw4odg5s4mogamo
|
||||
cron bafk2bzacebpewdvvgt6tk2o2u4rcovdgym67tadiis5usemlbejg7k3kt567o
|
||||
ethaccount bafk2bzaceclkmc4yidxc6lgcjpfypbde2eddnevcveo4j5kmh4ek6inqysz2k
|
||||
evm bafk2bzacediwh6etwzwmb5pivtclpdplewdjzphouwqpppce6opisjv2fjqfe
|
||||
storagemarket bafk2bzaceazu2j2zu4p24tr22btnqzkhzjvyjltlvsagaj6w3syevikeb5d7m
|
||||
storagepower bafk2bzaceaxgloxuzg35vu7l7tohdgaq2frsfp4ejmuo7tkoxjp5zqrze6sf4
|
||||
system bafk2bzaced7npe5mt5nh72jxr2igi2sofoa7gedt4w6kueeke7i3xxugqpjfm
|
||||
account bafk2bzacealnlr7st6lkwoh6wxpf2hnrlex5sknaopgmkr2tuhg7vmbfy45so
|
||||
placeholder bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro
|
||||
eam bafk2bzaceaelwt4yfsfvsu3pa3miwalsvy3cfkcjvmt4sqoeopsppnrmj2mf2
|
||||
multisig bafk2bzaceafajceqwg5ybiz7xw6rxammuirkgtuv625gzaehsqfprm4bazjmk
|
||||
paymentchannel bafk2bzaceb4e6cnsnviegmqvsmoxzncruvhra54piq7bwiqfqevle6oob2gvo
|
||||
storageminer bafk2bzacec24okjqrp7c7rj3hbrs5ez5apvwah2ruka6haesgfngf37mhk6us
|
||||
verifiedregistry bafk2bzacedej3dnr62g2je2abmyjg3xqv4otvh6e26du5fcrhvw7zgcaaez3a
|
||||
```
|
||||
|
||||
## Changelog
|
||||
|
||||
- feat: build: set Lightning and Thunder upgrade epochs [filecoin-project/lotus#10716](https://github.com/filecoin-project/lotus/pull/10707)
|
||||
- fix: PoSt worker: use go-state-types for proof policies [filecoin-project/lotus#10716](https://github.com/filecoin-project/lotus/pull/10716)
|
||||
- chore: deps: update to actors v11.0.0 [filecoin-project/lotus#10718](https://github.com/filecoin-project/lotus/pull/10718)
|
||||
- chore: deps: update to go-state-types v0.11.1 [filecoin-project/lotus#10720](https://github.com/filecoin-project/lotus/pull/10720)
|
||||
- feat: upgrade: expedite nv19 [filecoin-project/lotus#10681](https://github.com/filecoin-project/lotus/pull/10681)
|
||||
- Update changelog build version (commit: [67d419e](https://github.com/filecoin-project/lotus/commit/67d419e1623e6b9f5b871d6157a3096378477c3b))
|
||||
- Update actors v11 (commit: [5df4f75](https://github.com/filecoin-project/lotus/commit/5df4f75dc22318fd304313714d5c4f4cfeed22c9))
|
||||
- Correct epoch to match specified date (commit: [a28fcea](https://github.com/filecoin-project/lotus/commit/a28fceaa559b6c7e1b5df09383af56a5c2f51caa))
|
||||
- Fast butterfly migration to validate migration (commit: [37a0dca](https://github.com/filecoin-project/lotus/commit/37a0dca11ebfadebad3920a337b4f1b2fba08a7b))
|
||||
- Make docsgen (commit: [daba4ff](https://github.com/filecoin-project/lotus/commit/daba4ff5f0e97ab6ed444a34f61499a64b92a220))
|
||||
- Update go-state-types (commit: [244ca0b](https://github.com/filecoin-project/lotus/commit/244ca0b5f32a2af684f3f9586b92861a06bb8833))
|
||||
- Revert FIP0052 (commit: [68ed494](https://github.com/filecoin-project/lotus/commit/68ed494a6e497ac556eb93b28b2536c881dc9a4c))
|
||||
- Modify upgrade schedule and params (commit: [fa0dfdf](https://github.com/filecoin-project/lotus/commit/fa0dfdfd9f89fab8491f3e613909782ab9bb7cee))
|
||||
- Update go-state-types (commit: [19ae05f](https://github.com/filecoin-project/lotus/commit/19ae05f3b3a589e28efe4690c5816dfc1c7866a6))
|
||||
|
||||
### Dependencies
|
||||
github.com/filecoin-project/go-state-types (v0.11.0-rc1 -> v0.11.1):
|
||||
|
||||
# v1.22.0 / 2023-04-21
|
||||
|
||||
EDIT: Do NOT use this release for nv19, you MUST use v1.22.1 or higher.
|
||||
|
||||
This is the stable release of Lotus v1.22.0 for the upcoming MANDATORY network upgrade at `2023-04-27T13:00:00Z`, epoch `2809800`. This release delivers the nv19 Lighting and nv20 Thunder network upgrade for mainnet.
|
||||
|
||||
Note that you must be on a go version higher then Go 1.18.8, but lower then Go v1.20.0. We would recommend Go 1.19.7.
|
||||
|
||||
The Lighting and Thunder upgrade introduces the following Filecoin Improvement Proposals (FIPs), delivered by builtin-actors v11 (see actors [v11.0.0](https://github.com/filecoin-project/builtin-actors/releases/tag/v11.0.0-rc2)):
|
||||
|
||||
- [FIP 0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md) - Thirty day market deal maintenance interval
|
||||
- [FIP 0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0061.md) - WindowPoSt grindability fix
|
||||
- [FIP 0062](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0062.md) - Fallback method handler for multisig actor
|
||||
|
||||
## Expedited nv19 Lightning ⚡️ rollout
|
||||
|
||||
In light of the recent degraded chain quality on the mainnet [an expedited nv19 upgrade has been proposed and accepted](https://github.com/filecoin-project/core-devs/discussions/123#discussioncomment-5642909) to roll out the market cron mitigation ([FIP0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md)) that will improve block validation times, and with that the delay in block production that is causing a decrease in the chain quality currently.
|
||||
|
||||
With this expedited roll out we want to inform you of some **key changes and important dates:**
|
||||
|
||||
- Accelerate the nv19-upgrade on **mainnet** from May 11th to **April 27th**.
|
||||
- Derisk nv19 by descoping the sector info migration, activation epoch fixes and drop [[FIP0052 - Extend sector/deal max duration to 3.5 year.](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)
|
||||
- By descoping these changes we can greatly derisk the network upgrade itself by removing a heavy migration that could cause instability for storage providers and node operators during the network upgrade.
|
||||
- Increase the rollover period for [[FIP0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md) from 1 week to 3 weeks on mainnet. The rollover period is the duration between nv19 and nv20 which both old proofs (v1) and the new proofs (v1_1) proofs will be accepted by the network.
|
||||
|
||||
The Lighting and Thunder upgrade now implements the following Filecoin Improvement Proposals (FIPs), delivered by builtin-actors v11 (see actors [v11.0.0](https://github.com/filecoin-project/builtin-actors/releases/tag/v11.0.0)):
|
||||
|
||||
- [FIP 0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md) - Thirty day market deal maintenance interval
|
||||
- [FIP 0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0061.md) - WindowPoSt grindability fix
|
||||
- [FIP 0062](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0062.md) - Fallback method handler for multisig actor
|
||||
|
||||
## v11 Builtin Actor Bundles
|
||||
|
||||
Make sure that your lotus actor bundle matches the v11 actors manifest by running after upgrading:
|
||||
|
||||
```
|
||||
lotus state actor-cids --network-version 19
|
||||
Network Version: 19
|
||||
Actor Version: 11
|
||||
Manifest CID: bafy2bzacecnhaiwcrpyjvzl4uv4q3jzoif26okl3m66q3cijp3dfwlcxwztwo
|
||||
|
||||
Actor CID
|
||||
datacap bafk2bzacebslykoyrb2hm7aacjngqgd5n2wmeii2goadrs5zaya3pvdf6pdnq
|
||||
init bafk2bzaceckwf3w6n2nw6eh77ktmsxqgsvshonvgnyk5q5syyngtetxvasfxg
|
||||
reward bafk2bzacebwjw2vxkobs7r2kwjdqqb42h2kucyuk6flbnyzw4odg5s4mogamo
|
||||
cron bafk2bzacebpewdvvgt6tk2o2u4rcovdgym67tadiis5usemlbejg7k3kt567o
|
||||
ethaccount bafk2bzaceclkmc4yidxc6lgcjpfypbde2eddnevcveo4j5kmh4ek6inqysz2k
|
||||
evm bafk2bzacediwh6etwzwmb5pivtclpdplewdjzphouwqpppce6opisjv2fjqfe
|
||||
storagemarket bafk2bzaceazu2j2zu4p24tr22btnqzkhzjvyjltlvsagaj6w3syevikeb5d7m
|
||||
storagepower bafk2bzaceaxgloxuzg35vu7l7tohdgaq2frsfp4ejmuo7tkoxjp5zqrze6sf4
|
||||
system bafk2bzaced7npe5mt5nh72jxr2igi2sofoa7gedt4w6kueeke7i3xxugqpjfm
|
||||
account bafk2bzacealnlr7st6lkwoh6wxpf2hnrlex5sknaopgmkr2tuhg7vmbfy45so
|
||||
placeholder bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro
|
||||
eam bafk2bzaceaelwt4yfsfvsu3pa3miwalsvy3cfkcjvmt4sqoeopsppnrmj2mf2
|
||||
multisig bafk2bzaceafajceqwg5ybiz7xw6rxammuirkgtuv625gzaehsqfprm4bazjmk
|
||||
paymentchannel bafk2bzaceb4e6cnsnviegmqvsmoxzncruvhra54piq7bwiqfqevle6oob2gvo
|
||||
storageminer bafk2bzacec24okjqrp7c7rj3hbrs5ez5apvwah2ruka6haesgfngf37mhk6us
|
||||
verifiedregistry bafk2bzacedej3dnr62g2je2abmyjg3xqv4otvh6e26du5fcrhvw7zgcaaez3a
|
||||
```
|
||||
|
||||
## Changelog
|
||||
|
||||
|
||||
- feat: build: set Lightning and Thunder upgrade epochs [filecoin-project/lotus#10716](https://github.com/filecoin-project/lotus/pull/10707)
|
||||
- fix: PoSt worker: use go-state-types for proof policies [filecoin-project/lotus#10716](https://github.com/filecoin-project/lotus/pull/10716)
|
||||
- chore: deps: update to actors v11.0.0 [filecoin-project/lotus#10718](https://github.com/filecoin-project/lotus/pull/10718)
|
||||
- chore: deps: update to go-state-types v0.11.1 [filecoin-project/lotus#10720](https://github.com/filecoin-project/lotus/pull/10720)
|
||||
- feat: upgrade: expedite nv19 [filecoin-project/lotus#10681](https://github.com/filecoin-project/lotus/pull/10681)
|
||||
- Update changelog build version (commit: [67d419e](https://github.com/filecoin-project/lotus/commit/67d419e1623e6b9f5b871d6157a3096378477c3b))
|
||||
- Update actors v11 (commit: [5df4f75](https://github.com/filecoin-project/lotus/commit/5df4f75dc22318fd304313714d5c4f4cfeed22c9))
|
||||
- Correct epoch to match specified date (commit: [a28fcea](https://github.com/filecoin-project/lotus/commit/a28fceaa559b6c7e1b5df09383af56a5c2f51caa))
|
||||
- Fast butterfly migration to validate migration (commit: [37a0dca](https://github.com/filecoin-project/lotus/commit/37a0dca11ebfadebad3920a337b4f1b2fba08a7b))
|
||||
- Make docsgen (commit: [daba4ff](https://github.com/filecoin-project/lotus/commit/daba4ff5f0e97ab6ed444a34f61499a64b92a220))
|
||||
- Update go-state-types (commit: [244ca0b](https://github.com/filecoin-project/lotus/commit/244ca0b5f32a2af684f3f9586b92861a06bb8833))
|
||||
- Revert FIP0052 (commit: [68ed494](https://github.com/filecoin-project/lotus/commit/68ed494a6e497ac556eb93b28b2536c881dc9a4c))
|
||||
- Modify upgrade schedule and params (commit: [fa0dfdf](https://github.com/filecoin-project/lotus/commit/fa0dfdfd9f89fab8491f3e613909782ab9bb7cee))
|
||||
- Update go-state-types (commit: [19ae05f](https://github.com/filecoin-project/lotus/commit/19ae05f3b3a589e28efe4690c5816dfc1c7866a6))
|
||||
|
||||
### Dependencies
|
||||
github.com/filecoin-project/go-state-types (v0.11.0-rc1 -> v0.11.1):
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
>>>>>>> releases
|
||||
# v1.20.4 / 2023-03-17
|
||||
|
||||
This is a patch release intended to alleviate performance issues reported by some users since the nv18 upgrade.
|
||||
The primary change is to update the FFI to allow for FVM parallelism of 4 by default, and make this user-configurable.
|
||||
through the `LOTUS_FVM_CONCURRENCY` env var.
|
||||
|
||||
Users with higher memory specs can experiment with setting `LOTUS_FVM_CONCURRENCY` to higher values, up to 48, to allow for more concurrent FVM execution.
|
||||
|
||||
## Bug fixes
|
||||
|
||||
- Splitstore: Don't enforce walking receipt tree during compaction #10505
|
||||
- fix: build: drop drand incentinet servers #10506
|
||||
|
||||
## Improvement
|
||||
|
||||
- chore: update ffi to increase execution parallelism #10503
|
||||
|
||||
# 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!!!
|
||||
@ -175,6 +648,8 @@ This is a HIGHLY RECOMMENDED patch release for node operators/API service provid
|
||||
|
||||
# v1.20.2 / 2023-03-09
|
||||
|
||||
DO NOT USE: Use 1.20.3 instead!
|
||||
|
||||
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
|
||||
|
@ -337,6 +337,8 @@ type ForkUpgradeParams struct {
|
||||
UpgradeSkyrHeight abi.ChainEpoch
|
||||
UpgradeSharkHeight abi.ChainEpoch
|
||||
UpgradeHyggeHeight abi.ChainEpoch
|
||||
UpgradeLightningHeight abi.ChainEpoch
|
||||
UpgradeThunderHeight abi.ChainEpoch
|
||||
}
|
||||
|
||||
type NonceMapType map[address.Address]uint64
|
||||
|
@ -444,7 +444,7 @@ func (b *Blockstore) deleteDB(path string) {
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Blockstore) onlineGC(ctx context.Context, threshold float64) error {
|
||||
func (b *Blockstore) onlineGC(ctx context.Context, threshold float64, checkFreq time.Duration, check func() error) error {
|
||||
b.lockDB()
|
||||
defer b.unlockDB()
|
||||
|
||||
@ -461,11 +461,15 @@ func (b *Blockstore) onlineGC(ctx context.Context, threshold float64) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
checkTick := time.NewTimer(checkFreq)
|
||||
defer checkTick.Stop()
|
||||
for err == nil {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
err = ctx.Err()
|
||||
case <-checkTick.C:
|
||||
err = check()
|
||||
checkTick.Reset(checkFreq)
|
||||
default:
|
||||
err = b.db.RunValueLogGC(threshold)
|
||||
}
|
||||
@ -502,7 +506,17 @@ func (b *Blockstore) CollectGarbage(ctx context.Context, opts ...blockstore.Bloc
|
||||
if threshold == 0 {
|
||||
threshold = defaultGCThreshold
|
||||
}
|
||||
return b.onlineGC(ctx, threshold)
|
||||
checkFreq := options.CheckFreq
|
||||
if checkFreq < 30*time.Second { // disallow checking more frequently than block time
|
||||
checkFreq = 30 * time.Second
|
||||
}
|
||||
check := options.Check
|
||||
if check == nil {
|
||||
check = func() error {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return b.onlineGC(ctx, threshold, checkFreq, check)
|
||||
}
|
||||
|
||||
// GCOnce runs garbage collection on the value log;
|
||||
|
@ -2,6 +2,7 @@ package blockstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
ds "github.com/ipfs/go-datastore"
|
||||
@ -57,6 +58,10 @@ type BlockstoreGCOptions struct {
|
||||
FullGC bool
|
||||
// fraction of garbage in badger vlog before its worth processing in online GC
|
||||
Threshold float64
|
||||
// how often to call the check function
|
||||
CheckFreq time.Duration
|
||||
// function to call periodically to pause or early terminate GC
|
||||
Check func() error
|
||||
}
|
||||
|
||||
func WithFullGC(fullgc bool) BlockstoreGCOption {
|
||||
@ -73,6 +78,20 @@ func WithThreshold(threshold float64) BlockstoreGCOption {
|
||||
}
|
||||
}
|
||||
|
||||
func WithCheckFreq(f time.Duration) BlockstoreGCOption {
|
||||
return func(opts *BlockstoreGCOptions) error {
|
||||
opts.CheckFreq = f
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func WithCheck(check func() error) BlockstoreGCOption {
|
||||
return func(opts *BlockstoreGCOptions) error {
|
||||
opts.Check = check
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// BlockstoreSize is a trait for on-disk blockstores that can report their size
|
||||
type BlockstoreSize interface {
|
||||
Size() (int64, error)
|
||||
|
@ -187,6 +187,11 @@ type SplitStore struct {
|
||||
ctx context.Context
|
||||
cancel func()
|
||||
|
||||
outOfSync int32 // for fast checking
|
||||
chainSyncMx sync.Mutex
|
||||
chainSyncCond sync.Cond
|
||||
chainSyncFinished bool // protected by chainSyncMx
|
||||
|
||||
debug *debugLog
|
||||
|
||||
// transactional protection for concurrent read/writes during compaction
|
||||
@ -261,6 +266,7 @@ func Open(path string, ds dstore.Datastore, hot, cold bstore.Blockstore, cfg *Co
|
||||
|
||||
ss.txnViewsCond.L = &ss.txnViewsMx
|
||||
ss.txnSyncCond.L = &ss.txnSyncMx
|
||||
ss.chainSyncCond.L = &ss.chainSyncMx
|
||||
ss.ctx, ss.cancel = context.WithCancel(context.Background())
|
||||
|
||||
ss.reifyCond.L = &ss.reifyMx
|
||||
@ -822,6 +828,11 @@ func (s *SplitStore) Close() error {
|
||||
s.txnSyncCond.Broadcast()
|
||||
s.txnSyncMx.Unlock()
|
||||
|
||||
s.chainSyncMx.Lock()
|
||||
s.chainSyncFinished = true
|
||||
s.chainSyncCond.Broadcast()
|
||||
s.chainSyncMx.Unlock()
|
||||
|
||||
log.Warn("close with ongoing compaction in progress; waiting for it to finish...")
|
||||
for atomic.LoadInt32(&s.compacting) == 1 {
|
||||
time.Sleep(time.Second)
|
||||
|
@ -91,7 +91,35 @@ func (s *SplitStore) HeadChange(_, apply []*types.TipSet) error {
|
||||
// Regardless, we put a mutex in HeadChange just to be safe
|
||||
|
||||
if !atomic.CompareAndSwapInt32(&s.compacting, 0, 1) {
|
||||
// we are currently compacting -- protect the new tipset(s)
|
||||
// we are currently compacting
|
||||
// 1. Signal sync condition to yield compaction when out of sync and resume when in sync
|
||||
timestamp := time.Unix(int64(curTs.MinTimestamp()), 0)
|
||||
if CheckSyncGap && time.Since(timestamp) > SyncGapTime {
|
||||
/* Chain out of sync */
|
||||
if atomic.CompareAndSwapInt32(&s.outOfSync, 0, 1) {
|
||||
// transition from in sync to out of sync
|
||||
s.chainSyncMx.Lock()
|
||||
s.chainSyncFinished = false
|
||||
s.chainSyncMx.Unlock()
|
||||
}
|
||||
// already out of sync, no signaling necessary
|
||||
|
||||
}
|
||||
// TODO: ok to use hysteresis with no transitions between 30s and 1m?
|
||||
if time.Since(timestamp) < SyncWaitTime {
|
||||
/* Chain in sync */
|
||||
if atomic.CompareAndSwapInt32(&s.outOfSync, 0, 0) {
|
||||
// already in sync, no signaling necessary
|
||||
} else {
|
||||
// transition from out of sync to in sync
|
||||
s.chainSyncMx.Lock()
|
||||
s.chainSyncFinished = true
|
||||
s.chainSyncCond.Broadcast()
|
||||
s.chainSyncMx.Unlock()
|
||||
}
|
||||
|
||||
}
|
||||
// 2. protect the new tipset(s)
|
||||
s.protectTipSets(apply)
|
||||
return nil
|
||||
}
|
||||
@ -427,7 +455,7 @@ func (s *SplitStore) protectTxnRefs(markSet MarkSet) error {
|
||||
// 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) (int64, error) {
|
||||
if err := s.checkClosing(); err != nil {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
@ -545,7 +573,7 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error {
|
||||
}
|
||||
defer coldSet.Close() //nolint:errcheck
|
||||
|
||||
if err := s.checkClosing(); err != nil {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -617,7 +645,7 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error {
|
||||
|
||||
log.Infow("marking done", "took", time.Since(startMark), "marked", *count)
|
||||
|
||||
if err := s.checkClosing(); err != nil {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -627,7 +655,7 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error {
|
||||
return xerrors.Errorf("error protecting transactional refs: %w", err)
|
||||
}
|
||||
|
||||
if err := s.checkClosing(); err != nil {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -704,7 +732,7 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error {
|
||||
stats.Record(s.ctx, metrics.SplitstoreCompactionHot.M(hotCnt))
|
||||
stats.Record(s.ctx, metrics.SplitstoreCompactionCold.M(coldCnt))
|
||||
|
||||
if err := s.checkClosing(); err != nil {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -713,7 +741,7 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error {
|
||||
// possibly delete objects we didn't have when we were collecting cold objects)
|
||||
s.waitForMissingRefs(markSet)
|
||||
|
||||
if err := s.checkClosing(); err != nil {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -733,7 +761,7 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error {
|
||||
}
|
||||
log.Infow("moving done", "took", time.Since(startMove))
|
||||
|
||||
if err := s.checkClosing(); err != nil {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -764,7 +792,7 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error {
|
||||
}
|
||||
|
||||
// wait for the head to catch up so that the current tipset is marked
|
||||
s.waitForSync()
|
||||
s.waitForTxnSync()
|
||||
|
||||
if err := s.checkClosing(); err != nil {
|
||||
return err
|
||||
@ -865,7 +893,7 @@ func (s *SplitStore) beginCriticalSection(markSet MarkSet) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *SplitStore) waitForSync() {
|
||||
func (s *SplitStore) waitForTxnSync() {
|
||||
log.Info("waiting for sync")
|
||||
if !CheckSyncGap {
|
||||
log.Warnf("If you see this outside of test it is a serious splitstore issue")
|
||||
@ -884,6 +912,25 @@ func (s *SplitStore) waitForSync() {
|
||||
}
|
||||
}
|
||||
|
||||
// Block compaction operations if chain sync has fallen behind
|
||||
func (s *SplitStore) waitForSync() {
|
||||
if atomic.LoadInt32(&s.outOfSync) == 0 {
|
||||
return
|
||||
}
|
||||
s.chainSyncMx.Lock()
|
||||
defer s.chainSyncMx.Unlock()
|
||||
|
||||
for !s.chainSyncFinished {
|
||||
s.chainSyncCond.Wait()
|
||||
}
|
||||
}
|
||||
|
||||
// Combined sync and closing check
|
||||
func (s *SplitStore) checkYield() error {
|
||||
s.waitForSync()
|
||||
return s.checkClosing()
|
||||
}
|
||||
|
||||
func (s *SplitStore) endTxnProtect() {
|
||||
s.txnLk.Lock()
|
||||
defer s.txnLk.Unlock()
|
||||
@ -1037,7 +1084,7 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp
|
||||
|
||||
for len(toWalk) > 0 {
|
||||
// walking can take a while, so check this with every opportunity
|
||||
if err := s.checkClosing(); err != nil {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -1106,7 +1153,7 @@ func (s *SplitStore) walkObject(c cid.Cid, visitor ObjectVisitor, f func(cid.Cid
|
||||
}
|
||||
|
||||
// check this before recursing
|
||||
if err := s.checkClosing(); err != nil {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
@ -1175,7 +1222,7 @@ func (s *SplitStore) walkObjectIncomplete(c cid.Cid, visitor ObjectVisitor, f, m
|
||||
}
|
||||
|
||||
// check this before recursing
|
||||
if err := s.checkClosing(); err != nil {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return sz, err
|
||||
}
|
||||
|
||||
@ -1262,7 +1309,7 @@ func (s *SplitStore) moveColdBlocks(coldr *ColdSetReader) error {
|
||||
batch := make([]blocks.Block, 0, batchSize)
|
||||
|
||||
err := coldr.ForEach(func(c cid.Cid) error {
|
||||
if err := s.checkClosing(); err != nil {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return err
|
||||
}
|
||||
blk, err := s.hot.Get(s.ctx, c)
|
||||
|
@ -65,10 +65,15 @@ func (s *SplitStore) gcHotAfterCompaction() {
|
||||
}
|
||||
|
||||
func (s *SplitStore) gcBlockstore(b bstore.Blockstore, opts []bstore.BlockstoreGCOption) error {
|
||||
if err := s.checkYield(); err != nil {
|
||||
return err
|
||||
}
|
||||
if gc, ok := b.(bstore.BlockstoreGC); ok {
|
||||
log.Info("garbage collecting blockstore")
|
||||
startGC := time.Now()
|
||||
|
||||
opts = append(opts, bstore.WithCheckFreq(90*time.Second))
|
||||
opts = append(opts, bstore.WithCheck(s.checkYield))
|
||||
if err := gc.CollectGarbage(s.ctx, opts...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
BIN
build/actors/v11.tar.zst
Normal file
BIN
build/actors/v11.tar.zst
Normal file
Binary file not shown.
@ -1,2 +1,2 @@
|
||||
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWCa1wgMMBB9JjA2kYqaN1v5uh7xvcsc2gQJBHzPp7G57H
|
||||
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWD6fCvo1dyci6wsjTLyv7eJK73pCVz6RCQjbtPvbc8LYw
|
||||
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWD5mtdmjHQ1Puj9Md7SEfoa7kWMpwqUhAKsyYsBP56LQC
|
||||
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWEoYPkm6o87ES6AppFY7d7WHJUQg7XVPRAyQZjEU31efQ
|
||||
|
@ -49,10 +49,10 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"verifiedregistry": MustParseCid("bafk2bzacecjkesz766626ab4svnzpq3jfs26a75vfktlfaku5fjdao2eyiqyq"),
|
||||
},
|
||||
}, {
|
||||
Network: "butterflynet",
|
||||
Version: 10,
|
||||
BundleGitTag: "v10.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzaceckjhsggacixv2d377zfdcnuio4hzkveprio3xnhm3gohi3zy3zco"),
|
||||
Network: "butterflynet",
|
||||
Version: 10,
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzaceckjhsggacixv2d377zfdcnuio4hzkveprio3xnhm3gohi3zy3zco"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacedkt3uzgugcsdrcsyfvizcpyr5eshltmienbyhjne2t7t3ktkihny"),
|
||||
"cron": MustParseCid("bafk2bzacecrehknegmfnhmhwy2g43cw52mvl7ptfpp44syus4iph7az7uveuq"),
|
||||
@ -71,6 +71,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacebojf25kc5yo7gskdbdgg5f52oppej2jp6nknzlvrww4ue5vkddd2"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceavue3zekq4wmvttck2vgxlcensrsgh5niu5qhna2owejycorftcc"),
|
||||
},
|
||||
}, {
|
||||
Network: "butterflynet",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzaceaiy4dsxxus5xp5n5i4tjzkb7sc54mjz7qnk2efhgmsrobjesxnza"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacecfdqb7p3jakhaa3cqnzpt7hxmhghrbxvafsylqno3febx55fnidw"),
|
||||
"cron": MustParseCid("bafk2bzaceavmqu2qihgbe3xdaotgypuzvdpiifnm7ll6rolks2u4lac6voosk"),
|
||||
"datacap": MustParseCid("bafk2bzacealtvh65rzb34fmyzw4m2np2htnio4w3pn4alzqovwxkdbf23dvpo"),
|
||||
"eam": MustParseCid("bafk2bzacedko6hcjmwpuwgma5pb4gr2wgyvregk3nqqjxit7dv4es6vh5cjoc"),
|
||||
"ethaccount": MustParseCid("bafk2bzacedhcei2xnr34poxr4xziypm2obqlibke4cs2cjfnr3sz6nf6h7fyy"),
|
||||
"evm": MustParseCid("bafk2bzacebn5lwxboiikhz67ajwa34v2lc4qevnhpwdnipbmrnutkvrrqkb46"),
|
||||
"init": MustParseCid("bafk2bzacea6vw4esh5tg7mprv5jkbx5xcyilcy4vvf64lss32mjyuvv2mh5ng"),
|
||||
"multisig": MustParseCid("bafk2bzacedq2afnwcfipay5twv5mgzjoio5bbjvyo4yqchdwqcr7wrareyx54"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacebbsvr7i7mqmaadyjibe5wxnv7bwvvec2wlgknuwda6ep45amnd5w"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzaceafuh6idvaqqkj353vs4qdl42tcmvnymewu5zf4rq2nruxdyunses"),
|
||||
"storagemarket": MustParseCid("bafk2bzaceb7bx4honi3byjllpdk6fea32dpu3vqvil3okodybdk5m3erlnwjw"),
|
||||
"storageminer": MustParseCid("bafk2bzacebxjhofdr3sb2uhy2ky2vcijh4nhmwkh5xijtbgk6dzkknji2kn7a"),
|
||||
"storagepower": MustParseCid("bafk2bzaceabskmmkas6njbowols7t4ib3bipa5abpomk3jtgfwojtzd7mjzfm"),
|
||||
"system": MustParseCid("bafk2bzacedtuh7cht3fud7fb4avl4g2zbz57lc4ohiaufpaex6dkmdokn5rgo"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceb37hxeuoo5rgf6ansrdl2ykm5v5zp6kireubn4orcopr67jbxv6k"),
|
||||
},
|
||||
}, {
|
||||
Network: "calibrationnet",
|
||||
Version: 8,
|
||||
@ -109,10 +132,10 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebh7dj6j7yi5vadh7lgqjtq42qi2uq4n6zy2g5vjeathacwn2tscu"),
|
||||
},
|
||||
}, {
|
||||
Network: "calibrationnet",
|
||||
Version: 10,
|
||||
BundleGitTag: "v10.0.0-rc.1",
|
||||
ManifestCid: MustParseCid("bafy2bzaced25ta3j6ygs34roprilbtb3f6mxifyfnm7z7ndquaruxzdq3y7lo"),
|
||||
Network: "calibrationnet",
|
||||
Version: 10,
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzaced25ta3j6ygs34roprilbtb3f6mxifyfnm7z7ndquaruxzdq3y7lo"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacebhfuz3sv7duvk653544xsxhdn4lsmy7ol7k6gdgancyctvmd7lnq"),
|
||||
"cron": MustParseCid("bafk2bzacecw2yjb6ysieffa7lk7xd32b3n4ssowvafolt7eq52lp6lk4lkhji"),
|
||||
@ -131,6 +154,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacea4mtukm5zazygkdbgdf26cpnwwif5n2no7s6tknpxlwy6fpq3mug"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacec67wuchq64k7kgrujguukjvdlsl24pgighqdx5vgjhyk6bycrwnc"),
|
||||
},
|
||||
}, {
|
||||
Network: "calibrationnet",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0-rc2",
|
||||
ManifestCid: MustParseCid("bafy2bzacedhuowetjy2h4cxnijz2l64h4mzpk5m256oywp4evarpono3cjhco"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacebor5mnjnsav34cmm5pcd3dy4wubbv4wtcrvba7depy3sct7ie4sy"),
|
||||
"cron": MustParseCid("bafk2bzacebetehhedh55alfn4rcx2mhjhvuiustxlhtxc3drkemnpttws5eqw"),
|
||||
"datacap": MustParseCid("bafk2bzaced6uhmrh5jjexhw4lco4ipesi2iutl7uupnyspgmnbydyo3amtu4i"),
|
||||
"eam": MustParseCid("bafk2bzacea6wzcnflfnaxqnwydoghh7ezg5au32ew3bnzljzpiw6fimhlpoiu"),
|
||||
"ethaccount": MustParseCid("bafk2bzacedrbpvjvyzif2cjxosm4pliyq2m6wzndvrg7r6hzdhixplzvgubbw"),
|
||||
"evm": MustParseCid("bafk2bzaceabftmhejmvjvpzmbsv4cvaew6v5juj5sqtq7cfijugwsnahnsy5w"),
|
||||
"init": MustParseCid("bafk2bzaceduyjd35y7o2lhvevtysqf45rp5ot7x5f36q6iond6dyiz6773g5q"),
|
||||
"multisig": MustParseCid("bafk2bzacebcb72fmbpocetnzgni2wnbrduamlqx6fl3yelrlzu7id6bu5ib5g"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceazwhm63kyp47pste5i5acnuhosrgythyagf3kc5clogiqqx6vkzk"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacecp7xo5ev46y64zr5osnn5fxo7itpoqw235tcfv6eo4rymzdemet2"),
|
||||
"storagemarket": MustParseCid("bafk2bzacedjt5mueomasx7dijooxnwxsbtzu2dj2ppp45rtle4kiinkmgzeei"),
|
||||
"storageminer": MustParseCid("bafk2bzacebkjnjp5okqjhjxzft5qkuv36u4tz7inawseiwi2kw4j43xpxvhpm"),
|
||||
"storagepower": MustParseCid("bafk2bzaced2qsypqwore3jrdtaesh4itst2fyeepdsozvtffc2pianzmphdum"),
|
||||
"system": MustParseCid("bafk2bzacedqvik2n3phnj3cni3h2k5mtvz43nyq7mdmv7k7euejysvajywdug"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceceoo5jlom2zweh7kpye2vkj33wgqnkjshlsw2neemqkfg5g2rmvg"),
|
||||
},
|
||||
}, {
|
||||
Network: "caterpillarnet",
|
||||
Version: 8,
|
||||
@ -178,10 +224,10 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebzndvdqtdck2y35smcxezldgh6nm6rbkj3g3fmiknsgg2uah235y"),
|
||||
},
|
||||
}, {
|
||||
Network: "caterpillarnet",
|
||||
Version: 10,
|
||||
BundleGitTag: "v10.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzaceajftd7jawqnwf4kzkotksrwy6ag7mu2apkvypzrrmxboheuum5oi"),
|
||||
Network: "caterpillarnet",
|
||||
Version: 10,
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzaceajftd7jawqnwf4kzkotksrwy6ag7mu2apkvypzrrmxboheuum5oi"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacecsbx4tovnr5x2ifcpqbpx33oht74mgtvmaauzrqcq2wnm7prr7ak"),
|
||||
"cron": MustParseCid("bafk2bzacecpzfajba6m4v4ty342jw6lcu6n63bwtldmzko733wpd2q5jzfdvu"),
|
||||
@ -200,6 +246,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacecfivztuulqqv4o5oyvvvrkblwix4hqt24pqru6ivnpioefhuhria"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacecdhw6x7dfrxfysmn6tdbn2ny464omgqppxhjuawxauscidppd7pc"),
|
||||
},
|
||||
}, {
|
||||
Network: "caterpillarnet",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacebexc2jgzwr5ngn6jdnkwdqwwmcapajuypdgvopoe6bnvp4yxm4o2"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaceanjiq5m3feytue5m7hhxfkob2ofg2greoct5tr77reuhrjglo66g"),
|
||||
"cron": MustParseCid("bafk2bzaceavgd5qj6n744tukhdrvxejygzs3jnlizmcvjsdnxkgiimrd5jrys"),
|
||||
"datacap": MustParseCid("bafk2bzacedmdywxwrzop2gmf4ys5stydlmvbe35j3nyr2efmf273briksuvse"),
|
||||
"eam": MustParseCid("bafk2bzacec7qo7s72li7tqysllstlrxxm2dhfqv2w32pytel2e775cki4ozqm"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceaygtkliu26ubb7ivljrvaeesp5sbjlis5okzl35ishxioa2tlx4w"),
|
||||
"evm": MustParseCid("bafk2bzacebo7iqzy2ophz4f3civzwlltec7q5fut7kmtfckr6vy33r6ic5eqe"),
|
||||
"init": MustParseCid("bafk2bzaceb7uzzlsquqwrqhb2vpbvk3jgr4wp5i3smu2splnag2v5sppdehns"),
|
||||
"multisig": MustParseCid("bafk2bzacebwibfqrytobl4pjtny244zkmfoomazbap3r5gddjryckx5js4csi"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacecuaa5esuxpouigxoamyl5gire2qqqhvyhewsig2x2j73f6ksh7go"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzaced4xxqhv63njf2ibvsqshlwikafctxev7aho5lgsfxyt2javjwvtw"),
|
||||
"storagemarket": MustParseCid("bafk2bzacedwtx3xokqmbgkgkoqkdt6lam4ymdjb3eznlbtec5wcrtx74l2bpc"),
|
||||
"storageminer": MustParseCid("bafk2bzacebbbe4sdo3xxkez7x7lkl6j46w34vx7eg7xswmdzhp7moa44p3wjg"),
|
||||
"storagepower": MustParseCid("bafk2bzacedfgz6n24tjsor4pcayomim2f5f3a3fgyatmjgwxxeejna7okndda"),
|
||||
"system": MustParseCid("bafk2bzacebxfzeom3d7ahcz2n2nlwp7ncv767bdbbrisugks4l6v7lcu2tmyg"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacedaws3or3twy45ltcxucgvqijsje4x675ph6vup2w35smlfneamno"),
|
||||
},
|
||||
}, {
|
||||
Network: "devnet",
|
||||
Version: 8,
|
||||
@ -238,10 +307,10 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"verifiedregistry": MustParseCid("bafk2bzacednorhcy446agy7ecpmfms2u4aoa3mj2eqomffuoerbik5yavrxyi"),
|
||||
},
|
||||
}, {
|
||||
Network: "devnet",
|
||||
Version: 10,
|
||||
BundleGitTag: "v10.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacebzz376j5kizfck56366kdz5aut6ktqrvqbi3efa2d4l2o2m653ts"),
|
||||
Network: "devnet",
|
||||
Version: 10,
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzacebzz376j5kizfck56366kdz5aut6ktqrvqbi3efa2d4l2o2m653ts"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacedkj5dqs5xxamnlug2d5dyjl6askf7wlmvwzhmsrzcvogv7acqfe6"),
|
||||
"cron": MustParseCid("bafk2bzaceabslrigld2vshng6sppbp3bsptjtttvbxctwqe5lkyl2efom2wu4"),
|
||||
@ -260,6 +329,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzaceairk5qz5hyzt4yyaxa356aszyifswiust5ilxizwxujcmtzvjzoa"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaced2mkyqobpgna5jevosym3adv2bvraggigyz2jgn5cxymirxj4x3i"),
|
||||
},
|
||||
}, {
|
||||
Network: "devnet",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzaceay35go4xbjb45km6o46e5bib3bi46panhovcbedrynzwmm3drr4i"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacecf2pprkbdlpm4e2xz3ufunxtgrgyh2ie3stuqiyhibsvdze7kvri"),
|
||||
"cron": MustParseCid("bafk2bzaceasr5d2skowvzv5mzsyak6waqrgc46ewj6rzbapkfi5woom6n6bwa"),
|
||||
"datacap": MustParseCid("bafk2bzaceaqd77gptubupda7rp7daxkxbkzwc253dxhiyoezxvj2tljmkgpny"),
|
||||
"eam": MustParseCid("bafk2bzacedve6p4ye6zxydjbfs4ode5r2equ7rqzpyltujsq2lu6wyxnijfx4"),
|
||||
"ethaccount": MustParseCid("bafk2bzacea25xfsxwew3h2crer6jlb4c5vwu2gtch2jh73ocuxjhupenyrugy"),
|
||||
"evm": MustParseCid("bafk2bzacece5hivtkmi757lyfahgti7xuqgofodb2u65pxgf6oizfwiiwlcsi"),
|
||||
"init": MustParseCid("bafk2bzacecxnr5y7qifzdqqiwfbjxv2yr7lbkcyu3e2mf5zjdncteupxdlquu"),
|
||||
"multisig": MustParseCid("bafk2bzaceayap4k4u3lbysaeeixct5fvhmafy3fa5eagvdpk3i4a7ubfdpobe"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceafgrz5wepbein35gie7rnsu7zttxvgllgdneuefmmy4j5izydtza"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacedwbtfqlx47fdkxjrb5mwiatheci44x3zkpx33smybc2cme23ymuo"),
|
||||
"storagemarket": MustParseCid("bafk2bzaceaj74fmooaf3gj3ebwon64ky7hhdh7kytdr3agclqfrqzmpzykh7g"),
|
||||
"storageminer": MustParseCid("bafk2bzacedb7bokkzzs7hnbhivp74pgcpermuy7j6b3ncodylksukkxtnn7ze"),
|
||||
"storagepower": MustParseCid("bafk2bzacedilnkegizkxz3nuutib4d4wwlk4bkla22loepia2h53yf4hysmq6"),
|
||||
"system": MustParseCid("bafk2bzacedpyoncjbl4oxkjm5e77ngvpy2xfajjc4myfsv2vltvzxioattlu2"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebdqi5tr5pjnem5nylg2zbqcugvi7oxi35bhnrfudx4y4ufhlit2k"),
|
||||
},
|
||||
}, {
|
||||
Network: "hyperspace",
|
||||
Version: 8,
|
||||
@ -321,10 +413,10 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"verifiedregistry": MustParseCid("bafk2bzacecf3yodlyudzukumehbuabgqljyhjt5ifiv4vetcfohnvsxzynwga"),
|
||||
},
|
||||
}, {
|
||||
Network: "mainnet",
|
||||
Version: 10,
|
||||
BundleGitTag: "v10.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacecsuyf7mmvrhkx2evng5gnz5canlnz2fdlzu2lvcgptiq2pzuovos"),
|
||||
Network: "mainnet",
|
||||
Version: 10,
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzacecsuyf7mmvrhkx2evng5gnz5canlnz2fdlzu2lvcgptiq2pzuovos"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaceampw4romta75hyz5p4cqriypmpbgnkxncgxgqn6zptv5lsp2w2bo"),
|
||||
"cron": MustParseCid("bafk2bzacedcbtsifegiu432m5tysjzkxkmoczxscb6hqpmrr6img7xzdbbs2g"),
|
||||
@ -343,6 +435,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacedakk5nofebyup4m7nvx6djksfwhnxzrfuq4oyemhpl4lllaikr64"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacedfel6edzqpe5oujno7fog4i526go4dtcs6vwrdtbpy2xq6htvcg6"),
|
||||
},
|
||||
}, {
|
||||
Network: "mainnet",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacecnhaiwcrpyjvzl4uv4q3jzoif26okl3m66q3cijp3dfwlcxwztwo"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacealnlr7st6lkwoh6wxpf2hnrlex5sknaopgmkr2tuhg7vmbfy45so"),
|
||||
"cron": MustParseCid("bafk2bzacebpewdvvgt6tk2o2u4rcovdgym67tadiis5usemlbejg7k3kt567o"),
|
||||
"datacap": MustParseCid("bafk2bzacebslykoyrb2hm7aacjngqgd5n2wmeii2goadrs5zaya3pvdf6pdnq"),
|
||||
"eam": MustParseCid("bafk2bzaceaelwt4yfsfvsu3pa3miwalsvy3cfkcjvmt4sqoeopsppnrmj2mf2"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceclkmc4yidxc6lgcjpfypbde2eddnevcveo4j5kmh4ek6inqysz2k"),
|
||||
"evm": MustParseCid("bafk2bzacediwh6etwzwmb5pivtclpdplewdjzphouwqpppce6opisjv2fjqfe"),
|
||||
"init": MustParseCid("bafk2bzaceckwf3w6n2nw6eh77ktmsxqgsvshonvgnyk5q5syyngtetxvasfxg"),
|
||||
"multisig": MustParseCid("bafk2bzaceafajceqwg5ybiz7xw6rxammuirkgtuv625gzaehsqfprm4bazjmk"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceb4e6cnsnviegmqvsmoxzncruvhra54piq7bwiqfqevle6oob2gvo"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacebwjw2vxkobs7r2kwjdqqb42h2kucyuk6flbnyzw4odg5s4mogamo"),
|
||||
"storagemarket": MustParseCid("bafk2bzaceazu2j2zu4p24tr22btnqzkhzjvyjltlvsagaj6w3syevikeb5d7m"),
|
||||
"storageminer": MustParseCid("bafk2bzacec24okjqrp7c7rj3hbrs5ez5apvwah2ruka6haesgfngf37mhk6us"),
|
||||
"storagepower": MustParseCid("bafk2bzaceaxgloxuzg35vu7l7tohdgaq2frsfp4ejmuo7tkoxjp5zqrze6sf4"),
|
||||
"system": MustParseCid("bafk2bzaced7npe5mt5nh72jxr2igi2sofoa7gedt4w6kueeke7i3xxugqpjfm"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacedej3dnr62g2je2abmyjg3xqv4otvh6e26du5fcrhvw7zgcaaez3a"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing",
|
||||
Version: 8,
|
||||
@ -381,10 +496,10 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceatmqip2o3ausbntvdhj7yemu6hb3b5yqv6hm42gylbbmz7geocpm"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing",
|
||||
Version: 10,
|
||||
BundleGitTag: "v10.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacebsp3bkxwsijenqeimhvhtg52d6o76hn6qhzxveqfq7d5hdd5l2ee"),
|
||||
Network: "testing",
|
||||
Version: 10,
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzacebsp3bkxwsijenqeimhvhtg52d6o76hn6qhzxveqfq7d5hdd5l2ee"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaceazxb6p2xg6caivmie6k2bvutyesngwyvhwv4eemwu7ia4vnqkcuy"),
|
||||
"cron": MustParseCid("bafk2bzaceax6ym73boyl5zdpbcr6zmbajzylmcdvlapz5zcqgzcshakz44jbq"),
|
||||
@ -403,6 +518,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacecf2jimdz7knhngs64ximfz3eaud6s3kiunmkybgrkupdjyo2dw7o"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacecdmek2htsgcyoyl35glakyab66cojqo2y335njnm7krleb6yfbps"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacea2vxre32tg3xhpejrktiuzx4d3pcoe7yyazgscfibmegmchr6n42"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaceccerssb3tgel6ukdghlwvs7dxsolj4fpkgn7dh7owzwapqb6ejpw"),
|
||||
"cron": MustParseCid("bafk2bzacebtfl6fczxnitrqqjhyefskf3asyn3gzuvqcddieoqfsaddk5fd4q"),
|
||||
"datacap": MustParseCid("bafk2bzacediikc55y6uzmnhucf4mik6rqpjulwvgp5gdibogxjhgbvusmzff2"),
|
||||
"eam": MustParseCid("bafk2bzaceazqi5ezossp6kvqogaaba6hxlfarqgniktmb7iy5qonha3eflz6m"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceb77ospgfqqmf67v23wkyeg7lr2mu53ybaacu3bslx7s7nhttdueo"),
|
||||
"evm": MustParseCid("bafk2bzacedvgt7mv22hux4vrnklylq7qmw43kfrqwam6wdsfzkdnaewr33qbu"),
|
||||
"init": MustParseCid("bafk2bzacealzb3nk2oypway5ubz3hs5py5ok5tuw545454vg4d3mwbslef4js"),
|
||||
"multisig": MustParseCid("bafk2bzacec45ppn4hrwizmopp2v2atkxw35tb6yem6uqhqilrv7aiaknnnxmu"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceajbr3t6cngzh3katqteflbcrtwtdgbthnlfemon5tg6rytf2uonw"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacea7ycf53kbq4robcuh3ziy7qwwhaqamc5krn3lugypgpxhlewdaiq"),
|
||||
"storagemarket": MustParseCid("bafk2bzacedskmbcpaeb6bezs32szh52jrukvihobluadauayroo5gzrt32tkm"),
|
||||
"storageminer": MustParseCid("bafk2bzaced3yg5lctmswnbkxyd6cleg3llyux7fu2vbddyd2ho36fpym423mq"),
|
||||
"storagepower": MustParseCid("bafk2bzacebvpdf372fzxgixztbz2r7ayxyvx7jmdxwlfuqt2cq7tnqgie3klw"),
|
||||
"system": MustParseCid("bafk2bzaceaatvscbnkv36ixhtt2zel4er5oskxevgumh5gegqkv7uzah36f24"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebp2r56wxadvfzpfbmqwfi3dlnwpmoc5u4tau2hfftbkuafkhye64"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing-fake-proofs",
|
||||
Version: 8,
|
||||
@ -441,10 +579,10 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceatmqip2o3ausbntvdhj7yemu6hb3b5yqv6hm42gylbbmz7geocpm"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing-fake-proofs",
|
||||
Version: 10,
|
||||
BundleGitTag: "v10.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacedwap2uuii4luljckrnb4vkur2unb6fyinn7xjie6xlva2wmlygj2"),
|
||||
Network: "testing-fake-proofs",
|
||||
Version: 10,
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzacedwap2uuii4luljckrnb4vkur2unb6fyinn7xjie6xlva2wmlygj2"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaceazxb6p2xg6caivmie6k2bvutyesngwyvhwv4eemwu7ia4vnqkcuy"),
|
||||
"cron": MustParseCid("bafk2bzaceax6ym73boyl5zdpbcr6zmbajzylmcdvlapz5zcqgzcshakz44jbq"),
|
||||
@ -463,4 +601,27 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacecf2jimdz7knhngs64ximfz3eaud6s3kiunmkybgrkupdjyo2dw7o"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacecdmek2htsgcyoyl35glakyab66cojqo2y335njnm7krleb6yfbps"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing-fake-proofs",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacecojemqglhzzhjnhgtrcbsgkyv67ziytvtbhwlr4ym4oxqofv7zui"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaceccerssb3tgel6ukdghlwvs7dxsolj4fpkgn7dh7owzwapqb6ejpw"),
|
||||
"cron": MustParseCid("bafk2bzacebtfl6fczxnitrqqjhyefskf3asyn3gzuvqcddieoqfsaddk5fd4q"),
|
||||
"datacap": MustParseCid("bafk2bzacediikc55y6uzmnhucf4mik6rqpjulwvgp5gdibogxjhgbvusmzff2"),
|
||||
"eam": MustParseCid("bafk2bzaceazqi5ezossp6kvqogaaba6hxlfarqgniktmb7iy5qonha3eflz6m"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceb77ospgfqqmf67v23wkyeg7lr2mu53ybaacu3bslx7s7nhttdueo"),
|
||||
"evm": MustParseCid("bafk2bzacedvgt7mv22hux4vrnklylq7qmw43kfrqwam6wdsfzkdnaewr33qbu"),
|
||||
"init": MustParseCid("bafk2bzacealzb3nk2oypway5ubz3hs5py5ok5tuw545454vg4d3mwbslef4js"),
|
||||
"multisig": MustParseCid("bafk2bzacec45ppn4hrwizmopp2v2atkxw35tb6yem6uqhqilrv7aiaknnnxmu"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceajbr3t6cngzh3katqteflbcrtwtdgbthnlfemon5tg6rytf2uonw"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacea7ycf53kbq4robcuh3ziy7qwwhaqamc5krn3lugypgpxhlewdaiq"),
|
||||
"storagemarket": MustParseCid("bafk2bzacedskmbcpaeb6bezs32szh52jrukvihobluadauayroo5gzrt32tkm"),
|
||||
"storageminer": MustParseCid("bafk2bzacebqeztpa5exztccqjwqhan5droiy7ga6zekm6f2gzxoe655vneczm"),
|
||||
"storagepower": MustParseCid("bafk2bzaceb2tlyuwxncdxsh3hc4fwcjnpxaijkiv54ustwdjbrqabxdsc27km"),
|
||||
"system": MustParseCid("bafk2bzaceaatvscbnkv36ixhtt2zel4er5oskxevgumh5gegqkv7uzah36f24"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebp2r56wxadvfzpfbmqwfi3dlnwpmoc5u4tau2hfftbkuafkhye64"),
|
||||
},
|
||||
}}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -24,7 +24,7 @@ var NetworkBundle = "devnet"
|
||||
var BundleOverrides map[actorstypes.Version]string
|
||||
var ActorDebugging = true
|
||||
|
||||
const GenesisNetworkVersion = network.Version17
|
||||
const GenesisNetworkVersion = network.Version18
|
||||
|
||||
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
|
||||
|
||||
@ -60,7 +60,11 @@ var UpgradeSkyrHeight = abi.ChainEpoch(-19)
|
||||
|
||||
var UpgradeSharkHeight = abi.ChainEpoch(-20)
|
||||
|
||||
var UpgradeHyggeHeight = abi.ChainEpoch(30)
|
||||
var UpgradeHyggeHeight = abi.ChainEpoch(-21)
|
||||
|
||||
var UpgradeLightningHeight = abi.ChainEpoch(30)
|
||||
|
||||
var UpgradeThunderHeight = abi.ChainEpoch(1000)
|
||||
|
||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
@ -115,6 +119,8 @@ func init() {
|
||||
UpgradeSkyrHeight = getUpgradeHeight("LOTUS_SKYR_HEIGHT", UpgradeSkyrHeight)
|
||||
UpgradeSharkHeight = getUpgradeHeight("LOTUS_SHARK_HEIGHT", UpgradeSharkHeight)
|
||||
UpgradeHyggeHeight = getUpgradeHeight("LOTUS_HYGGE_HEIGHT", UpgradeHyggeHeight)
|
||||
UpgradeLightningHeight = getUpgradeHeight("LOTUS_LIGHTNING_HEIGHT", UpgradeLightningHeight)
|
||||
UpgradeThunderHeight = getUpgradeHeight("LOTUS_THUNDER_HEIGHT", UpgradeThunderHeight)
|
||||
|
||||
BuildType |= Build2k
|
||||
|
||||
|
@ -21,7 +21,7 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
}
|
||||
|
||||
const GenesisNetworkVersion = network.Version17
|
||||
const GenesisNetworkVersion = network.Version18
|
||||
|
||||
var NetworkBundle = "butterflynet"
|
||||
var BundleOverrides map[actorstypes.Version]string
|
||||
@ -52,8 +52,12 @@ const UpgradeHyperdriveHeight = -16
|
||||
const UpgradeChocolateHeight = -17
|
||||
const UpgradeOhSnapHeight = -18
|
||||
const UpgradeSkyrHeight = -19
|
||||
const UpgradeSharkHeight = abi.ChainEpoch(-20)
|
||||
const UpgradeHyggeHeight = abi.ChainEpoch(600)
|
||||
const UpgradeSharkHeight = -20
|
||||
const UpgradeHyggeHeight = -21
|
||||
|
||||
const UpgradeLightningHeight = 50
|
||||
|
||||
const UpgradeThunderHeight = UpgradeLightningHeight + 360
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
|
@ -74,6 +74,12 @@ const UpgradeSharkHeight = 16800 // 6 days after genesis
|
||||
// 2023-02-21T16:30:00Z
|
||||
const UpgradeHyggeHeight = 322354
|
||||
|
||||
// 2023-04-20T14:00:00Z
|
||||
const UpgradeLightningHeight = 489094
|
||||
|
||||
// 2023-04-21T16:00:00Z
|
||||
const UpgradeThunderHeight = UpgradeLightningHeight + 3120
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
|
@ -53,7 +53,13 @@ var UpgradeSkyrHeight = abi.ChainEpoch(-19)
|
||||
|
||||
const UpgradeSharkHeight = abi.ChainEpoch(-20)
|
||||
|
||||
const UpgradeHyggeHeight = abi.ChainEpoch(99999999999999)
|
||||
const UpgradeHyggeHeight = abi.ChainEpoch(100)
|
||||
|
||||
// ??????????
|
||||
const UpgradeLightningHeight = 200
|
||||
|
||||
// ??????????????????
|
||||
const UpgradeThunderHeight = 300
|
||||
|
||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
|
@ -88,7 +88,13 @@ const UpgradeSkyrHeight = 1960320
|
||||
const UpgradeSharkHeight = 2383680
|
||||
|
||||
// 2023-03-14T15:14:00Z
|
||||
var UpgradeHyggeHeight = abi.ChainEpoch(2683348)
|
||||
const UpgradeHyggeHeight = 2683348
|
||||
|
||||
// 2023-04-27T13:00:00Z
|
||||
var UpgradeLightningHeight = abi.ChainEpoch(2809800)
|
||||
|
||||
// 2023-05-18T13:00:00Z
|
||||
var UpgradeThunderHeight = UpgradeLightningHeight + 2880*21
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
@ -103,8 +109,12 @@ func init() {
|
||||
SetAddressNetwork(address.Mainnet)
|
||||
}
|
||||
|
||||
if os.Getenv("LOTUS_DISABLE_HYGGE") == "1" {
|
||||
UpgradeHyggeHeight = math.MaxInt64
|
||||
if os.Getenv("LOTUS_DISABLE_LIGHTNING") == "1" {
|
||||
UpgradeLightningHeight = math.MaxInt64
|
||||
}
|
||||
|
||||
if os.Getenv("LOTUS_DISABLE_THUNDER") == "1" {
|
||||
UpgradeThunderHeight = math.MaxInt64
|
||||
}
|
||||
|
||||
// NOTE: DO NOT change this unless you REALLY know what you're doing. This is not consensus critical, however,
|
||||
|
@ -28,12 +28,9 @@ const AllowableClockDriftSecs = uint64(1)
|
||||
|
||||
// Used by tests and some obscure tooling
|
||||
/* inline-gen template
|
||||
|
||||
const TestNetworkVersion = network.Version{{.latestNetworkVersion}}
|
||||
|
||||
/* inline-gen start */
|
||||
|
||||
const TestNetworkVersion = network.Version18
|
||||
const TestNetworkVersion = network.Version20
|
||||
|
||||
/* inline-gen end */
|
||||
|
||||
|
@ -107,6 +107,8 @@ var (
|
||||
UpgradeSkyrHeight abi.ChainEpoch = -18
|
||||
UpgradeSharkHeight abi.ChainEpoch = -19
|
||||
UpgradeHyggeHeight abi.ChainEpoch = -20
|
||||
UpgradeLightningHeight abi.ChainEpoch = -21
|
||||
UpgradeThunderHeight abi.ChainEpoch = -22
|
||||
|
||||
DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin10 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
@ -22,7 +22,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
var Methods = builtin10.MethodsAccount
|
||||
var Methods = builtin11.MethodsAccount
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
@ -41,6 +41,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,6 +108,9 @@ func MakeState(store adt.Store, av actorstypes.Version, addr address.Address) (S
|
||||
case actorstypes.Version10:
|
||||
return make10(store, addr)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return make11(store, addr)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -132,5 +138,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
62
chain/actors/builtin/account/v11.go
generated
Normal file
62
chain/actors/builtin/account/v11.go
generated
Normal file
@ -0,0 +1,62 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
account11 "github.com/filecoin-project/go-state-types/builtin/v11/account"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store, addr address.Address) (State, error) {
|
||||
out := state11{store: store}
|
||||
out.State = account11.State{Address: addr}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
account11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) PubkeyAddress() (address.Address, error) {
|
||||
return s.Address, nil
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state11) ActorKey() string {
|
||||
return manifest.AccountKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -5,7 +5,7 @@ import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin10 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin11 "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"
|
||||
@ -37,6 +37,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,13 +104,16 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return make10(store)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return make11(store)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
var (
|
||||
Address = builtin10.CronActorAddr
|
||||
Methods = builtin10.MethodsCron
|
||||
Address = builtin11.CronActorAddr
|
||||
Methods = builtin11.MethodsCron
|
||||
)
|
||||
|
||||
type State interface {
|
||||
@ -130,5 +136,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
57
chain/actors/builtin/cron/v11.go
generated
Normal file
57
chain/actors/builtin/cron/v11.go
generated
Normal file
@ -0,0 +1,57 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
cron11 "github.com/filecoin-project/go-state-types/builtin/v11/cron"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store) (State, error) {
|
||||
out := state11{store: store}
|
||||
out.State = *cron11.ConstructState(cron11.BuiltInEntries())
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
cron11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state11) ActorKey() string {
|
||||
return manifest.CronKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -7,7 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin10 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
@ -17,8 +17,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin10.DatacapActorAddr
|
||||
Methods = builtin10.MethodsDatacap
|
||||
Address = builtin11.DatacapActorAddr
|
||||
Methods = builtin11.MethodsDatacap
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -35,6 +35,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,6 +53,9 @@ func MakeState(store adt.Store, av actorstypes.Version, governor address.Address
|
||||
case actorstypes.Version10:
|
||||
return make10(store, governor, bitwidth)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return make11(store, governor, bitwidth)
|
||||
|
||||
default:
|
||||
return nil, xerrors.Errorf("datacap actor only valid for actors v9 and above, got %d", av)
|
||||
}
|
||||
@ -72,5 +78,6 @@ func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
82
chain/actors/builtin/datacap/v11.go
generated
Normal file
82
chain/actors/builtin/datacap/v11.go
generated
Normal file
@ -0,0 +1,82 @@
|
||||
package datacap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
datacap11 "github.com/filecoin-project/go-state-types/builtin/v11/datacap"
|
||||
adt11 "github.com/filecoin-project/go-state-types/builtin/v11/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 = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store, governor address.Address, bitwidth uint64) (State, error) {
|
||||
out := state11{store: store}
|
||||
s, err := datacap11.ConstructState(store, governor, bitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
datacap11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) Governor() (address.Address, error) {
|
||||
return s.State.Governor, nil
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state11) ForEachClient(cb func(addr address.Address, dcap abi.StoragePower) error) error {
|
||||
return forEachClient(s.store, actors.Version11, s.verifiedClients, cb)
|
||||
}
|
||||
|
||||
func (s *state11) verifiedClients() (adt.Map, error) {
|
||||
return adt11.AsMap(s.store, s.Token.Balances, int(s.Token.HamtBitWidth))
|
||||
}
|
||||
|
||||
func (s *state11) VerifiedClientDataCap(addr address.Address) (bool, abi.StoragePower, error) {
|
||||
return getDataCap(s.store, actors.Version11, s.verifiedClients, addr)
|
||||
}
|
||||
|
||||
func (s *state11) ActorKey() string {
|
||||
return manifest.DatacapKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -5,7 +5,7 @@ import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin10 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
@ -14,7 +14,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
var Methods = builtin10.MethodsEVM
|
||||
var Methods = builtin11.MethodsEVM
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
@ -27,6 +27,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,6 +42,9 @@ func MakeState(store adt.Store, av actorstypes.Version, bytecode cid.Cid) (State
|
||||
case actorstypes.Version10:
|
||||
return make10(store, bytecode)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return make11(store, bytecode)
|
||||
|
||||
default:
|
||||
return nil, xerrors.Errorf("evm actor only valid for actors v10 and above, got %d", av)
|
||||
}
|
||||
|
72
chain/actors/builtin/evm/v11.go
generated
Normal file
72
chain/actors/builtin/evm/v11.go
generated
Normal file
@ -0,0 +1,72 @@
|
||||
package evm
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
evm11 "github.com/filecoin-project/go-state-types/builtin/v11/evm"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store, bytecode cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
s, err := evm11.ConstructState(store, bytecode)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
evm11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) Nonce() (uint64, error) {
|
||||
return s.State.Nonce, nil
|
||||
}
|
||||
|
||||
func (s *state11) IsAlive() (bool, error) {
|
||||
return s.State.Tombstone == nil, nil
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state11) GetBytecodeCID() (cid.Cid, error) {
|
||||
return s.State.Bytecode, nil
|
||||
}
|
||||
|
||||
func (s *state11) GetBytecodeHash() ([32]byte, error) {
|
||||
return s.State.BytecodeHash, nil
|
||||
}
|
||||
|
||||
func (s *state11) GetBytecode() ([]byte, error) {
|
||||
bc, err := s.GetBytecodeCID()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var byteCode abi.CborBytesTransparent
|
||||
if err := s.store.Get(s.store.Context(), bc, &byteCode); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return byteCode, nil
|
||||
}
|
@ -7,7 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin10 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
@ -25,8 +25,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin10.InitActorAddr
|
||||
Methods = builtin10.MethodsInit
|
||||
Address = builtin11.InitActorAddr
|
||||
Methods = builtin11.MethodsInit
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -46,6 +46,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,6 +113,9 @@ func MakeState(store adt.Store, av actorstypes.Version, networkName string) (Sta
|
||||
case actorstypes.Version10:
|
||||
return make10(store, networkName)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return make11(store, networkName)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -160,5 +166,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
147
chain/actors/builtin/init/v11.go
generated
Normal file
147
chain/actors/builtin/init/v11.go
generated
Normal file
@ -0,0 +1,147 @@
|
||||
package init
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
init11 "github.com/filecoin-project/go-state-types/builtin/v11/init"
|
||||
adt11 "github.com/filecoin-project/go-state-types/builtin/v11/util/adt"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
)
|
||||
|
||||
var _ State = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store, networkName string) (State, error) {
|
||||
out := state11{store: store}
|
||||
|
||||
s, err := init11.ConstructState(store, networkName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
init11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) ResolveAddress(address address.Address) (address.Address, bool, error) {
|
||||
return s.State.ResolveAddress(s.store, address)
|
||||
}
|
||||
|
||||
func (s *state11) MapAddressToNewID(address address.Address) (address.Address, error) {
|
||||
return s.State.MapAddressToNewID(s.store, address)
|
||||
}
|
||||
|
||||
func (s *state11) ForEachActor(cb func(id abi.ActorID, address address.Address) error) error {
|
||||
addrs, err := adt11.AsMap(s.store, s.State.AddressMap, builtin11.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var actorID cbg.CborInt
|
||||
return addrs.ForEach(&actorID, func(key string) error {
|
||||
addr, err := address.NewFromBytes([]byte(key))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return cb(abi.ActorID(actorID), addr)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *state11) NetworkName() (dtypes.NetworkName, error) {
|
||||
return dtypes.NetworkName(s.State.NetworkName), nil
|
||||
}
|
||||
|
||||
func (s *state11) SetNetworkName(name string) error {
|
||||
s.State.NetworkName = name
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state11) SetNextID(id abi.ActorID) error {
|
||||
s.State.NextID = id
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state11) Remove(addrs ...address.Address) (err error) {
|
||||
m, err := adt11.AsMap(s.store, s.State.AddressMap, builtin11.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, addr := range addrs {
|
||||
if err = m.Delete(abi.AddrKey(addr)); err != nil {
|
||||
return xerrors.Errorf("failed to delete entry for address: %s; err: %w", addr, err)
|
||||
}
|
||||
}
|
||||
amr, err := m.Root()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to get address map root: %w", err)
|
||||
}
|
||||
s.State.AddressMap = amr
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state11) SetAddressMap(mcid cid.Cid) error {
|
||||
s.State.AddressMap = mcid
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state11) AddressMap() (adt.Map, error) {
|
||||
return adt11.AsMap(s.store, s.State.AddressMap, builtin11.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state11) AddressMapBitWidth() int {
|
||||
return builtin11.DefaultHamtBitwidth
|
||||
}
|
||||
|
||||
func (s *state11) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state11) ActorKey() string {
|
||||
return manifest.InitKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -52,6 +52,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,6 +119,9 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return make10(store)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return make11(store)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -208,6 +214,9 @@ func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStora
|
||||
case actorstypes.Version10:
|
||||
return decodePublishStorageDealsReturn10(b)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return decodePublishStorageDealsReturn11(b)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -293,5 +302,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
377
chain/actors/builtin/market/v11.go
generated
Normal file
377
chain/actors/builtin/market/v11.go
generated
Normal file
@ -0,0 +1,377 @@
|
||||
package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
market11 "github.com/filecoin-project/go-state-types/builtin/v11/market"
|
||||
adt11 "github.com/filecoin-project/go-state-types/builtin/v11/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"
|
||||
)
|
||||
|
||||
var _ State = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store) (State, error) {
|
||||
out := state11{store: store}
|
||||
|
||||
s, err := market11.ConstructState(store)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
market11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) TotalLocked() (abi.TokenAmount, error) {
|
||||
fml := types.BigAdd(s.TotalClientLockedCollateral, s.TotalProviderLockedCollateral)
|
||||
fml = types.BigAdd(fml, s.TotalClientStorageFee)
|
||||
return fml, nil
|
||||
}
|
||||
|
||||
func (s *state11) BalancesChanged(otherState State) (bool, error) {
|
||||
otherState11, ok := otherState.(*state11)
|
||||
if !ok {
|
||||
// there's no way to compare different versions of the state, so let's
|
||||
// just say that means the state of balances has changed
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.EscrowTable.Equals(otherState11.State.EscrowTable) || !s.State.LockedTable.Equals(otherState11.State.LockedTable), nil
|
||||
}
|
||||
|
||||
func (s *state11) StatesChanged(otherState State) (bool, error) {
|
||||
otherState11, ok := otherState.(*state11)
|
||||
if !ok {
|
||||
// there's no way to compare different versions of the state, so let's
|
||||
// just say that means the state of balances has changed
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.States.Equals(otherState11.State.States), nil
|
||||
}
|
||||
|
||||
func (s *state11) States() (DealStates, error) {
|
||||
stateArray, err := adt11.AsArray(s.store, s.State.States, market11.StatesAmtBitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &dealStates11{stateArray}, nil
|
||||
}
|
||||
|
||||
func (s *state11) ProposalsChanged(otherState State) (bool, error) {
|
||||
otherState11, ok := otherState.(*state11)
|
||||
if !ok {
|
||||
// there's no way to compare different versions of the state, so let's
|
||||
// just say that means the state of balances has changed
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.Proposals.Equals(otherState11.State.Proposals), nil
|
||||
}
|
||||
|
||||
func (s *state11) Proposals() (DealProposals, error) {
|
||||
proposalArray, err := adt11.AsArray(s.store, s.State.Proposals, market11.ProposalsAmtBitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &dealProposals11{proposalArray}, nil
|
||||
}
|
||||
|
||||
func (s *state11) EscrowTable() (BalanceTable, error) {
|
||||
bt, err := adt11.AsBalanceTable(s.store, s.State.EscrowTable)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &balanceTable11{bt}, nil
|
||||
}
|
||||
|
||||
func (s *state11) LockedTable() (BalanceTable, error) {
|
||||
bt, err := adt11.AsBalanceTable(s.store, s.State.LockedTable)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &balanceTable11{bt}, nil
|
||||
}
|
||||
|
||||
func (s *state11) VerifyDealsForActivation(
|
||||
minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
|
||||
) (weight, verifiedWeight abi.DealWeight, err error) {
|
||||
w, vw, _, err := market11.ValidateDealsForActivation(&s.State, s.store, deals, minerAddr, sectorExpiry, currEpoch)
|
||||
return w, vw, err
|
||||
}
|
||||
|
||||
func (s *state11) NextID() (abi.DealID, error) {
|
||||
return s.State.NextID, nil
|
||||
}
|
||||
|
||||
type balanceTable11 struct {
|
||||
*adt11.BalanceTable
|
||||
}
|
||||
|
||||
func (bt *balanceTable11) ForEach(cb func(address.Address, abi.TokenAmount) error) error {
|
||||
asMap := (*adt11.Map)(bt.BalanceTable)
|
||||
var ta abi.TokenAmount
|
||||
return asMap.ForEach(&ta, func(key string) error {
|
||||
a, err := address.NewFromBytes([]byte(key))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return cb(a, ta)
|
||||
})
|
||||
}
|
||||
|
||||
type dealStates11 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates11) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
var deal11 market11.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal11)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV11DealState(deal11)
|
||||
return &deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates11) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
var ds11 market11.DealState
|
||||
return s.Array.ForEach(&ds11, func(idx int64) error {
|
||||
return cb(abi.DealID(idx), fromV11DealState(ds11))
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates11) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
var ds11 market11.DealState
|
||||
if err := ds11.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV11DealState(ds11)
|
||||
return &ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates11) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV11DealState(v11 market11.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v11.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v11.LastUpdatedEpoch,
|
||||
SlashEpoch: v11.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
}
|
||||
|
||||
ret.VerifiedClaim = verifregtypes.AllocationId(v11.VerifiedClaim)
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
type dealProposals11 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealProposals11) Get(dealID abi.DealID) (*DealProposal, bool, error) {
|
||||
var proposal11 market11.DealProposal
|
||||
found, err := s.Array.Get(uint64(dealID), &proposal11)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
|
||||
proposal, err := fromV11DealProposal(proposal11)
|
||||
if err != nil {
|
||||
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return &proposal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals11) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
|
||||
var dp11 market11.DealProposal
|
||||
return s.Array.ForEach(&dp11, func(idx int64) error {
|
||||
dp, err := fromV11DealProposal(dp11)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return cb(abi.DealID(idx), dp)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealProposals11) decode(val *cbg.Deferred) (*DealProposal, error) {
|
||||
var dp11 market11.DealProposal
|
||||
if err := dp11.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
dp, err := fromV11DealProposal(dp11)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &dp, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals11) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV11DealProposal(v11 market11.DealProposal) (DealProposal, error) {
|
||||
|
||||
label, err := fromV11Label(v11.Label)
|
||||
|
||||
if err != nil {
|
||||
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
|
||||
}
|
||||
|
||||
return DealProposal{
|
||||
PieceCID: v11.PieceCID,
|
||||
PieceSize: v11.PieceSize,
|
||||
VerifiedDeal: v11.VerifiedDeal,
|
||||
Client: v11.Client,
|
||||
Provider: v11.Provider,
|
||||
|
||||
Label: label,
|
||||
|
||||
StartEpoch: v11.StartEpoch,
|
||||
EndEpoch: v11.EndEpoch,
|
||||
StoragePricePerEpoch: v11.StoragePricePerEpoch,
|
||||
|
||||
ProviderCollateral: v11.ProviderCollateral,
|
||||
ClientCollateral: v11.ClientCollateral,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func fromV11Label(v11 market11.DealLabel) (DealLabel, error) {
|
||||
if v11.IsString() {
|
||||
str, err := v11.ToString()
|
||||
if err != nil {
|
||||
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert string label to string: %w", err)
|
||||
}
|
||||
return markettypes.NewLabelFromString(str)
|
||||
}
|
||||
|
||||
bs, err := v11.ToBytes()
|
||||
if err != nil {
|
||||
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert bytes label to bytes: %w", err)
|
||||
}
|
||||
return markettypes.NewLabelFromBytes(bs)
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
var _ PublishStorageDealsReturn = (*publishStorageDealsReturn11)(nil)
|
||||
|
||||
func decodePublishStorageDealsReturn11(b []byte) (PublishStorageDealsReturn, error) {
|
||||
var retval market11.PublishStorageDealsReturn
|
||||
if err := retval.UnmarshalCBOR(bytes.NewReader(b)); err != nil {
|
||||
return nil, xerrors.Errorf("failed to unmarshal PublishStorageDealsReturn: %w", err)
|
||||
}
|
||||
|
||||
return &publishStorageDealsReturn11{retval}, nil
|
||||
}
|
||||
|
||||
type publishStorageDealsReturn11 struct {
|
||||
market11.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn11) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
set, err := r.ValidDeals.IsSet(index)
|
||||
if err != nil || !set {
|
||||
return false, -1, err
|
||||
}
|
||||
maskBf, err := bitfield.NewFromIter(&rlepluslazy.RunSliceIterator{
|
||||
Runs: []rlepluslazy.Run{rlepluslazy.Run{Val: true, Len: index}}})
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
before, err := bitfield.IntersectBitField(maskBf, r.ValidDeals)
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
outIdx, err := before.Count()
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
return set, int(outIdx), nil
|
||||
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn11) DealIDs() ([]abi.DealID, error) {
|
||||
return r.IDs, nil
|
||||
}
|
||||
|
||||
func (s *state11) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
|
||||
|
||||
allocations, err := adt11.AsMap(s.store, s.PendingDealAllocationIds, builtin.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("failed to load allocation id for %d: %w", dealId, err)
|
||||
}
|
||||
|
||||
var allocationId cbg.CborInt
|
||||
found, err := allocations.Get(abi.UIntKey(uint64(dealId)), &allocationId)
|
||||
if err != nil {
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("failed to load allocation id for %d: %w", dealId, err)
|
||||
}
|
||||
if !found {
|
||||
return verifregtypes.NoAllocationID, nil
|
||||
}
|
||||
|
||||
return verifregtypes.AllocationId(allocationId), nil
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) ActorKey() string {
|
||||
return manifest.MarketKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -175,15 +175,15 @@ func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.Re
|
||||
}
|
||||
|
||||
switch proof {
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1:
|
||||
return abi.RegisteredSealProof_StackedDrg2KiBV1_1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1, abi.RegisteredPoStProof_StackedDrgWindow8MiBV1_1:
|
||||
return abi.RegisteredSealProof_StackedDrg8MiBV1_1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1, abi.RegisteredPoStProof_StackedDrgWindow512MiBV1_1:
|
||||
return abi.RegisteredSealProof_StackedDrg512MiBV1_1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, abi.RegisteredPoStProof_StackedDrgWindow32GiBV1_1:
|
||||
return abi.RegisteredSealProof_StackedDrg32GiBV1_1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, abi.RegisteredPoStProof_StackedDrgWindow64GiBV1_1:
|
||||
return abi.RegisteredSealProof_StackedDrg64GiBV1_1, nil
|
||||
default:
|
||||
return -1, xerrors.Errorf("unrecognized window post type: %d", proof)
|
||||
@ -192,15 +192,15 @@ func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.Re
|
||||
|
||||
func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredPoStProof, error) {
|
||||
switch proof {
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1:
|
||||
return abi.RegisteredPoStProof_StackedDrgWinning2KiBV1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1, abi.RegisteredPoStProof_StackedDrgWindow8MiBV1_1:
|
||||
return abi.RegisteredPoStProof_StackedDrgWinning8MiBV1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1, abi.RegisteredPoStProof_StackedDrgWindow512MiBV1_1:
|
||||
return abi.RegisteredPoStProof_StackedDrgWinning512MiBV1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, abi.RegisteredPoStProof_StackedDrgWindow32GiBV1_1:
|
||||
return abi.RegisteredPoStProof_StackedDrgWinning32GiBV1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, abi.RegisteredPoStProof_StackedDrgWindow64GiBV1_1:
|
||||
return abi.RegisteredPoStProof_StackedDrgWinning64GiBV1, nil
|
||||
default:
|
||||
return -1, xerrors.Errorf("unknown proof type %d", proof)
|
||||
|
@ -45,6 +45,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,6 +112,9 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
case actors.Version10:
|
||||
return make10(store)
|
||||
|
||||
case actors.Version11:
|
||||
return make11(store)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -223,15 +229,15 @@ func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.Re
|
||||
}
|
||||
|
||||
switch proof {
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1:
|
||||
return abi.RegisteredSealProof_StackedDrg2KiBV1_1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1, abi.RegisteredPoStProof_StackedDrgWindow8MiBV1_1:
|
||||
return abi.RegisteredSealProof_StackedDrg8MiBV1_1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1, abi.RegisteredPoStProof_StackedDrgWindow512MiBV1_1:
|
||||
return abi.RegisteredSealProof_StackedDrg512MiBV1_1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, abi.RegisteredPoStProof_StackedDrgWindow32GiBV1_1:
|
||||
return abi.RegisteredSealProof_StackedDrg32GiBV1_1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, abi.RegisteredPoStProof_StackedDrgWindow64GiBV1_1:
|
||||
return abi.RegisteredSealProof_StackedDrg64GiBV1_1, nil
|
||||
default:
|
||||
return -1, xerrors.Errorf("unrecognized window post type: %d", proof)
|
||||
@ -240,15 +246,15 @@ func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.Re
|
||||
|
||||
func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredPoStProof, error) {
|
||||
switch proof {
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1:
|
||||
return abi.RegisteredPoStProof_StackedDrgWinning2KiBV1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1, abi.RegisteredPoStProof_StackedDrgWindow8MiBV1_1:
|
||||
return abi.RegisteredPoStProof_StackedDrgWinning8MiBV1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1, abi.RegisteredPoStProof_StackedDrgWindow512MiBV1_1:
|
||||
return abi.RegisteredPoStProof_StackedDrgWinning512MiBV1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, abi.RegisteredPoStProof_StackedDrgWindow32GiBV1_1:
|
||||
return abi.RegisteredPoStProof_StackedDrgWinning32GiBV1, nil
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1:
|
||||
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, abi.RegisteredPoStProof_StackedDrgWindow64GiBV1_1:
|
||||
return abi.RegisteredPoStProof_StackedDrgWinning64GiBV1, nil
|
||||
default:
|
||||
return -1, xerrors.Errorf("unknown proof type %d", proof)
|
||||
@ -314,5 +320,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
@ -70,19 +70,38 @@ func SealProofTypeFromSectorSize(ssize abi.SectorSize, nv network.Version) (abi.
|
||||
|
||||
// WindowPoStProofTypeFromSectorSize returns preferred post proof type for creating
|
||||
// new miner actors and new sectors
|
||||
func WindowPoStProofTypeFromSectorSize(ssize abi.SectorSize) (abi.RegisteredPoStProof, error) {
|
||||
switch ssize {
|
||||
case 2 << 10:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, nil
|
||||
case 8 << 20:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow8MiBV1, nil
|
||||
case 512 << 20:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow512MiBV1, nil
|
||||
case 32 << 30:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, nil
|
||||
case 64 << 30:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, nil
|
||||
default:
|
||||
return 0, xerrors.Errorf("unsupported sector size for miner: %v", ssize)
|
||||
func WindowPoStProofTypeFromSectorSize(ssize abi.SectorSize, nv network.Version) (abi.RegisteredPoStProof, error) {
|
||||
switch {
|
||||
case nv < network.Version19:
|
||||
switch ssize {
|
||||
case 2 << 10:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, nil
|
||||
case 8 << 20:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow8MiBV1, nil
|
||||
case 512 << 20:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow512MiBV1, nil
|
||||
case 32 << 30:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, nil
|
||||
case 64 << 30:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, nil
|
||||
default:
|
||||
return 0, xerrors.Errorf("unsupported sector size for miner: %v", ssize)
|
||||
}
|
||||
case nv >= network.Version19:
|
||||
switch ssize {
|
||||
case 2 << 10:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1, nil
|
||||
case 8 << 20:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow8MiBV1_1, nil
|
||||
case 512 << 20:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow512MiBV1_1, nil
|
||||
case 32 << 30:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow32GiBV1_1, nil
|
||||
case 64 << 30:
|
||||
return abi.RegisteredPoStProof_StackedDrgWindow64GiBV1_1, nil
|
||||
default:
|
||||
return 0, xerrors.Errorf("unsupported sector size for miner: %v", ssize)
|
||||
}
|
||||
}
|
||||
return 0, xerrors.Errorf("unsupported network version")
|
||||
}
|
||||
|
591
chain/actors/builtin/miner/v11.go
generated
Normal file
591
chain/actors/builtin/miner/v11.go
generated
Normal file
@ -0,0 +1,591 @@
|
||||
package miner
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
miner11 "github.com/filecoin-project/go-state-types/builtin/v11/miner"
|
||||
adt11 "github.com/filecoin-project/go-state-types/builtin/v11/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 = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store) (State, error) {
|
||||
out := state11{store: store}
|
||||
out.State = miner11.State{}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
miner11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
type deadline11 struct {
|
||||
miner11.Deadline
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
type partition11 struct {
|
||||
miner11.Partition
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmount, err error) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = xerrors.Errorf("failed to get available balance: %w", r)
|
||||
available = abi.NewTokenAmount(0)
|
||||
}
|
||||
}()
|
||||
// this panics if the miner doesnt have enough funds to cover their locked pledge
|
||||
available, err = s.GetAvailableBalance(bal)
|
||||
return available, err
|
||||
}
|
||||
|
||||
func (s *state11) VestedFunds(epoch abi.ChainEpoch) (abi.TokenAmount, error) {
|
||||
return s.CheckVestedFunds(s.store, epoch)
|
||||
}
|
||||
|
||||
func (s *state11) LockedFunds() (LockedFunds, error) {
|
||||
return LockedFunds{
|
||||
VestingFunds: s.State.LockedFunds,
|
||||
InitialPledgeRequirement: s.State.InitialPledge,
|
||||
PreCommitDeposits: s.State.PreCommitDeposits,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state11) FeeDebt() (abi.TokenAmount, error) {
|
||||
return s.State.FeeDebt, nil
|
||||
}
|
||||
|
||||
func (s *state11) InitialPledge() (abi.TokenAmount, error) {
|
||||
return s.State.InitialPledge, nil
|
||||
}
|
||||
|
||||
func (s *state11) PreCommitDeposits() (abi.TokenAmount, error) {
|
||||
return s.State.PreCommitDeposits, nil
|
||||
}
|
||||
|
||||
// Returns nil, nil if sector is not found
|
||||
func (s *state11) GetSector(num abi.SectorNumber) (*SectorOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ret := fromV11SectorOnChainInfo(*info)
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state11) FindSector(num abi.SectorNumber) (*SectorLocation, error) {
|
||||
dlIdx, partIdx, err := s.State.FindSector(s.store, num)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &SectorLocation{
|
||||
Deadline: dlIdx,
|
||||
Partition: partIdx,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state11) NumLiveSectors() (uint64, error) {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
var total uint64
|
||||
if err := dls.ForEach(s.store, func(dlIdx uint64, dl *miner11.Deadline) error {
|
||||
total += dl.LiveSectors
|
||||
return nil
|
||||
}); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return total, nil
|
||||
}
|
||||
|
||||
// GetSectorExpiration returns the effective expiration of the given sector.
|
||||
//
|
||||
// If the sector does not expire early, the Early expiration field is 0.
|
||||
func (s *state11) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, error) {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// NOTE: this can be optimized significantly.
|
||||
// 1. If the sector is non-faulty, it will expire on-time (can be
|
||||
// learned from the sector info).
|
||||
// 2. If it's faulty, it will expire early within the first 42 entries
|
||||
// of the expiration queue.
|
||||
|
||||
stopErr := errors.New("stop")
|
||||
out := SectorExpiration{}
|
||||
err = dls.ForEach(s.store, func(dlIdx uint64, dl *miner11.Deadline) error {
|
||||
partitions, err := dl.PartitionsArray(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
quant := s.State.QuantSpecForDeadline(dlIdx)
|
||||
var part miner11.Partition
|
||||
return partitions.ForEach(&part, func(partIdx int64) error {
|
||||
if found, err := part.Sectors.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if !found {
|
||||
return nil
|
||||
}
|
||||
if found, err := part.Terminated.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if found {
|
||||
// already terminated
|
||||
return stopErr
|
||||
}
|
||||
|
||||
q, err := miner11.LoadExpirationQueue(s.store, part.ExpirationsEpochs, quant, miner11.PartitionExpirationAmtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var exp miner11.ExpirationSet
|
||||
return q.ForEach(&exp, func(epoch int64) error {
|
||||
if early, err := exp.EarlySectors.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if early {
|
||||
out.Early = abi.ChainEpoch(epoch)
|
||||
return nil
|
||||
}
|
||||
if onTime, err := exp.OnTimeSectors.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if onTime {
|
||||
out.OnTime = abi.ChainEpoch(epoch)
|
||||
return stopErr
|
||||
}
|
||||
return nil
|
||||
})
|
||||
})
|
||||
})
|
||||
if err == stopErr {
|
||||
err = nil
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if out.Early == 0 && out.OnTime == 0 {
|
||||
return nil, xerrors.Errorf("failed to find sector %d", num)
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (s *state11) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ret := fromV11SectorPreCommitOnChainInfo(*info)
|
||||
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state11) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
|
||||
precommitted, err := adt11.AsMap(s.store, s.State.PreCommittedSectors, builtin11.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var info miner11.SectorPreCommitOnChainInfo
|
||||
if err := precommitted.ForEach(&info, func(_ string) error {
|
||||
return cb(fromV11SectorPreCommitOnChainInfo(info))
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state11) LoadSectors(snos *bitfield.BitField) ([]*SectorOnChainInfo, error) {
|
||||
sectors, err := miner11.LoadSectors(s.store, s.State.Sectors)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// If no sector numbers are specified, load all.
|
||||
if snos == nil {
|
||||
infos := make([]*SectorOnChainInfo, 0, sectors.Length())
|
||||
var info11 miner11.SectorOnChainInfo
|
||||
if err := sectors.ForEach(&info11, func(_ int64) error {
|
||||
info := fromV11SectorOnChainInfo(info11)
|
||||
infos = append(infos, &info)
|
||||
return nil
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return infos, nil
|
||||
}
|
||||
|
||||
// Otherwise, load selected.
|
||||
infos11, err := sectors.Load(*snos)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
infos := make([]*SectorOnChainInfo, len(infos11))
|
||||
for i, info11 := range infos11 {
|
||||
info := fromV11SectorOnChainInfo(*info11)
|
||||
infos[i] = &info
|
||||
}
|
||||
return infos, nil
|
||||
}
|
||||
|
||||
func (s *state11) loadAllocatedSectorNumbers() (bitfield.BitField, error) {
|
||||
var allocatedSectors bitfield.BitField
|
||||
err := s.store.Get(s.store.Context(), s.State.AllocatedSectors, &allocatedSectors)
|
||||
return allocatedSectors, err
|
||||
}
|
||||
|
||||
func (s *state11) IsAllocated(num abi.SectorNumber) (bool, error) {
|
||||
allocatedSectors, err := s.loadAllocatedSectorNumbers()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return allocatedSectors.IsSet(uint64(num))
|
||||
}
|
||||
|
||||
func (s *state11) GetProvingPeriodStart() (abi.ChainEpoch, error) {
|
||||
return s.State.ProvingPeriodStart, nil
|
||||
}
|
||||
|
||||
func (s *state11) UnallocatedSectorNumbers(count int) ([]abi.SectorNumber, error) {
|
||||
allocatedSectors, err := s.loadAllocatedSectorNumbers()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
allocatedRuns, err := allocatedSectors.RunIterator()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
unallocatedRuns, err := rle.Subtract(
|
||||
&rle.RunSliceIterator{Runs: []rle.Run{{Val: true, Len: abi.MaxSectorNumber}}},
|
||||
allocatedRuns,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
iter, err := rle.BitsFromRuns(unallocatedRuns)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
sectors := make([]abi.SectorNumber, 0, count)
|
||||
for iter.HasNext() && len(sectors) < count {
|
||||
nextNo, err := iter.Next()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sectors = append(sectors, abi.SectorNumber(nextNo))
|
||||
}
|
||||
|
||||
return sectors, nil
|
||||
}
|
||||
|
||||
func (s *state11) GetAllocatedSectors() (*bitfield.BitField, error) {
|
||||
var allocatedSectors bitfield.BitField
|
||||
if err := s.store.Get(s.store.Context(), s.State.AllocatedSectors, &allocatedSectors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &allocatedSectors, nil
|
||||
}
|
||||
|
||||
func (s *state11) LoadDeadline(idx uint64) (Deadline, error) {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dl, err := dls.LoadDeadline(s.store, idx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &deadline11{*dl, s.store}, nil
|
||||
}
|
||||
|
||||
func (s *state11) ForEachDeadline(cb func(uint64, Deadline) error) error {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return dls.ForEach(s.store, func(i uint64, dl *miner11.Deadline) error {
|
||||
return cb(i, &deadline11{*dl, s.store})
|
||||
})
|
||||
}
|
||||
|
||||
func (s *state11) NumDeadlines() (uint64, error) {
|
||||
return miner11.WPoStPeriodDeadlines, nil
|
||||
}
|
||||
|
||||
func (s *state11) DeadlinesChanged(other State) (bool, error) {
|
||||
other11, ok := other.(*state11)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return !s.State.Deadlines.Equals(other11.Deadlines), nil
|
||||
}
|
||||
|
||||
func (s *state11) MinerInfoChanged(other State) (bool, error) {
|
||||
other0, ok := other.(*state11)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.Info.Equals(other0.State.Info), nil
|
||||
}
|
||||
|
||||
func (s *state11) Info() (MinerInfo, error) {
|
||||
info, err := s.State.GetInfo(s.store)
|
||||
if err != nil {
|
||||
return MinerInfo{}, err
|
||||
}
|
||||
|
||||
mi := MinerInfo{
|
||||
Owner: info.Owner,
|
||||
Worker: info.Worker,
|
||||
ControlAddresses: info.ControlAddresses,
|
||||
|
||||
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
|
||||
|
||||
PeerId: info.PeerId,
|
||||
Multiaddrs: info.Multiaddrs,
|
||||
WindowPoStProofType: info.WindowPoStProofType,
|
||||
SectorSize: info.SectorSize,
|
||||
WindowPoStPartitionSectors: info.WindowPoStPartitionSectors,
|
||||
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
|
||||
|
||||
Beneficiary: info.Beneficiary,
|
||||
BeneficiaryTerm: BeneficiaryTerm(info.BeneficiaryTerm),
|
||||
PendingBeneficiaryTerm: (*PendingBeneficiaryChange)(info.PendingBeneficiaryTerm),
|
||||
}
|
||||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
func (s *state11) DeadlineInfo(epoch abi.ChainEpoch) (*dline.Info, error) {
|
||||
return s.State.RecordedDeadlineInfo(epoch), nil
|
||||
}
|
||||
|
||||
func (s *state11) DeadlineCronActive() (bool, error) {
|
||||
return s.State.DeadlineCronActive, nil
|
||||
}
|
||||
|
||||
func (s *state11) sectors() (adt.Array, error) {
|
||||
return adt11.AsArray(s.store, s.Sectors, miner11.SectorsAmtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state11) decodeSectorOnChainInfo(val *cbg.Deferred) (SectorOnChainInfo, error) {
|
||||
var si miner11.SectorOnChainInfo
|
||||
err := si.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV11SectorOnChainInfo(si), nil
|
||||
}
|
||||
|
||||
func (s *state11) precommits() (adt.Map, error) {
|
||||
return adt11.AsMap(s.store, s.PreCommittedSectors, builtin11.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state11) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
|
||||
var sp miner11.SectorPreCommitOnChainInfo
|
||||
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorPreCommitOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV11SectorPreCommitOnChainInfo(sp), nil
|
||||
}
|
||||
|
||||
func (s *state11) EraseAllUnproven() error {
|
||||
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = dls.ForEach(s.store, func(dindx uint64, dl *miner11.Deadline) error {
|
||||
ps, err := dl.PartitionsArray(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var part miner11.Partition
|
||||
err = ps.ForEach(&part, func(pindx int64) error {
|
||||
_ = part.ActivateUnproven()
|
||||
err = ps.Set(uint64(pindx), &part)
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dl.Partitions, err = ps.Root()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return dls.UpdateDeadline(s.store, dindx, dl)
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return s.State.SaveDeadlines(s.store, dls)
|
||||
|
||||
}
|
||||
|
||||
func (d *deadline11) LoadPartition(idx uint64) (Partition, error) {
|
||||
p, err := d.Deadline.LoadPartition(d.store, idx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &partition11{*p, d.store}, nil
|
||||
}
|
||||
|
||||
func (d *deadline11) ForEachPartition(cb func(uint64, Partition) error) error {
|
||||
ps, err := d.Deadline.PartitionsArray(d.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var part miner11.Partition
|
||||
return ps.ForEach(&part, func(i int64) error {
|
||||
return cb(uint64(i), &partition11{part, d.store})
|
||||
})
|
||||
}
|
||||
|
||||
func (d *deadline11) PartitionsChanged(other Deadline) (bool, error) {
|
||||
other11, ok := other.(*deadline11)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return !d.Deadline.Partitions.Equals(other11.Deadline.Partitions), nil
|
||||
}
|
||||
|
||||
func (d *deadline11) PartitionsPoSted() (bitfield.BitField, error) {
|
||||
return d.Deadline.PartitionsPoSted, nil
|
||||
}
|
||||
|
||||
func (d *deadline11) DisputableProofCount() (uint64, error) {
|
||||
|
||||
ops, err := d.OptimisticProofsSnapshotArray(d.store)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return ops.Length(), nil
|
||||
|
||||
}
|
||||
|
||||
func (p *partition11) AllSectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Sectors, nil
|
||||
}
|
||||
|
||||
func (p *partition11) FaultySectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Faults, nil
|
||||
}
|
||||
|
||||
func (p *partition11) RecoveringSectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Recoveries, nil
|
||||
}
|
||||
|
||||
func (p *partition11) UnprovenSectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Unproven, nil
|
||||
}
|
||||
|
||||
func fromV11SectorOnChainInfo(v11 miner11.SectorOnChainInfo) SectorOnChainInfo {
|
||||
info := SectorOnChainInfo{
|
||||
SectorNumber: v11.SectorNumber,
|
||||
SealProof: v11.SealProof,
|
||||
SealedCID: v11.SealedCID,
|
||||
DealIDs: v11.DealIDs,
|
||||
Activation: v11.Activation,
|
||||
Expiration: v11.Expiration,
|
||||
DealWeight: v11.DealWeight,
|
||||
VerifiedDealWeight: v11.VerifiedDealWeight,
|
||||
InitialPledge: v11.InitialPledge,
|
||||
ExpectedDayReward: v11.ExpectedDayReward,
|
||||
ExpectedStoragePledge: v11.ExpectedStoragePledge,
|
||||
|
||||
SectorKeyCID: v11.SectorKeyCID,
|
||||
}
|
||||
return info
|
||||
}
|
||||
|
||||
func fromV11SectorPreCommitOnChainInfo(v11 miner11.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
|
||||
ret := SectorPreCommitOnChainInfo{
|
||||
Info: SectorPreCommitInfo{
|
||||
SealProof: v11.Info.SealProof,
|
||||
SectorNumber: v11.Info.SectorNumber,
|
||||
SealedCID: v11.Info.SealedCID,
|
||||
SealRandEpoch: v11.Info.SealRandEpoch,
|
||||
DealIDs: v11.Info.DealIDs,
|
||||
Expiration: v11.Info.Expiration,
|
||||
UnsealedCid: nil,
|
||||
},
|
||||
PreCommitDeposit: v11.PreCommitDeposit,
|
||||
PreCommitEpoch: v11.PreCommitEpoch,
|
||||
}
|
||||
|
||||
ret.Info.UnsealedCid = v11.Info.UnsealedCid
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state11) ActorKey() string {
|
||||
return manifest.MinerKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
4
chain/actors/builtin/multisig/message10.go
generated
4
chain/actors/builtin/multisig/message10.go
generated
@ -7,8 +7,8 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
init10 "github.com/filecoin-project/go-state-types/builtin/v10/init"
|
||||
multisig10 "github.com/filecoin-project/go-state-types/builtin/v10/multisig"
|
||||
init11 "github.com/filecoin-project/go-state-types/builtin/v11/init"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
@ -57,7 +57,7 @@ func (m message10) Create(
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init10.ExecParams{
|
||||
execParams := &init11.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
|
77
chain/actors/builtin/multisig/message11.go
generated
Normal file
77
chain/actors/builtin/multisig/message11.go
generated
Normal file
@ -0,0 +1,77 @@
|
||||
package multisig
|
||||
|
||||
import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
init11 "github.com/filecoin-project/go-state-types/builtin/v11/init"
|
||||
multisig11 "github.com/filecoin-project/go-state-types/builtin/v11/multisig"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
type message11 struct{ message0 }
|
||||
|
||||
func (m message11) Create(
|
||||
signers []address.Address, threshold uint64,
|
||||
unlockStart, unlockDuration abi.ChainEpoch,
|
||||
initialAmount abi.TokenAmount,
|
||||
) (*types.Message, error) {
|
||||
|
||||
lenAddrs := uint64(len(signers))
|
||||
|
||||
if lenAddrs < threshold {
|
||||
return nil, xerrors.Errorf("cannot require signing of more addresses than provided for multisig")
|
||||
}
|
||||
|
||||
if threshold == 0 {
|
||||
threshold = lenAddrs
|
||||
}
|
||||
|
||||
if m.from == address.Undef {
|
||||
return nil, xerrors.Errorf("must provide source address")
|
||||
}
|
||||
|
||||
// Set up constructor parameters for multisig
|
||||
msigParams := &multisig11.ConstructorParams{
|
||||
Signers: signers,
|
||||
NumApprovalsThreshold: threshold,
|
||||
UnlockDuration: unlockDuration,
|
||||
StartEpoch: unlockStart,
|
||||
}
|
||||
|
||||
enc, actErr := actors.SerializeParams(msigParams)
|
||||
if actErr != nil {
|
||||
return nil, actErr
|
||||
}
|
||||
|
||||
code, ok := actors.GetActorCodeID(actorstypes.Version11, manifest.MultisigKey)
|
||||
if !ok {
|
||||
return nil, xerrors.Errorf("failed to get multisig code ID")
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init11.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
|
||||
enc, actErr = actors.SerializeParams(execParams)
|
||||
if actErr != nil {
|
||||
return nil, actErr
|
||||
}
|
||||
|
||||
return &types.Message{
|
||||
To: init_.Address,
|
||||
From: m.from,
|
||||
Method: builtintypes.MethodsInit.Exec,
|
||||
Params: enc,
|
||||
Value: initialAmount,
|
||||
}, nil
|
||||
}
|
4
chain/actors/builtin/multisig/message8.go
generated
4
chain/actors/builtin/multisig/message8.go
generated
@ -7,7 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
init10 "github.com/filecoin-project/go-state-types/builtin/v10/init"
|
||||
init11 "github.com/filecoin-project/go-state-types/builtin/v11/init"
|
||||
multisig8 "github.com/filecoin-project/go-state-types/builtin/v8/multisig"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
@ -57,7 +57,7 @@ func (m message8) Create(
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init10.ExecParams{
|
||||
execParams := &init11.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
|
4
chain/actors/builtin/multisig/message9.go
generated
4
chain/actors/builtin/multisig/message9.go
generated
@ -7,7 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
init10 "github.com/filecoin-project/go-state-types/builtin/v10/init"
|
||||
init11 "github.com/filecoin-project/go-state-types/builtin/v11/init"
|
||||
multisig9 "github.com/filecoin-project/go-state-types/builtin/v9/multisig"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
@ -57,7 +57,7 @@ func (m message9) Create(
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init10.ExecParams{
|
||||
execParams := &init11.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
msig10 "github.com/filecoin-project/go-state-types/builtin/v10/multisig"
|
||||
msig11 "github.com/filecoin-project/go-state-types/builtin/v11/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"
|
||||
@ -45,6 +45,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,6 +112,9 @@ func MakeState(store adt.Store, av actorstypes.Version, signers []address.Addres
|
||||
case actorstypes.Version10:
|
||||
return make10(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return make11(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -135,7 +141,7 @@ type State interface {
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
type Transaction = msig10.Transaction
|
||||
type Transaction = msig11.Transaction
|
||||
|
||||
var Methods = builtintypes.MethodsMultisig
|
||||
|
||||
@ -171,6 +177,9 @@ func Message(version actorstypes.Version, from address.Address) MessageBuilder {
|
||||
|
||||
case actorstypes.Version10:
|
||||
return message10{message0{from}}
|
||||
|
||||
case actorstypes.Version11:
|
||||
return message11{message0{from}}
|
||||
default:
|
||||
panic(fmt.Sprintf("unsupported actors version: %d", version))
|
||||
}
|
||||
@ -194,13 +203,13 @@ type MessageBuilder interface {
|
||||
}
|
||||
|
||||
// this type is the same between v0 and v2
|
||||
type ProposalHashData = msig10.ProposalHashData
|
||||
type ProposeReturn = msig10.ProposeReturn
|
||||
type ProposeParams = msig10.ProposeParams
|
||||
type ApproveReturn = msig10.ApproveReturn
|
||||
type ProposalHashData = msig11.ProposalHashData
|
||||
type ProposeReturn = msig11.ProposeReturn
|
||||
type ProposeParams = msig11.ProposeParams
|
||||
type ApproveReturn = msig11.ApproveReturn
|
||||
|
||||
func txnParams(id uint64, data *ProposalHashData) ([]byte, error) {
|
||||
params := msig10.TxnIDParams{ID: msig10.TxnID(id)}
|
||||
params := msig11.TxnIDParams{ID: msig11.TxnID(id)}
|
||||
if data != nil {
|
||||
if data.Requester.Protocol() != address.ID {
|
||||
return nil, xerrors.Errorf("proposer address must be an ID address, was %s", data.Requester)
|
||||
@ -234,5 +243,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
138
chain/actors/builtin/multisig/v11.go
generated
Normal file
138
chain/actors/builtin/multisig/v11.go
generated
Normal file
@ -0,0 +1,138 @@
|
||||
package multisig
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
msig11 "github.com/filecoin-project/go-state-types/builtin/v11/multisig"
|
||||
adt11 "github.com/filecoin-project/go-state-types/builtin/v11/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 = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
|
||||
out := state11{store: store}
|
||||
out.State = msig11.State{}
|
||||
out.State.Signers = signers
|
||||
out.State.NumApprovalsThreshold = threshold
|
||||
out.State.StartEpoch = startEpoch
|
||||
out.State.UnlockDuration = unlockDuration
|
||||
out.State.InitialBalance = initialBalance
|
||||
|
||||
em, err := adt11.StoreEmptyMap(store, builtin11.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State.PendingTxns = em
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
msig11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) LockedBalance(currEpoch abi.ChainEpoch) (abi.TokenAmount, error) {
|
||||
return s.State.AmountLocked(currEpoch - s.State.StartEpoch), nil
|
||||
}
|
||||
|
||||
func (s *state11) StartEpoch() (abi.ChainEpoch, error) {
|
||||
return s.State.StartEpoch, nil
|
||||
}
|
||||
|
||||
func (s *state11) UnlockDuration() (abi.ChainEpoch, error) {
|
||||
return s.State.UnlockDuration, nil
|
||||
}
|
||||
|
||||
func (s *state11) InitialBalance() (abi.TokenAmount, error) {
|
||||
return s.State.InitialBalance, nil
|
||||
}
|
||||
|
||||
func (s *state11) Threshold() (uint64, error) {
|
||||
return s.State.NumApprovalsThreshold, nil
|
||||
}
|
||||
|
||||
func (s *state11) Signers() ([]address.Address, error) {
|
||||
return s.State.Signers, nil
|
||||
}
|
||||
|
||||
func (s *state11) ForEachPendingTxn(cb func(id int64, txn Transaction) error) error {
|
||||
arr, err := adt11.AsMap(s.store, s.State.PendingTxns, builtin11.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var out msig11.Transaction
|
||||
return arr.ForEach(&out, func(key string) error {
|
||||
txid, n := binary.Varint([]byte(key))
|
||||
if n <= 0 {
|
||||
return xerrors.Errorf("invalid pending transaction key: %v", key)
|
||||
}
|
||||
return cb(txid, (Transaction)(out)) //nolint:unconvert
|
||||
})
|
||||
}
|
||||
|
||||
func (s *state11) PendingTxnChanged(other State) (bool, error) {
|
||||
other11, ok := other.(*state11)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.PendingTxns.Equals(other11.PendingTxns), nil
|
||||
}
|
||||
|
||||
func (s *state11) transactions() (adt.Map, error) {
|
||||
return adt11.AsMap(s.store, s.PendingTxns, builtin11.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state11) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
var tx msig11.Transaction
|
||||
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Transaction{}, err
|
||||
}
|
||||
return Transaction(tx), nil
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state11) ActorKey() string {
|
||||
return manifest.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
109
chain/actors/builtin/paych/message11.go
generated
Normal file
109
chain/actors/builtin/paych/message11.go
generated
Normal file
@ -0,0 +1,109 @@
|
||||
package paych
|
||||
|
||||
import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
init11 "github.com/filecoin-project/go-state-types/builtin/v11/init"
|
||||
paych11 "github.com/filecoin-project/go-state-types/builtin/v11/paych"
|
||||
paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
type message11 struct{ from address.Address }
|
||||
|
||||
func (m message11) Create(to address.Address, initialAmount abi.TokenAmount) (*types.Message, error) {
|
||||
|
||||
actorCodeID, ok := actors.GetActorCodeID(actorstypes.Version11, "paymentchannel")
|
||||
if !ok {
|
||||
return nil, xerrors.Errorf("error getting actor paymentchannel code id for actor version %d", 11)
|
||||
}
|
||||
|
||||
params, aerr := actors.SerializeParams(&paych11.ConstructorParams{From: m.from, To: to})
|
||||
if aerr != nil {
|
||||
return nil, aerr
|
||||
}
|
||||
enc, aerr := actors.SerializeParams(&init11.ExecParams{
|
||||
CodeCID: actorCodeID,
|
||||
ConstructorParams: params,
|
||||
})
|
||||
if aerr != nil {
|
||||
return nil, aerr
|
||||
}
|
||||
|
||||
return &types.Message{
|
||||
To: init_.Address,
|
||||
From: m.from,
|
||||
Value: initialAmount,
|
||||
Method: builtin11.MethodsInit.Exec,
|
||||
Params: enc,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (m message11) Update(paych address.Address, sv *paychtypes.SignedVoucher, secret []byte) (*types.Message, error) {
|
||||
params, aerr := actors.SerializeParams(&paych11.UpdateChannelStateParams{
|
||||
|
||||
Sv: toV11SignedVoucher(*sv),
|
||||
|
||||
Secret: secret,
|
||||
})
|
||||
if aerr != nil {
|
||||
return nil, aerr
|
||||
}
|
||||
|
||||
return &types.Message{
|
||||
To: paych,
|
||||
From: m.from,
|
||||
Value: abi.NewTokenAmount(0),
|
||||
Method: builtin11.MethodsPaych.UpdateChannelState,
|
||||
Params: params,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func toV11SignedVoucher(sv paychtypes.SignedVoucher) paych11.SignedVoucher {
|
||||
merges := make([]paych11.Merge, len(sv.Merges))
|
||||
for i := range sv.Merges {
|
||||
merges[i] = paych11.Merge{
|
||||
Lane: sv.Merges[i].Lane,
|
||||
Nonce: sv.Merges[i].Nonce,
|
||||
}
|
||||
}
|
||||
|
||||
return paych11.SignedVoucher{
|
||||
ChannelAddr: sv.ChannelAddr,
|
||||
TimeLockMin: sv.TimeLockMin,
|
||||
TimeLockMax: sv.TimeLockMax,
|
||||
SecretHash: sv.SecretHash,
|
||||
Extra: (*paych11.ModVerifyParams)(sv.Extra),
|
||||
Lane: sv.Lane,
|
||||
Nonce: sv.Nonce,
|
||||
Amount: sv.Amount,
|
||||
MinSettleHeight: sv.MinSettleHeight,
|
||||
Merges: merges,
|
||||
Signature: sv.Signature,
|
||||
}
|
||||
}
|
||||
|
||||
func (m message11) Settle(paych address.Address) (*types.Message, error) {
|
||||
return &types.Message{
|
||||
To: paych,
|
||||
From: m.from,
|
||||
Value: abi.NewTokenAmount(0),
|
||||
Method: builtin11.MethodsPaych.Settle,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (m message11) Collect(paych address.Address) (*types.Message, error) {
|
||||
return &types.Message{
|
||||
To: paych,
|
||||
From: m.from,
|
||||
Value: abi.NewTokenAmount(0),
|
||||
Method: builtin11.MethodsPaych.Collect,
|
||||
}, nil
|
||||
}
|
@ -47,6 +47,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,6 +164,9 @@ func Message(version actorstypes.Version, from address.Address) MessageBuilder {
|
||||
case actorstypes.Version10:
|
||||
return message10{from}
|
||||
|
||||
case actorstypes.Version11:
|
||||
return message11{from}
|
||||
|
||||
default:
|
||||
panic(fmt.Sprintf("unsupported actors version: %d", version))
|
||||
}
|
||||
@ -201,5 +207,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
135
chain/actors/builtin/paych/v11.go
generated
Normal file
135
chain/actors/builtin/paych/v11.go
generated
Normal file
@ -0,0 +1,135 @@
|
||||
package paych
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
paych11 "github.com/filecoin-project/go-state-types/builtin/v11/paych"
|
||||
adt11 "github.com/filecoin-project/go-state-types/builtin/v11/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 = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store) (State, error) {
|
||||
out := state11{store: store}
|
||||
out.State = paych11.State{}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
paych11.State
|
||||
store adt.Store
|
||||
lsAmt *adt11.Array
|
||||
}
|
||||
|
||||
// Channel owner, who has funded the actor
|
||||
func (s *state11) From() (address.Address, error) {
|
||||
return s.State.From, nil
|
||||
}
|
||||
|
||||
// Recipient of payouts from channel
|
||||
func (s *state11) To() (address.Address, error) {
|
||||
return s.State.To, nil
|
||||
}
|
||||
|
||||
// Height at which the channel can be `Collected`
|
||||
func (s *state11) SettlingAt() (abi.ChainEpoch, error) {
|
||||
return s.State.SettlingAt, nil
|
||||
}
|
||||
|
||||
// Amount successfully redeemed through the payment channel, paid out on `Collect()`
|
||||
func (s *state11) ToSend() (abi.TokenAmount, error) {
|
||||
return s.State.ToSend, nil
|
||||
}
|
||||
|
||||
func (s *state11) getOrLoadLsAmt() (*adt11.Array, error) {
|
||||
if s.lsAmt != nil {
|
||||
return s.lsAmt, nil
|
||||
}
|
||||
|
||||
// Get the lane state from the chain
|
||||
lsamt, err := adt11.AsArray(s.store, s.State.LaneStates, paych11.LaneStatesAmtBitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s.lsAmt = lsamt
|
||||
return lsamt, nil
|
||||
}
|
||||
|
||||
// Get total number of lanes
|
||||
func (s *state11) LaneCount() (uint64, error) {
|
||||
lsamt, err := s.getOrLoadLsAmt()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return lsamt.Length(), nil
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
// Iterate lane states
|
||||
func (s *state11) ForEachLaneState(cb func(idx uint64, dl LaneState) error) error {
|
||||
// Get the lane state from the chain
|
||||
lsamt, err := s.getOrLoadLsAmt()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Note: we use a map instead of an array to store laneStates because the
|
||||
// client sets the lane ID (the index) and potentially they could use a
|
||||
// very large index.
|
||||
var ls paych11.LaneState
|
||||
return lsamt.ForEach(&ls, func(i int64) error {
|
||||
return cb(uint64(i), &laneState11{ls})
|
||||
})
|
||||
}
|
||||
|
||||
type laneState11 struct {
|
||||
paych11.LaneState
|
||||
}
|
||||
|
||||
func (ls *laneState11) Redeemed() (big.Int, error) {
|
||||
return ls.LaneState.Redeemed, nil
|
||||
}
|
||||
|
||||
func (ls *laneState11) Nonce() (uint64, error) {
|
||||
return ls.LaneState.Nonce, nil
|
||||
}
|
||||
|
||||
func (s *state11) ActorKey() string {
|
||||
return manifest.PaychKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -9,7 +9,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
builtin10 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
@ -27,8 +27,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin10.StoragePowerActorAddr
|
||||
Methods = builtin10.MethodsPower
|
||||
Address = builtin11.StoragePowerActorAddr
|
||||
Methods = builtin11.MethodsPower
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -48,6 +48,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,6 +115,9 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return make10(store)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return make11(store)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -176,5 +182,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
207
chain/actors/builtin/power/v11.go
generated
Normal file
207
chain/actors/builtin/power/v11.go
generated
Normal file
@ -0,0 +1,207 @@
|
||||
package power
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
power11 "github.com/filecoin-project/go-state-types/builtin/v11/power"
|
||||
adt11 "github.com/filecoin-project/go-state-types/builtin/v11/util/adt"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
)
|
||||
|
||||
var _ State = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store) (State, error) {
|
||||
out := state11{store: store}
|
||||
|
||||
s, err := power11.ConstructState(store)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
power11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) TotalLocked() (abi.TokenAmount, error) {
|
||||
return s.TotalPledgeCollateral, nil
|
||||
}
|
||||
|
||||
func (s *state11) TotalPower() (Claim, error) {
|
||||
return Claim{
|
||||
RawBytePower: s.TotalRawBytePower,
|
||||
QualityAdjPower: s.TotalQualityAdjPower,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Committed power to the network. Includes miners below the minimum threshold.
|
||||
func (s *state11) TotalCommitted() (Claim, error) {
|
||||
return Claim{
|
||||
RawBytePower: s.TotalBytesCommitted,
|
||||
QualityAdjPower: s.TotalQABytesCommitted,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state11) MinerPower(addr address.Address) (Claim, bool, error) {
|
||||
claims, err := s.claims()
|
||||
if err != nil {
|
||||
return Claim{}, false, err
|
||||
}
|
||||
var claim power11.Claim
|
||||
ok, err := claims.Get(abi.AddrKey(addr), &claim)
|
||||
if err != nil {
|
||||
return Claim{}, false, err
|
||||
}
|
||||
return Claim{
|
||||
RawBytePower: claim.RawBytePower,
|
||||
QualityAdjPower: claim.QualityAdjPower,
|
||||
}, ok, nil
|
||||
}
|
||||
|
||||
func (s *state11) MinerNominalPowerMeetsConsensusMinimum(a address.Address) (bool, error) {
|
||||
return s.State.MinerNominalPowerMeetsConsensusMinimum(s.store, a)
|
||||
}
|
||||
|
||||
func (s *state11) TotalPowerSmoothed() (builtin.FilterEstimate, error) {
|
||||
return builtin.FilterEstimate(s.State.ThisEpochQAPowerSmoothed), nil
|
||||
}
|
||||
|
||||
func (s *state11) MinerCounts() (uint64, uint64, error) {
|
||||
return uint64(s.State.MinerAboveMinPowerCount), uint64(s.State.MinerCount), nil
|
||||
}
|
||||
|
||||
func (s *state11) ListAllMiners() ([]address.Address, error) {
|
||||
claims, err := s.claims()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var miners []address.Address
|
||||
err = claims.ForEach(nil, func(k string) error {
|
||||
a, err := address.NewFromBytes([]byte(k))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
miners = append(miners, a)
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return miners, nil
|
||||
}
|
||||
|
||||
func (s *state11) ForEachClaim(cb func(miner address.Address, claim Claim) error) error {
|
||||
claims, err := s.claims()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var claim power11.Claim
|
||||
return claims.ForEach(&claim, func(k string) error {
|
||||
a, err := address.NewFromBytes([]byte(k))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return cb(a, Claim{
|
||||
RawBytePower: claim.RawBytePower,
|
||||
QualityAdjPower: claim.QualityAdjPower,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func (s *state11) ClaimsChanged(other State) (bool, error) {
|
||||
other11, ok := other.(*state11)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.Claims.Equals(other11.State.Claims), nil
|
||||
}
|
||||
|
||||
func (s *state11) SetTotalQualityAdjPower(p abi.StoragePower) error {
|
||||
s.State.TotalQualityAdjPower = p
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state11) SetTotalRawBytePower(p abi.StoragePower) error {
|
||||
s.State.TotalRawBytePower = p
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state11) SetThisEpochQualityAdjPower(p abi.StoragePower) error {
|
||||
s.State.ThisEpochQualityAdjPower = p
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state11) SetThisEpochRawBytePower(p abi.StoragePower) error {
|
||||
s.State.ThisEpochRawBytePower = p
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state11) claims() (adt.Map, error) {
|
||||
return adt11.AsMap(s.store, s.Claims, builtin11.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state11) decodeClaim(val *cbg.Deferred) (Claim, error) {
|
||||
var ci power11.Claim
|
||||
if err := ci.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Claim{}, err
|
||||
}
|
||||
return fromV11Claim(ci), nil
|
||||
}
|
||||
|
||||
func fromV11Claim(v11 power11.Claim) Claim {
|
||||
return Claim{
|
||||
RawBytePower: v11.RawBytePower,
|
||||
QualityAdjPower: v11.QualityAdjPower,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state11) ActorKey() string {
|
||||
return manifest.PowerKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -26,6 +26,22 @@ import (
|
||||
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"
|
||||
account11 "github.com/filecoin-project/go-state-types/builtin/v11/account"
|
||||
cron11 "github.com/filecoin-project/go-state-types/builtin/v11/cron"
|
||||
datacap11 "github.com/filecoin-project/go-state-types/builtin/v11/datacap"
|
||||
eam11 "github.com/filecoin-project/go-state-types/builtin/v11/eam"
|
||||
ethaccount11 "github.com/filecoin-project/go-state-types/builtin/v11/ethaccount"
|
||||
evm11 "github.com/filecoin-project/go-state-types/builtin/v11/evm"
|
||||
_init11 "github.com/filecoin-project/go-state-types/builtin/v11/init"
|
||||
market11 "github.com/filecoin-project/go-state-types/builtin/v11/market"
|
||||
miner11 "github.com/filecoin-project/go-state-types/builtin/v11/miner"
|
||||
multisig11 "github.com/filecoin-project/go-state-types/builtin/v11/multisig"
|
||||
paych11 "github.com/filecoin-project/go-state-types/builtin/v11/paych"
|
||||
placeholder11 "github.com/filecoin-project/go-state-types/builtin/v11/placeholder"
|
||||
power11 "github.com/filecoin-project/go-state-types/builtin/v11/power"
|
||||
reward11 "github.com/filecoin-project/go-state-types/builtin/v11/reward"
|
||||
system11 "github.com/filecoin-project/go-state-types/builtin/v11/system"
|
||||
verifreg11 "github.com/filecoin-project/go-state-types/builtin/v11/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"
|
||||
@ -377,6 +393,110 @@ func MakeRegistry(av actorstypes.Version) []RegistryEntry {
|
||||
}
|
||||
}
|
||||
|
||||
case actorstypes.Version11:
|
||||
for key, codeID := range codeIDs {
|
||||
switch key {
|
||||
case manifest.AccountKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: account11.Methods,
|
||||
state: new(account11.State),
|
||||
})
|
||||
case manifest.CronKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: cron11.Methods,
|
||||
state: new(cron11.State),
|
||||
})
|
||||
case manifest.InitKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: _init11.Methods,
|
||||
state: new(_init11.State),
|
||||
})
|
||||
case manifest.MarketKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: market11.Methods,
|
||||
state: new(market11.State),
|
||||
})
|
||||
case manifest.MinerKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: miner11.Methods,
|
||||
state: new(miner11.State),
|
||||
})
|
||||
case manifest.MultisigKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: multisig11.Methods,
|
||||
state: new(multisig11.State),
|
||||
})
|
||||
case manifest.PaychKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: paych11.Methods,
|
||||
state: new(paych11.State),
|
||||
})
|
||||
case manifest.PowerKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: power11.Methods,
|
||||
state: new(power11.State),
|
||||
})
|
||||
case manifest.RewardKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: reward11.Methods,
|
||||
state: new(reward11.State),
|
||||
})
|
||||
case manifest.SystemKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: system11.Methods,
|
||||
state: new(system11.State),
|
||||
})
|
||||
case manifest.VerifregKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: verifreg11.Methods,
|
||||
state: new(verifreg11.State),
|
||||
})
|
||||
case manifest.DatacapKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: datacap11.Methods,
|
||||
state: new(datacap11.State),
|
||||
})
|
||||
|
||||
case manifest.EvmKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: evm11.Methods,
|
||||
state: new(evm11.State),
|
||||
})
|
||||
case manifest.EamKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: eam11.Methods,
|
||||
state: nil,
|
||||
})
|
||||
case manifest.PlaceholderKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: placeholder11.Methods,
|
||||
state: nil,
|
||||
})
|
||||
case manifest.EthAccountKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: ethaccount11.Methods,
|
||||
state: nil,
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
panic("expected version v8 and up only, use specs-actors for v0-7")
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
|
||||
"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"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
@ -25,8 +25,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin10.RewardActorAddr
|
||||
Methods = builtin10.MethodsReward
|
||||
Address = builtin11.RewardActorAddr
|
||||
Methods = builtin11.MethodsReward
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -46,6 +46,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,6 +113,9 @@ func MakeState(store adt.Store, av actorstypes.Version, currRealizedPower abi.St
|
||||
case actorstypes.Version10:
|
||||
return make10(store, currRealizedPower)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return make11(store, currRealizedPower)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -152,5 +158,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
120
chain/actors/builtin/reward/v11.go
generated
Normal file
120
chain/actors/builtin/reward/v11.go
generated
Normal file
@ -0,0 +1,120 @@
|
||||
package reward
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
miner11 "github.com/filecoin-project/go-state-types/builtin/v11/miner"
|
||||
reward11 "github.com/filecoin-project/go-state-types/builtin/v11/reward"
|
||||
smoothing11 "github.com/filecoin-project/go-state-types/builtin/v11/util/smoothing"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
)
|
||||
|
||||
var _ State = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store, currRealizedPower abi.StoragePower) (State, error) {
|
||||
out := state11{store: store}
|
||||
out.State = *reward11.ConstructState(currRealizedPower)
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
reward11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) ThisEpochReward() (abi.TokenAmount, error) {
|
||||
return s.State.ThisEpochReward, nil
|
||||
}
|
||||
|
||||
func (s *state11) ThisEpochRewardSmoothed() (builtin.FilterEstimate, error) {
|
||||
|
||||
return builtin.FilterEstimate{
|
||||
PositionEstimate: s.State.ThisEpochRewardSmoothed.PositionEstimate,
|
||||
VelocityEstimate: s.State.ThisEpochRewardSmoothed.VelocityEstimate,
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) ThisEpochBaselinePower() (abi.StoragePower, error) {
|
||||
return s.State.ThisEpochBaselinePower, nil
|
||||
}
|
||||
|
||||
func (s *state11) TotalStoragePowerReward() (abi.TokenAmount, error) {
|
||||
return s.State.TotalStoragePowerReward, nil
|
||||
}
|
||||
|
||||
func (s *state11) EffectiveBaselinePower() (abi.StoragePower, error) {
|
||||
return s.State.EffectiveBaselinePower, nil
|
||||
}
|
||||
|
||||
func (s *state11) EffectiveNetworkTime() (abi.ChainEpoch, error) {
|
||||
return s.State.EffectiveNetworkTime, nil
|
||||
}
|
||||
|
||||
func (s *state11) CumsumBaseline() (reward11.Spacetime, error) {
|
||||
return s.State.CumsumBaseline, nil
|
||||
}
|
||||
|
||||
func (s *state11) CumsumRealized() (reward11.Spacetime, error) {
|
||||
return s.State.CumsumRealized, nil
|
||||
}
|
||||
|
||||
func (s *state11) InitialPledgeForPower(qaPower abi.StoragePower, networkTotalPledge abi.TokenAmount, networkQAPower *builtin.FilterEstimate, circSupply abi.TokenAmount) (abi.TokenAmount, error) {
|
||||
return miner11.InitialPledgeForPower(
|
||||
qaPower,
|
||||
s.State.ThisEpochBaselinePower,
|
||||
s.State.ThisEpochRewardSmoothed,
|
||||
smoothing11.FilterEstimate{
|
||||
PositionEstimate: networkQAPower.PositionEstimate,
|
||||
VelocityEstimate: networkQAPower.VelocityEstimate,
|
||||
},
|
||||
circSupply,
|
||||
), nil
|
||||
}
|
||||
|
||||
func (s *state11) PreCommitDepositForPower(networkQAPower builtin.FilterEstimate, sectorWeight abi.StoragePower) (abi.TokenAmount, error) {
|
||||
return miner11.PreCommitDepositForPower(s.State.ThisEpochRewardSmoothed,
|
||||
smoothing11.FilterEstimate{
|
||||
PositionEstimate: networkQAPower.PositionEstimate,
|
||||
VelocityEstimate: networkQAPower.VelocityEstimate,
|
||||
},
|
||||
sectorWeight), nil
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state11) ActorKey() string {
|
||||
return manifest.RewardKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -5,7 +5,7 @@ import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin10 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
@ -21,7 +21,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin10.SystemActorAddr
|
||||
Address = builtin11.SystemActorAddr
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -41,6 +41,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,6 +108,9 @@ func MakeState(store adt.Store, av actorstypes.Version, builtinActors cid.Cid) (
|
||||
case actorstypes.Version10:
|
||||
return make10(store, builtinActors)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return make11(store, builtinActors)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -131,5 +137,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
72
chain/actors/builtin/system/v11.go
generated
Normal file
72
chain/actors/builtin/system/v11.go
generated
Normal file
@ -0,0 +1,72 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
system11 "github.com/filecoin-project/go-state-types/builtin/v11/system"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store, builtinActors cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
out.State = system11.State{
|
||||
BuiltinActors: builtinActors,
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
system11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state11) GetBuiltinActors() cid.Cid {
|
||||
|
||||
return s.State.BuiltinActors
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) SetBuiltinActors(c cid.Cid) error {
|
||||
|
||||
s.State.BuiltinActors = c
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) ActorKey() string {
|
||||
return manifest.SystemKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
170
chain/actors/builtin/verifreg/v11.go
generated
Normal file
170
chain/actors/builtin/verifreg/v11.go
generated
Normal file
@ -0,0 +1,170 @@
|
||||
package verifreg
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
adt11 "github.com/filecoin-project/go-state-types/builtin/v11/util/adt"
|
||||
verifreg11 "github.com/filecoin-project/go-state-types/builtin/v11/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 = (*state11)(nil)
|
||||
|
||||
func load11(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state11{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make11(store adt.Store, rootKeyAddress address.Address) (State, error) {
|
||||
out := state11{store: store}
|
||||
|
||||
s, err := verifreg11.ConstructState(store, rootKeyAddress)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state11 struct {
|
||||
verifreg11.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state11) RootKey() (address.Address, error) {
|
||||
return s.State.RootKey, nil
|
||||
}
|
||||
|
||||
func (s *state11) VerifiedClientDataCap(addr address.Address) (bool, abi.StoragePower, error) {
|
||||
|
||||
return false, big.Zero(), xerrors.Errorf("unsupported in actors v11")
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) VerifierDataCap(addr address.Address) (bool, abi.StoragePower, error) {
|
||||
return getDataCap(s.store, actors.Version11, s.verifiers, addr)
|
||||
}
|
||||
|
||||
func (s *state11) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) {
|
||||
return getRemoveDataCapProposalID(s.store, actors.Version11, s.removeDataCapProposalIDs, verifier, client)
|
||||
}
|
||||
|
||||
func (s *state11) ForEachVerifier(cb func(addr address.Address, dcap abi.StoragePower) error) error {
|
||||
return forEachCap(s.store, actors.Version11, s.verifiers, cb)
|
||||
}
|
||||
|
||||
func (s *state11) ForEachClient(cb func(addr address.Address, dcap abi.StoragePower) error) error {
|
||||
|
||||
return xerrors.Errorf("unsupported in actors v11")
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) verifiedClients() (adt.Map, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v11")
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) verifiers() (adt.Map, error) {
|
||||
return adt11.AsMap(s.store, s.Verifiers, builtin11.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state11) removeDataCapProposalIDs() (adt.Map, error) {
|
||||
return adt11.AsMap(s.store, s.RemoveDataCapProposalIDs, builtin11.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state11) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state11) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
|
||||
|
||||
alloc, ok, err := s.FindAllocation(s.store, clientIdAddr, verifreg11.AllocationId(allocationId))
|
||||
return (*Allocation)(alloc), ok, err
|
||||
}
|
||||
|
||||
func (s *state11) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
|
||||
|
||||
v11Map, err := s.LoadAllocationsToMap(s.store, clientIdAddr)
|
||||
|
||||
retMap := make(map[AllocationId]Allocation, len(v11Map))
|
||||
for k, v := range v11Map {
|
||||
retMap[AllocationId(k)] = Allocation(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
claim, ok, err := s.FindClaim(s.store, providerIdAddr, verifreg11.ClaimId(claimId))
|
||||
return (*Claim)(claim), ok, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
|
||||
|
||||
v11Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
|
||||
|
||||
retMap := make(map[ClaimId]Claim, len(v11Map))
|
||||
for k, v := range v11Map {
|
||||
retMap[ClaimId(k)] = Claim(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
v11Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
|
||||
|
||||
retMap := make(map[abi.SectorNumber][]ClaimId)
|
||||
for k, v := range v11Map {
|
||||
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 *state11) ActorKey() string {
|
||||
return manifest.VerifregKey
|
||||
}
|
||||
|
||||
func (s *state11) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version11
|
||||
}
|
||||
|
||||
func (s *state11) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
13
chain/actors/builtin/verifreg/verifreg.go
generated
13
chain/actors/builtin/verifreg/verifreg.go
generated
@ -7,7 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin10 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin11 "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"
|
||||
@ -25,8 +25,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin10.VerifiedRegistryActorAddr
|
||||
Methods = builtin10.MethodsVerifiedRegistry
|
||||
Address = builtin11.VerifiedRegistryActorAddr
|
||||
Methods = builtin11.MethodsVerifiedRegistry
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -46,6 +46,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version10:
|
||||
return load10(store, act.Head)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return load11(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,6 +113,9 @@ func MakeState(store adt.Store, av actorstypes.Version, rootKeyAddress address.A
|
||||
case actorstypes.Version10:
|
||||
return make10(store, rootKeyAddress)
|
||||
|
||||
case actorstypes.Version11:
|
||||
return make11(store, rootKeyAddress)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -147,6 +153,7 @@ func AllCodes() []cid.Cid {
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,12 +7,16 @@ import (
|
||||
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"
|
||||
builtin11 "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"
|
||||
market11 "github.com/filecoin-project/go-state-types/builtin/v11/market"
|
||||
miner11 "github.com/filecoin-project/go-state-types/builtin/v11/miner"
|
||||
paych11 "github.com/filecoin-project/go-state-types/builtin/v11/paych"
|
||||
verifreg11 "github.com/filecoin-project/go-state-types/builtin/v11/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"
|
||||
@ -51,10 +55,10 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ChainFinality = miner10.ChainFinality
|
||||
ChainFinality = miner11.ChainFinality
|
||||
SealRandomnessLookback = ChainFinality
|
||||
PaychSettleDelay = paych10.SettleDelay
|
||||
MaxPreCommitRandomnessLookback = builtin10.EpochsInDay + SealRandomnessLookback
|
||||
PaychSettleDelay = paych11.SettleDelay
|
||||
MaxPreCommitRandomnessLookback = builtin11.EpochsInDay + SealRandomnessLookback
|
||||
)
|
||||
|
||||
// SetSupportedProofTypes sets supported proof types, across all actor versions.
|
||||
@ -165,11 +169,13 @@ func SetPreCommitChallengeDelay(delay abi.ChainEpoch) {
|
||||
|
||||
miner10.PreCommitChallengeDelay = delay
|
||||
|
||||
miner11.PreCommitChallengeDelay = delay
|
||||
|
||||
}
|
||||
|
||||
// TODO: this function shouldn't really exist. Instead, the API should expose the precommit delay.
|
||||
func GetPreCommitChallengeDelay() abi.ChainEpoch {
|
||||
return miner10.PreCommitChallengeDelay
|
||||
return miner11.PreCommitChallengeDelay
|
||||
}
|
||||
|
||||
// SetConsensusMinerMinPower sets the minimum power of an individual miner must
|
||||
@ -215,6 +221,10 @@ func SetConsensusMinerMinPower(p abi.StoragePower) {
|
||||
policy.ConsensusMinerMinPower = p
|
||||
}
|
||||
|
||||
for _, policy := range builtin11.PoStProofPolicies {
|
||||
policy.ConsensusMinerMinPower = p
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// SetMinVerifiedDealSize sets the minimum size of a verified deal. This should
|
||||
@ -241,6 +251,8 @@ func SetMinVerifiedDealSize(size abi.StoragePower) {
|
||||
|
||||
verifreg10.MinVerifiedDealSize = size
|
||||
|
||||
verifreg11.MinVerifiedDealSize = size
|
||||
|
||||
}
|
||||
|
||||
func GetMaxProveCommitDuration(ver actorstypes.Version, t abi.RegisteredSealProof) (abi.ChainEpoch, error) {
|
||||
@ -286,6 +298,10 @@ func GetMaxProveCommitDuration(ver actorstypes.Version, t abi.RegisteredSealProo
|
||||
|
||||
return miner10.MaxProveCommitDuration[t], nil
|
||||
|
||||
case actorstypes.Version11:
|
||||
|
||||
return miner11.MaxProveCommitDuration[t], nil
|
||||
|
||||
default:
|
||||
return 0, xerrors.Errorf("unsupported actors version")
|
||||
}
|
||||
@ -341,6 +357,11 @@ func SetProviderCollateralSupplyTarget(num, denom big.Int) {
|
||||
Denominator: denom,
|
||||
}
|
||||
|
||||
market11.ProviderCollateralSupplyTarget = builtin11.BigFrac{
|
||||
Numerator: num,
|
||||
Denominator: denom,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func DealProviderCollateralBounds(
|
||||
@ -404,13 +425,18 @@ func DealProviderCollateralBounds(
|
||||
min, max := market10.DealProviderCollateralBounds(size, verified, rawBytePower, qaPower, baselinePower, circulatingFil)
|
||||
return min, max, nil
|
||||
|
||||
case actorstypes.Version11:
|
||||
|
||||
min, max := market11.DealProviderCollateralBounds(size, verified, rawBytePower, qaPower, baselinePower, circulatingFil)
|
||||
return min, max, nil
|
||||
|
||||
default:
|
||||
return big.Zero(), big.Zero(), xerrors.Errorf("unsupported actors version")
|
||||
}
|
||||
}
|
||||
|
||||
func DealDurationBounds(pieceSize abi.PaddedPieceSize) (min, max abi.ChainEpoch) {
|
||||
return market10.DealDurationBounds(pieceSize)
|
||||
return market11.DealDurationBounds(pieceSize)
|
||||
}
|
||||
|
||||
// Sets the challenge window and scales the proving period to match (such that
|
||||
@ -479,6 +505,13 @@ func SetWPoStChallengeWindow(period abi.ChainEpoch) {
|
||||
// scale it if we're scaling the challenge period.
|
||||
miner10.WPoStDisputeWindow = period * 30
|
||||
|
||||
miner11.WPoStChallengeWindow = period
|
||||
miner11.WPoStProvingPeriod = period * abi.ChainEpoch(miner11.WPoStPeriodDeadlines)
|
||||
|
||||
// by default, this is 2x finality which is 30 periods.
|
||||
// scale it if we're scaling the challenge period.
|
||||
miner11.WPoStDisputeWindow = period * 30
|
||||
|
||||
}
|
||||
|
||||
func GetWinningPoStSectorSetLookback(nwVer network.Version) abi.ChainEpoch {
|
||||
@ -491,15 +524,15 @@ func GetWinningPoStSectorSetLookback(nwVer network.Version) abi.ChainEpoch {
|
||||
}
|
||||
|
||||
func GetMaxSectorExpirationExtension() abi.ChainEpoch {
|
||||
return miner10.MaxSectorExpirationExtension
|
||||
return miner11.MaxSectorExpirationExtension
|
||||
}
|
||||
|
||||
func GetMinSectorExpiration() abi.ChainEpoch {
|
||||
return miner10.MinSectorExpiration
|
||||
return miner11.MinSectorExpiration
|
||||
}
|
||||
|
||||
func GetMaxPoStPartitions(nv network.Version, p abi.RegisteredPoStProof) (int, error) {
|
||||
sectorsPerPart, err := builtin10.PoStProofWindowPoStPartitionSectors(p)
|
||||
sectorsPerPart, err := builtin11.PoStProofWindowPoStPartitionSectors(p)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@ -519,7 +552,7 @@ func GetSectorMaxLifetime(proof abi.RegisteredSealProof, nwVer network.Version)
|
||||
return builtin4.SealProofPoliciesV0[proof].SectorMaxLifetime
|
||||
}
|
||||
|
||||
return builtin10.SealProofPoliciesV11[proof].SectorMaxLifetime
|
||||
return builtin11.SealProofPoliciesV11[proof].SectorMaxLifetime
|
||||
}
|
||||
|
||||
func GetAddressedSectorsMax(nwVer network.Version) (int, error) {
|
||||
@ -559,6 +592,9 @@ func GetAddressedSectorsMax(nwVer network.Version) (int, error) {
|
||||
case actorstypes.Version10:
|
||||
return miner10.AddressedSectorsMax, nil
|
||||
|
||||
case actorstypes.Version11:
|
||||
return miner11.AddressedSectorsMax, nil
|
||||
|
||||
default:
|
||||
return 0, xerrors.Errorf("unsupported network version")
|
||||
}
|
||||
@ -612,6 +648,10 @@ func GetDeclarationsMax(nwVer network.Version) (int, error) {
|
||||
|
||||
return miner10.DeclarationsMax, nil
|
||||
|
||||
case actorstypes.Version11:
|
||||
|
||||
return miner11.DeclarationsMax, nil
|
||||
|
||||
default:
|
||||
return 0, xerrors.Errorf("unsupported network version")
|
||||
}
|
||||
@ -664,6 +704,10 @@ func AggregateProveCommitNetworkFee(nwVer network.Version, aggregateSize int, ba
|
||||
|
||||
return miner10.AggregateProveCommitNetworkFee(aggregateSize, baseFee), nil
|
||||
|
||||
case actorstypes.Version11:
|
||||
|
||||
return miner11.AggregateProveCommitNetworkFee(aggregateSize, baseFee), nil
|
||||
|
||||
default:
|
||||
return big.Zero(), xerrors.Errorf("unsupported network version")
|
||||
}
|
||||
@ -716,6 +760,10 @@ func AggregatePreCommitNetworkFee(nwVer network.Version, aggregateSize int, base
|
||||
|
||||
return miner10.AggregatePreCommitNetworkFee(aggregateSize, baseFee), nil
|
||||
|
||||
case actorstypes.Version11:
|
||||
|
||||
return miner11.AggregatePreCommitNetworkFee(aggregateSize, baseFee), nil
|
||||
|
||||
default:
|
||||
return big.Zero(), xerrors.Errorf("unsupported network version")
|
||||
}
|
||||
|
@ -14,9 +14,9 @@ const ({{range .actorVersions}}
|
||||
|
||||
/* inline-gen start */
|
||||
|
||||
var LatestVersion = 10
|
||||
var LatestVersion = 11
|
||||
|
||||
var Versions = []int{0, 2, 3, 4, 5, 6, 7, 8, 9, 10}
|
||||
var Versions = []int{0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
|
||||
|
||||
const (
|
||||
Version0 Version = 0
|
||||
@ -29,6 +29,7 @@ const (
|
||||
Version8 Version = 8
|
||||
Version9 Version = 9
|
||||
Version10 Version = 10
|
||||
Version11 Version = 11
|
||||
)
|
||||
|
||||
/* inline-gen end */
|
||||
|
@ -51,6 +51,7 @@ func NewActorRegistry() *vm.ActorRegistry {
|
||||
inv.Register(actorstypes.Version8, vm.ActorsVersionPredicate(actorstypes.Version8), builtin.MakeRegistry(actorstypes.Version8))
|
||||
inv.Register(actorstypes.Version9, vm.ActorsVersionPredicate(actorstypes.Version9), builtin.MakeRegistry(actorstypes.Version9))
|
||||
inv.Register(actorstypes.Version10, vm.ActorsVersionPredicate(actorstypes.Version10), builtin.MakeRegistry(actorstypes.Version10))
|
||||
inv.Register(actorstypes.Version11, vm.ActorsVersionPredicate(actorstypes.Version11), builtin.MakeRegistry(actorstypes.Version11))
|
||||
|
||||
return inv
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import (
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
nv18 "github.com/filecoin-project/go-state-types/builtin/v10/migration"
|
||||
nv19 "github.com/filecoin-project/go-state-types/builtin/v11/migration"
|
||||
nv17 "github.com/filecoin-project/go-state-types/builtin/v9/migration"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
"github.com/filecoin-project/go-state-types/migration"
|
||||
@ -245,6 +246,21 @@ func DefaultUpgradeSchedule() stmgr.UpgradeSchedule {
|
||||
StopWithin: 5,
|
||||
}},
|
||||
Expensive: true,
|
||||
}, {
|
||||
Height: build.UpgradeLightningHeight,
|
||||
Network: network.Version19,
|
||||
Migration: UpgradeActorsV11,
|
||||
PreMigrations: []stmgr.PreMigration{{
|
||||
PreMigration: PreUpgradeActorsV11,
|
||||
StartWithin: 120,
|
||||
DontStartWithin: 15,
|
||||
StopWithin: 10,
|
||||
}},
|
||||
Expensive: true,
|
||||
}, {
|
||||
Height: build.UpgradeThunderHeight,
|
||||
Network: network.Version20,
|
||||
Migration: nil,
|
||||
},
|
||||
}
|
||||
|
||||
@ -1588,29 +1604,6 @@ func upgradeActorsV9Common(
|
||||
return newRoot, nil
|
||||
}
|
||||
|
||||
func UpgradeActorsV10(ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache, cb stmgr.ExecMonitor,
|
||||
root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
|
||||
// Use all the CPUs except 3.
|
||||
workerCount := MigrationMaxWorkerCount - 3
|
||||
if workerCount <= 0 {
|
||||
workerCount = 1
|
||||
}
|
||||
|
||||
config := migration.Config{
|
||||
MaxWorkers: uint(workerCount),
|
||||
JobQueueSize: 1000,
|
||||
ResultQueueSize: 100,
|
||||
ProgressLogPeriod: 10 * time.Second,
|
||||
}
|
||||
|
||||
newRoot, err := upgradeActorsV10Common(ctx, sm, cache, root, epoch, ts, config)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("migrating actors v10 state: %w", err)
|
||||
}
|
||||
|
||||
return newRoot, nil
|
||||
}
|
||||
|
||||
func PreUpgradeActorsV10(ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error {
|
||||
// Use half the CPUs for pre-migration, but leave at least 3.
|
||||
workerCount := MigrationMaxWorkerCount
|
||||
@ -1634,6 +1627,29 @@ func PreUpgradeActorsV10(ctx context.Context, sm *stmgr.StateManager, cache stmg
|
||||
return err
|
||||
}
|
||||
|
||||
func UpgradeActorsV10(ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache, cb stmgr.ExecMonitor,
|
||||
root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
|
||||
// Use all the CPUs except 3.
|
||||
workerCount := MigrationMaxWorkerCount - 3
|
||||
if workerCount <= 0 {
|
||||
workerCount = 1
|
||||
}
|
||||
|
||||
config := migration.Config{
|
||||
MaxWorkers: uint(workerCount),
|
||||
JobQueueSize: 1000,
|
||||
ResultQueueSize: 100,
|
||||
ProgressLogPeriod: 10 * time.Second,
|
||||
}
|
||||
|
||||
newRoot, err := upgradeActorsV10Common(ctx, sm, cache, root, epoch, ts, config)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("migrating actors v10 state: %w", err)
|
||||
}
|
||||
|
||||
return newRoot, nil
|
||||
}
|
||||
|
||||
func upgradeActorsV10Common(
|
||||
ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache,
|
||||
root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet,
|
||||
@ -1696,6 +1712,108 @@ func upgradeActorsV10Common(
|
||||
return newRoot, nil
|
||||
}
|
||||
|
||||
func PreUpgradeActorsV11(ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error {
|
||||
// Use half the CPUs for pre-migration, but leave at least 3.
|
||||
workerCount := MigrationMaxWorkerCount
|
||||
if workerCount <= 4 {
|
||||
workerCount = 1
|
||||
} else {
|
||||
workerCount /= 2
|
||||
}
|
||||
|
||||
lbts, lbRoot, err := stmgr.GetLookbackTipSetForRound(ctx, sm, ts, epoch)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error getting lookback ts for premigration: %w", err)
|
||||
}
|
||||
|
||||
config := migration.Config{
|
||||
MaxWorkers: uint(workerCount),
|
||||
ProgressLogPeriod: time.Minute * 5,
|
||||
}
|
||||
|
||||
_, err = upgradeActorsV11Common(ctx, sm, cache, lbRoot, epoch, lbts, config)
|
||||
return err
|
||||
}
|
||||
|
||||
func UpgradeActorsV11(ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache, cb stmgr.ExecMonitor,
|
||||
root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
|
||||
// Use all the CPUs except 2.
|
||||
workerCount := MigrationMaxWorkerCount - 3
|
||||
if workerCount <= 0 {
|
||||
workerCount = 1
|
||||
}
|
||||
config := migration.Config{
|
||||
MaxWorkers: uint(workerCount),
|
||||
JobQueueSize: 1000,
|
||||
ResultQueueSize: 100,
|
||||
ProgressLogPeriod: 10 * time.Second,
|
||||
}
|
||||
newRoot, err := upgradeActorsV11Common(ctx, sm, cache, root, epoch, ts, config)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("migrating actors v11 state: %w", err)
|
||||
}
|
||||
return newRoot, nil
|
||||
}
|
||||
|
||||
func upgradeActorsV11Common(
|
||||
ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache,
|
||||
root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet,
|
||||
config migration.Config,
|
||||
) (cid.Cid, error) {
|
||||
writeStore := blockstore.NewAutobatch(ctx, sm.ChainStore().StateBlockstore(), units.GiB/4)
|
||||
adtStore := store.ActorStore(ctx, writeStore)
|
||||
// ensure that the manifest is loaded in the blockstore
|
||||
if err := bundle.LoadBundles(ctx, writeStore, actorstypes.Version11); err != nil {
|
||||
return cid.Undef, xerrors.Errorf("failed to load manifest bundle: %w", err)
|
||||
}
|
||||
|
||||
// Load the state root.
|
||||
var stateRoot types.StateRoot
|
||||
if err := adtStore.Get(ctx, root, &stateRoot); err != nil {
|
||||
return cid.Undef, xerrors.Errorf("failed to decode state root: %w", err)
|
||||
}
|
||||
|
||||
if stateRoot.Version != types.StateTreeVersion5 {
|
||||
return cid.Undef, xerrors.Errorf(
|
||||
"expected state root version 5 for actors v11 upgrade, got %d",
|
||||
stateRoot.Version,
|
||||
)
|
||||
}
|
||||
|
||||
manifest, ok := actors.GetManifest(actorstypes.Version11)
|
||||
if !ok {
|
||||
return cid.Undef, xerrors.Errorf("no manifest CID for v11 upgrade")
|
||||
}
|
||||
|
||||
// Perform the migration
|
||||
newHamtRoot, err := nv19.MigrateStateTree(ctx, adtStore, manifest, stateRoot.Actors, epoch, config,
|
||||
migrationLogger{}, cache)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("upgrading to actors v11: %w", err)
|
||||
}
|
||||
|
||||
// Persist the result.
|
||||
newRoot, err := adtStore.Put(ctx, &types.StateRoot{
|
||||
Version: types.StateTreeVersion5,
|
||||
Actors: newHamtRoot,
|
||||
Info: stateRoot.Info,
|
||||
})
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("failed to persist new state root: %w", err)
|
||||
}
|
||||
|
||||
// Persists the new tree and shuts down the flush worker
|
||||
if err := writeStore.Flush(ctx); err != nil {
|
||||
return cid.Undef, xerrors.Errorf("writeStore flush failed: %w", err)
|
||||
}
|
||||
|
||||
if err := writeStore.Shutdown(ctx); err != nil {
|
||||
return cid.Undef, xerrors.Errorf("writeStore shutdown failed: %w", err)
|
||||
}
|
||||
|
||||
return newRoot, nil
|
||||
}
|
||||
|
||||
// Example upgrade function if upgrade requires only code changes
|
||||
//func UpgradeActorsV9(ctx context.Context, sm *stmgr.StateManager, _ stmgr.MigrationCache, _ stmgr.ExecMonitor, root cid.Cid, _ abi.ChainEpoch, _ *types.TipSet) (cid.Cid, error) {
|
||||
// buf := blockstore.NewTieredBstore(sm.ChainStore().StateBlockstore(), blockstore.NewMemorySync())
|
||||
|
@ -17,6 +17,7 @@ import (
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
power11 "github.com/filecoin-project/go-state-types/builtin/v11/power"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
|
||||
miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
@ -27,6 +28,7 @@ import (
|
||||
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
power0 "github.com/filecoin-project/specs-actors/actors/builtin/power"
|
||||
reward0 "github.com/filecoin-project/specs-actors/actors/builtin/reward"
|
||||
power2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/power"
|
||||
reward2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/reward"
|
||||
power4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/power"
|
||||
reward4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/reward"
|
||||
@ -135,14 +137,32 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal
|
||||
}
|
||||
|
||||
{
|
||||
constructorParams := &power0.CreateMinerParams{
|
||||
Owner: m.Worker,
|
||||
Worker: m.Worker,
|
||||
Peer: []byte(m.PeerId),
|
||||
SealProofType: spt,
|
||||
var params []byte
|
||||
if nv <= network.Version10 {
|
||||
constructorParams := &power2.CreateMinerParams{
|
||||
Owner: m.Worker,
|
||||
Worker: m.Worker,
|
||||
Peer: []byte(m.PeerId),
|
||||
SealProofType: spt,
|
||||
}
|
||||
|
||||
params = mustEnc(constructorParams)
|
||||
} else {
|
||||
ppt, err := spt.RegisteredWindowPoStProofByNetworkVersion(nv)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("failed to convert spt to wpt: %w", err)
|
||||
}
|
||||
|
||||
constructorParams := &power11.CreateMinerParams{
|
||||
Owner: m.Worker,
|
||||
Worker: m.Worker,
|
||||
Peer: []byte(m.PeerId),
|
||||
WindowPoStProofType: ppt,
|
||||
}
|
||||
|
||||
params = mustEnc(constructorParams)
|
||||
}
|
||||
|
||||
params := mustEnc(constructorParams)
|
||||
rval, err := doExecValue(ctx, genesisVm, power.Address, m.Owner, m.PowerBalance, power.Methods.CreateMiner, params)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("failed to create genesis miner: %w", err)
|
||||
|
@ -156,7 +156,7 @@ func VersionForNetwork(ver network.Version) (types.StateTreeVersion, error) {
|
||||
case network.Version13, network.Version14, network.Version15, network.Version16, network.Version17:
|
||||
return types.StateTreeVersion4, nil
|
||||
|
||||
case network.Version18:
|
||||
case network.Version18, network.Version19, network.Version20:
|
||||
return types.StateTreeVersion5, nil
|
||||
|
||||
default:
|
||||
|
@ -406,8 +406,18 @@ var sealBenchCmd = &cli.Command{
|
||||
}
|
||||
verifyWinningPost2 := time.Now()
|
||||
|
||||
ppt, err := sealedSectors[0].SealProof.RegisteredWindowPoStProof()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ppt, err = ppt.ToV1_1PostProof()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Info("computing window post snark (cold)")
|
||||
wproof1, _, err := sb.GenerateWindowPoSt(context.TODO(), mid, extendedSealedSectors, challenge[:])
|
||||
wproof1, _, err := sb.GenerateWindowPoSt(context.TODO(), mid, ppt, extendedSealedSectors, challenge[:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -415,7 +425,7 @@ var sealBenchCmd = &cli.Command{
|
||||
windowpost1 := time.Now()
|
||||
|
||||
log.Info("computing window post snark (hot)")
|
||||
wproof2, _, err := sb.GenerateWindowPoSt(context.TODO(), mid, extendedSealedSectors, challenge[:])
|
||||
wproof2, _, err := sb.GenerateWindowPoSt(context.TODO(), mid, ppt, extendedSealedSectors, challenge[:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -713,7 +713,11 @@ func createStorageMiner(ctx context.Context, api v1api.FullNode, ssize abi.Secto
|
||||
}
|
||||
|
||||
// Note: the correct thing to do would be to call SealProofTypeFromSectorSize if actors version is v3 or later, but this still works
|
||||
spt, err := miner.WindowPoStProofTypeFromSectorSize(ssize)
|
||||
nv, err := api.StateNetworkVersion(ctx, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("failed to get network version: %w", err)
|
||||
}
|
||||
spt, err := miner.WindowPoStProofTypeFromSectorSize(ssize, nv)
|
||||
if err != nil {
|
||||
return address.Undef, xerrors.Errorf("getting post proof type: %w", err)
|
||||
}
|
||||
|
@ -2,21 +2,28 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipfs/go-datastore"
|
||||
dsq "github.com/ipfs/go-datastore/query"
|
||||
levelds "github.com/ipfs/go-ds-leveldb"
|
||||
ipldcbor "github.com/ipfs/go-ipld-cbor"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
ldbopts "github.com/syndtr/goleveldb/leveldb/opt"
|
||||
"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"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
market11 "github.com/filecoin-project/go-state-types/builtin/v11/market"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v11/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
@ -34,6 +41,85 @@ var marketCmd = &cli.Command{
|
||||
marketExportDatastoreCmd,
|
||||
marketImportDatastoreCmd,
|
||||
marketDealsTotalStorageCmd,
|
||||
marketCronStateCmd,
|
||||
},
|
||||
}
|
||||
|
||||
var marketCronStateCmd = &cli.Command{
|
||||
Name: "cron-state",
|
||||
Usage: "Display summary of all deal operation state scheduled for cron processing",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "tipset",
|
||||
Usage: "specify tipset to call method on (pass comma separated array of cids)",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
api, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
ts, err := lcli.LoadTipSet(ctx, cctx, api)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
a, err := api.StateReadState(ctx, builtin.StorageMarketActorAddr, ts.Key())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
st, ok := a.State.(map[string]interface{})
|
||||
if !ok {
|
||||
return xerrors.Errorf("failed to cast state map to expected form")
|
||||
}
|
||||
dealOpsRaw, ok := st["DealOpsByEpoch"].(map[string]interface{})
|
||||
if !ok {
|
||||
return xerrors.Errorf("failed to read sectors root from state")
|
||||
}
|
||||
// string is of the form "/:bafy.." so [2:] to drop the path
|
||||
dealOpsRoot, err := cid.Parse(dealOpsRaw["/"])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
bs := ReadOnlyAPIBlockstore{api}
|
||||
adtStore := adt.WrapStore(ctx, ipldcbor.NewCborStore(&bs))
|
||||
dealOpsEpochSet, err := adt.AsMap(adtStore, dealOpsRoot, builtin.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dealOpsRecord := make(map[uint64][]abi.DealID)
|
||||
if err := dealOpsEpochSet.ForEach(&cbg.Deferred{}, func(eKey string) error {
|
||||
e, err := abi.ParseUIntKey(eKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dealOpsRecord[e] = make([]abi.DealID, 0)
|
||||
return nil
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dealOpsMultiMap, err := market11.AsSetMultimap(adtStore, dealOpsRoot, builtin.DefaultHamtBitwidth, builtin.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for e := range dealOpsRecord {
|
||||
e := e
|
||||
err := dealOpsMultiMap.ForEach(abi.ChainEpoch(e), func(id abi.DealID) error {
|
||||
dealOpsRecord[e] = append(dealOpsRecord[e], id)
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
jsonStr, err := json.Marshal(dealOpsRecord)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("%s\n", jsonStr)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,8 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@ -19,6 +20,7 @@ import (
|
||||
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"
|
||||
v11 "github.com/filecoin-project/go-state-types/builtin/v11"
|
||||
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"
|
||||
@ -32,6 +34,8 @@ import (
|
||||
"github.com/filecoin-project/specs-actors/v7/actors/migration/nv15"
|
||||
|
||||
"github.com/filecoin-project/lotus/blockstore"
|
||||
badgerbs "github.com/filecoin-project/lotus/blockstore/badger"
|
||||
"github.com/filecoin-project/lotus/blockstore/splitstore"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
lbuiltin "github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
@ -102,24 +106,52 @@ var migrationsCmd = &cli.Command{
|
||||
|
||||
defer lkrepo.Close() //nolint:errcheck
|
||||
|
||||
bs, err := lkrepo.Blockstore(ctx, repo.UniversalBlockstore)
|
||||
cold, err := lkrepo.Blockstore(ctx, repo.UniversalBlockstore)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to open blockstore: %w", err)
|
||||
return fmt.Errorf("failed to open universal blockstore %w", err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if c, ok := bs.(io.Closer); ok {
|
||||
if err := c.Close(); err != nil {
|
||||
log.Warnf("failed to close blockstore: %s", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
path, err := lkrepo.SplitstorePath()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
path = filepath.Join(path, "hot.badger")
|
||||
if err := os.MkdirAll(path, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
opts, err := repo.BadgerBlockstoreOptions(repo.HotBlockstore, path, lkrepo.Readonly())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hot, err := badgerbs.Open(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mds, err := lkrepo.Datastore(context.Background(), "/metadata")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cfg := &splitstore.Config{
|
||||
MarkSetType: "map",
|
||||
DiscardColdBlocks: true,
|
||||
}
|
||||
ss, err := splitstore.Open(path, mds, hot, cold, cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err := ss.Close(); err != nil {
|
||||
log.Warnf("failed to close blockstore: %s", err)
|
||||
|
||||
}
|
||||
}()
|
||||
bs := ss
|
||||
|
||||
cs := store.NewChainStore(bs, bs, mds, filcns.Weight, nil)
|
||||
defer cs.Close() //nolint:errcheck
|
||||
|
||||
@ -169,6 +201,7 @@ var migrationsCmd = &cli.Command{
|
||||
}
|
||||
|
||||
preMigrationTime := time.Since(startTime)
|
||||
fmt.Println("completed premigration, took ", preMigrationTime)
|
||||
|
||||
startTime = time.Now()
|
||||
|
||||
@ -183,7 +216,7 @@ var migrationsCmd = &cli.Command{
|
||||
return xerrors.Errorf("got different results with and without the cache: %s, %s", newCid1,
|
||||
newCid2)
|
||||
}
|
||||
fmt.Println("completed premigration, took ", preMigrationTime)
|
||||
|
||||
fmt.Println("completed round actual (with cache), took ", cachedMigrationTime)
|
||||
}
|
||||
|
||||
@ -207,6 +240,8 @@ func getMigrationFuncsForNetwork(nv network.Version) (UpgradeActorsFunc, PreUpgr
|
||||
return filcns.UpgradeActorsV9, filcns.PreUpgradeActorsV9, checkNv17Invariants, nil
|
||||
case network.Version18:
|
||||
return filcns.UpgradeActorsV10, filcns.PreUpgradeActorsV10, checkNv18Invariants, nil
|
||||
case network.Version19:
|
||||
return filcns.UpgradeActorsV11, filcns.PreUpgradeActorsV11, checkNv19Invariants, nil
|
||||
default:
|
||||
return nil, nil, nil, xerrors.Errorf("migration not implemented for nv%d", nv)
|
||||
}
|
||||
@ -216,6 +251,39 @@ 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 checkNv19Invariants(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.Version11)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newActorTree, err := builtin.LoadTree(actorStore, newStateRoot.Actors)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
messages, err := v11.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
|
||||
}
|
||||
|
||||
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()
|
||||
|
@ -3,16 +3,21 @@ package main
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/go-units"
|
||||
block "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipldcbor "github.com/ipfs/go-ipld-cbor"
|
||||
"github.com/mitchellh/go-homedir"
|
||||
"github.com/urfave/cli/v2"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
@ -20,11 +25,13 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v11/util/adt"
|
||||
miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
power7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/power"
|
||||
"github.com/filecoin-project/specs-actors/v7/actors/runtime/proof"
|
||||
|
||||
"github.com/filecoin-project/lotus/api/v0api"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
@ -42,6 +49,93 @@ var minerCmd = &cli.Command{
|
||||
minerFaultsCmd,
|
||||
sendInvalidWindowPoStCmd,
|
||||
generateAndSendConsensusFaultCmd,
|
||||
sectorInfoCmd,
|
||||
},
|
||||
}
|
||||
|
||||
var _ ipldcbor.IpldBlockstore = new(ReadOnlyAPIBlockstore)
|
||||
|
||||
type ReadOnlyAPIBlockstore struct {
|
||||
v0api.FullNode
|
||||
}
|
||||
|
||||
func (b *ReadOnlyAPIBlockstore) Get(ctx context.Context, c cid.Cid) (block.Block, error) {
|
||||
bs, err := b.ChainReadObj(ctx, c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return block.NewBlock(bs), nil
|
||||
}
|
||||
|
||||
func (b *ReadOnlyAPIBlockstore) Put(context.Context, block.Block) error {
|
||||
return xerrors.Errorf("cannot put block, the backing blockstore is readonly")
|
||||
}
|
||||
|
||||
var sectorInfoCmd = &cli.Command{
|
||||
Name: "sectorinfo",
|
||||
Usage: "Display cbor of sector info at <minerAddress> <sectorNumber>",
|
||||
ArgsUsage: "[minerAddress] [sector number]",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "tipset",
|
||||
Usage: "specify tipset to call method on (pass comma separated array of cids)",
|
||||
},
|
||||
},
|
||||
Action: func(cctx *cli.Context) error {
|
||||
if cctx.Args().Len() != 2 {
|
||||
return fmt.Errorf("must pass miner address and sector number")
|
||||
}
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
api, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
maddr, err := address.NewFromString(cctx.Args().First())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sn, err := strconv.ParseUint(cctx.Args().Slice()[1], 10, 64)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ts, err := lcli.LoadTipSet(ctx, cctx, api)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
a, err := api.StateReadState(ctx, maddr, ts.Key())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
st, ok := a.State.(map[string]interface{})
|
||||
if !ok {
|
||||
return xerrors.Errorf("failed to cast state map to expected form")
|
||||
}
|
||||
sectorsRaw, ok := st["Sectors"].(map[string]interface{})
|
||||
if !ok {
|
||||
return xerrors.Errorf("failed to read sectors root from state")
|
||||
}
|
||||
// string is of the form "/:bafy.." so [2:] to drop the path
|
||||
sectorsRoot, err := cid.Parse(sectorsRaw["/"])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
bs := ReadOnlyAPIBlockstore{api}
|
||||
sectorsAMT, err := adt.AsArray(adt.WrapStore(ctx, ipldcbor.NewCborStore(&bs)), sectorsRoot, miner8.SectorsAmtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
out := cbg.Deferred{}
|
||||
found, err := sectorsAMT.Get(sn, &out)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !found {
|
||||
return xerrors.Errorf("sector number %d not found", sn)
|
||||
}
|
||||
fmt.Printf("%x\n", out.Raw)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
@ -216,7 +310,11 @@ var minerCreateCmd = &cli.Command{
|
||||
}
|
||||
|
||||
// Note: the correct thing to do would be to call SealProofTypeFromSectorSize if actors version is v3 or later, but this still works
|
||||
spt, err := miner.WindowPoStProofTypeFromSectorSize(abi.SectorSize(ssize))
|
||||
nv, err := wapi.StateNetworkVersion(ctx, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to get network version: %w", err)
|
||||
}
|
||||
spt, err := miner.WindowPoStProofTypeFromSectorSize(abi.SectorSize(ssize), nv)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting post proof type: %w", err)
|
||||
}
|
||||
|
@ -475,7 +475,7 @@ Inputs:
|
||||
],
|
||||
"Bw==",
|
||||
10101,
|
||||
18
|
||||
20
|
||||
]
|
||||
```
|
||||
|
||||
|
@ -4727,7 +4727,7 @@ Perms: read
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
18
|
||||
20
|
||||
]
|
||||
```
|
||||
|
||||
@ -4742,7 +4742,7 @@ Perms: read
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
18
|
||||
20
|
||||
]
|
||||
```
|
||||
|
||||
@ -5442,7 +5442,9 @@ Response:
|
||||
"UpgradeOhSnapHeight": 10101,
|
||||
"UpgradeSkyrHeight": 10101,
|
||||
"UpgradeSharkHeight": 10101,
|
||||
"UpgradeHyggeHeight": 10101
|
||||
"UpgradeHyggeHeight": 10101,
|
||||
"UpgradeLightningHeight": 10101,
|
||||
"UpgradeThunderHeight": 10101
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -6366,7 +6368,7 @@ Inputs:
|
||||
]
|
||||
```
|
||||
|
||||
Response: `18`
|
||||
Response: `20`
|
||||
|
||||
### StateReadState
|
||||
StateReadState returns the indicated actor's state.
|
||||
|
@ -6154,7 +6154,7 @@ Perms: read
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
18
|
||||
20
|
||||
]
|
||||
```
|
||||
|
||||
@ -6169,7 +6169,7 @@ Perms: read
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
18
|
||||
20
|
||||
]
|
||||
```
|
||||
|
||||
@ -6944,7 +6944,9 @@ Response:
|
||||
"UpgradeOhSnapHeight": 10101,
|
||||
"UpgradeSkyrHeight": 10101,
|
||||
"UpgradeSharkHeight": 10101,
|
||||
"UpgradeHyggeHeight": 10101
|
||||
"UpgradeHyggeHeight": 10101,
|
||||
"UpgradeLightningHeight": 10101,
|
||||
"UpgradeThunderHeight": 10101
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -7876,7 +7878,7 @@ Inputs:
|
||||
]
|
||||
```
|
||||
|
||||
Response: `18`
|
||||
Response: `20`
|
||||
|
||||
### StateReadState
|
||||
StateReadState returns the indicated actor's state.
|
||||
|
@ -4,11 +4,9 @@
|
||||
- [ ] Define upgrade heights in `build/params_`
|
||||
- [ ] Generate adapters
|
||||
- [ ] Update `gen/inlinegen-data.json`
|
||||
- [ ] Update `chain/actors/version.go`
|
||||
- [ ] Update adapter code in `chain/actors/builtin` if needed
|
||||
- [ ] Run `make actors-gen`
|
||||
- [ ] Update `chain/consensus/filcns/upgrades.go`
|
||||
- [ ] Schedule
|
||||
- [ ] Migration
|
||||
- [ ] Update upgrade schedule in `chain/sync_test.go`
|
||||
- [ ] Add upgrade field to `api/types.go/ForkUpgradeParams` and update the implementation of StateGetNetworkParams
|
||||
|
2
extern/filecoin-ffi
vendored
2
extern/filecoin-ffi
vendored
@ -1 +1 @@
|
||||
Subproject commit 28e3cd44d91681c074aba362d1e5c954db110ad9
|
||||
Subproject commit 86698251ab87eec6944320a01998623155c01276
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"actorVersions": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
||||
"latestActorsVersion": 10,
|
||||
"actorVersions": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
|
||||
"latestActorsVersion": 11,
|
||||
|
||||
"networkVersions": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
|
||||
"latestNetworkVersion": 18
|
||||
"networkVersions": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
|
||||
"latestNetworkVersion": 20
|
||||
}
|
||||
|
4
go.mod
4
go.mod
@ -1,6 +1,6 @@
|
||||
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.
|
||||
|
||||
@ -45,7 +45,7 @@ require (
|
||||
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.11.0-alpha-3
|
||||
github.com/filecoin-project/go-state-types v0.11.1
|
||||
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
|
||||
|
26
go.sum
26
go.sum
@ -290,7 +290,6 @@ github.com/filecoin-project/dagstore v0.5.2 h1:Nd6oXdnolbbVhpMpkYT5PJHOjQp4OBSnt
|
||||
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=
|
||||
github.com/filecoin-project/go-address v0.0.5/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8=
|
||||
github.com/filecoin-project/go-address v0.0.6/go.mod h1:7B0/5DA13n6nHkB8bbGx1gWzG/dbTsZ0fgOJVGsM3TE=
|
||||
github.com/filecoin-project/go-address v1.1.0 h1:ofdtUtEsNxkIxkDw67ecSmvtzaVSdcea4boAmLbnHfE=
|
||||
github.com/filecoin-project/go-address v1.1.0/go.mod h1:5t3z6qPmIADZBtuE9EIzi0EwzcRy2nVhpo0I/c1r0OA=
|
||||
github.com/filecoin-project/go-amt-ipld/v2 v2.1.0 h1:t6qDiuGYYngDqaLc2ZUvdtAg4UNxPeOYaXhBWSNsVaM=
|
||||
@ -345,10 +344,9 @@ github.com/filecoin-project/go-state-types v0.0.0-20200928172055-2df22083d8ab/go
|
||||
github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
|
||||
github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
|
||||
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.11.0-alpha-3 h1:LupJwuS2BdUEZbc0Q8N84N43O37XwTREDsdSTpzF1hg=
|
||||
github.com/filecoin-project/go-state-types v0.11.0-alpha-3/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024=
|
||||
github.com/filecoin-project/go-state-types v0.11.1 h1:GDtCN9V18bYVwXDZe+vJXc6Ck+qY9OUaQqpoVlp1FAk=
|
||||
github.com/filecoin-project/go-state-types v0.11.1/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8=
|
||||
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
|
||||
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=
|
||||
@ -388,6 +386,7 @@ 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.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=
|
||||
@ -539,6 +538,7 @@ 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.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=
|
||||
@ -700,6 +700,7 @@ 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/go.mod h1:gQ8pKqT/sUxGY+tIwy1RPpAojYu7jAyCp5Tz1svoupw=
|
||||
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
|
||||
github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
|
||||
github.com/ipfs/go-cidutil v0.1.0 h1:RW5hO7Vcf16dplUU60Hs0AKDkQAVPVplr7lk97CFL+Q=
|
||||
@ -877,6 +878,7 @@ 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.19.0/go.mod h1:Q9j3BaVXwaA3o5JUDNvptDDr/x8+F7FG6XJ8WI3ILg4=
|
||||
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=
|
||||
@ -1325,6 +1327,7 @@ 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.6.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw=
|
||||
github.com/multiformats/go-multicodec v0.8.1 h1:ycepHwavHafh3grIbR1jIXnKCsFm0fqsfEOsJ8NtKE8=
|
||||
github.com/multiformats/go-multicodec v0.8.1/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k=
|
||||
github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U=
|
||||
@ -1640,6 +1643,7 @@ 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/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=
|
||||
@ -1701,6 +1705,7 @@ 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.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
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=
|
||||
@ -1825,8 +1830,9 @@ 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-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
||||
golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
|
||||
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
@ -1869,6 +1875,7 @@ 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.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=
|
||||
@ -1930,6 +1937,8 @@ golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qx
|
||||
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-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||
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=
|
||||
@ -2046,21 +2055,24 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
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-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-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-20220520151302-bc2c85ada10a/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@ -2071,6 +2083,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@ -2139,6 +2152,7 @@ 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.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=
|
||||
|
@ -68,12 +68,13 @@ func runTestCCUpgrade(t *testing.T) *kit.TestFullNode {
|
||||
require.NoError(t, err)
|
||||
require.Len(t, sl, 1, "expected 1 sector")
|
||||
require.Equal(t, CCUpgrade, sl[0], "unexpected sector number")
|
||||
{
|
||||
si, err := client.StateSectorGetInfo(ctx, maddr, CCUpgrade, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, si)
|
||||
require.Less(t, 50000, int(si.Expiration))
|
||||
}
|
||||
|
||||
si, err := client.StateSectorGetInfo(ctx, maddr, CCUpgrade, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, si)
|
||||
require.Less(t, 50000, int(si.Expiration))
|
||||
require.True(t, si.ReplacedSectorAge == 0)
|
||||
|
||||
client.WaitForSectorActive(ctx, t, CCUpgrade, maddr)
|
||||
|
||||
//stm: @SECTOR_CC_UPGRADE_001
|
||||
@ -100,6 +101,12 @@ func runTestCCUpgrade(t *testing.T) *kit.TestFullNode {
|
||||
CCUpgrade: {},
|
||||
})
|
||||
|
||||
siUpdate, err := client.StateSectorGetInfo(ctx, maddr, CCUpgrade, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, siUpdate)
|
||||
require.True(t, siUpdate.SectorKeyCID != nil)
|
||||
require.True(t, siUpdate.Activation > si.Activation)
|
||||
|
||||
return client
|
||||
}
|
||||
|
||||
|
@ -153,14 +153,13 @@ func TestFEVMRecursive2(t *testing.T) {
|
||||
require.Equal(t, 2, len(events))
|
||||
}
|
||||
|
||||
// TestFEVMRecursiveDelegatecallCount tests the maximum delegatecall recursion depth. It currently
|
||||
// succeeds succeeds up to 237 times.
|
||||
// TestFEVMRecursiveDelegatecallCount tests the maximum delegatecall recursion depth.
|
||||
func TestFEVMRecursiveDelegatecallCount(t *testing.T) {
|
||||
|
||||
ctx, cancel, client := kit.SetupFEVMTest(t)
|
||||
defer cancel()
|
||||
|
||||
highestSuccessCount := uint64(225)
|
||||
highestSuccessCount := uint64(226)
|
||||
|
||||
filename := "contracts/RecursiveDelegeatecall.hex"
|
||||
recursiveDelegatecallSuccess(ctx, t, client, filename, uint64(1))
|
||||
@ -621,7 +620,7 @@ func TestFEVMRecursiveActorCall(t *testing.T) {
|
||||
t.Run("n=0,r=252", testN(0, 252, exitcode.Ok))
|
||||
t.Run("n=251,r=166", testN(251, 166, exitcode.Ok))
|
||||
|
||||
t.Run("n=0,r=253-fails", testN(0, 253, exitcode.ExitCode(33))) // 33 means transaction reverted
|
||||
t.Run("n=0,r=253-fails", testN(0, 254, exitcode.ExitCode(33))) // 33 means transaction reverted
|
||||
t.Run("n=251,r=167-fails", testN(251, 167, exitcode.ExitCode(33)))
|
||||
}
|
||||
|
||||
|
@ -513,7 +513,7 @@ func (n *Ensemble) Start() *Ensemble {
|
||||
// this is a miner created after genesis, so it won't have a preseal.
|
||||
// we need to create it on chain.
|
||||
|
||||
proofType, err := miner.WindowPoStProofTypeFromSectorSize(m.options.sectorSize)
|
||||
proofType, err := miner.WindowPoStProofTypeFromSectorSize(m.options.sectorSize, n.genesis.version)
|
||||
require.NoError(n.t, err)
|
||||
|
||||
params, aerr := actors.SerializeParams(&power3.CreateMinerParams{
|
||||
|
@ -49,12 +49,12 @@ func LatestActorsAt(upgradeHeight abi.ChainEpoch) EnsembleOpt {
|
||||
})
|
||||
/* inline-gen start */
|
||||
return UpgradeSchedule(stmgr.Upgrade{
|
||||
Network: network.Version17,
|
||||
Network: network.Version19,
|
||||
Height: -1,
|
||||
}, stmgr.Upgrade{
|
||||
Network: network.Version18,
|
||||
Network: network.Version20,
|
||||
Height: upgradeHeight,
|
||||
Migration: filcns.UpgradeActorsV10,
|
||||
Migration: filcns.UpgradeActorsV11,
|
||||
})
|
||||
/* inline-gen end */
|
||||
}
|
||||
|
@ -1,98 +0,0 @@
|
||||
package itests
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"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/builtin"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
gstStore "github.com/filecoin-project/go-state-types/store"
|
||||
|
||||
"github.com/filecoin-project/lotus/blockstore"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
builtin2 "github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/consensus/filcns"
|
||||
"github.com/filecoin-project/lotus/chain/state"
|
||||
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||
"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/itests/kit"
|
||||
"github.com/filecoin-project/lotus/node/impl"
|
||||
)
|
||||
|
||||
func TestMigrationNV18(t *testing.T) {
|
||||
kit.QuietMiningLogs()
|
||||
|
||||
nv18epoch := abi.ChainEpoch(100)
|
||||
testClient, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(),
|
||||
kit.UpgradeSchedule(stmgr.Upgrade{
|
||||
Network: network.Version17,
|
||||
Height: -1,
|
||||
}, stmgr.Upgrade{
|
||||
Network: network.Version18,
|
||||
Height: nv18epoch,
|
||||
Migration: filcns.UpgradeActorsV10,
|
||||
},
|
||||
))
|
||||
|
||||
ens.InterconnectAll().BeginMining(10 * time.Millisecond)
|
||||
|
||||
clientApi := testClient.FullNode.(*impl.FullNodeAPI)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
testClient.WaitTillChain(ctx, kit.HeightAtLeast(nv18epoch+5))
|
||||
|
||||
// Now that we have upgraded, we need to:
|
||||
// - the EAM exists, has "empty" state
|
||||
// - the EthZeroAddress exists
|
||||
// - all actors have nil Address fields
|
||||
|
||||
bs := blockstore.NewAPIBlockstore(testClient)
|
||||
ctxStore := gstStore.WrapBlockStore(ctx, bs)
|
||||
|
||||
currTs, err := clientApi.ChainHead(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
newStateTree, err := state.LoadStateTree(ctxStore, currTs.Blocks()[0].ParentStateRoot)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, types.StateTreeVersion5, newStateTree.Version())
|
||||
|
||||
codeIDsv10, ok := actors.GetActorCodeIDsFromManifest(actorstypes.Version10)
|
||||
require.True(t, ok)
|
||||
|
||||
// check the EAM actor
|
||||
EAMActor, err := newStateTree.GetActor(builtin.EthereumAddressManagerActorAddr)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, vm.EmptyObjectCid, EAMActor.Head)
|
||||
EAMCodeID, ok := codeIDsv10[manifest.EamKey]
|
||||
require.True(t, ok)
|
||||
require.Equal(t, EAMCodeID, EAMActor.Code)
|
||||
|
||||
// check the EthZeroAddress
|
||||
ethZeroAddr, err := (ethtypes.EthAddress{}).ToFilecoinAddress()
|
||||
require.NoError(t, err)
|
||||
ethZeroAddrID, err := newStateTree.LookupID(ethZeroAddr)
|
||||
require.NoError(t, err)
|
||||
ethZeroActor, err := newStateTree.GetActor(ethZeroAddrID)
|
||||
require.NoError(t, err)
|
||||
require.True(t, builtin2.IsEthAccountActor(ethZeroActor.Code))
|
||||
require.Equal(t, vm.EmptyObjectCid, ethZeroActor.Head)
|
||||
|
||||
// check all actor's Address fields
|
||||
require.NoError(t, newStateTree.ForEach(func(address address.Address, actor *types.Actor) error {
|
||||
if address != ethZeroAddrID {
|
||||
require.Nil(t, actor.Address)
|
||||
}
|
||||
return nil
|
||||
}))
|
||||
}
|
@ -11,19 +11,26 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
miner11 "github.com/filecoin-project/go-state-types/builtin/v11/miner"
|
||||
power11 "github.com/filecoin-project/go-state-types/builtin/v11/power"
|
||||
adt11 "github.com/filecoin-project/go-state-types/builtin/v11/util/adt"
|
||||
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
|
||||
migration "github.com/filecoin-project/go-state-types/builtin/v9/migration/test"
|
||||
miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
verifregst "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
gstStore "github.com/filecoin-project/go-state-types/store"
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/blockstore"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
builtin2 "github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/datacap"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
@ -32,6 +39,8 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/state"
|
||||
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||
"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/chain/wallet/key"
|
||||
"github.com/filecoin-project/lotus/itests/kit"
|
||||
"github.com/filecoin-project/lotus/node/impl"
|
||||
@ -520,3 +529,236 @@ func TestMigrationNV17(t *testing.T) {
|
||||
|
||||
require.Nil(t, dc)
|
||||
}
|
||||
|
||||
func TestMigrationNV18(t *testing.T) {
|
||||
kit.QuietMiningLogs()
|
||||
|
||||
nv18epoch := abi.ChainEpoch(100)
|
||||
testClient, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(),
|
||||
kit.UpgradeSchedule(stmgr.Upgrade{
|
||||
Network: network.Version17,
|
||||
Height: -1,
|
||||
}, stmgr.Upgrade{
|
||||
Network: network.Version18,
|
||||
Height: nv18epoch,
|
||||
Migration: filcns.UpgradeActorsV10,
|
||||
},
|
||||
))
|
||||
|
||||
ens.InterconnectAll().BeginMining(10 * time.Millisecond)
|
||||
|
||||
clientApi := testClient.FullNode.(*impl.FullNodeAPI)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
testClient.WaitTillChain(ctx, kit.HeightAtLeast(nv18epoch+5))
|
||||
|
||||
// Now that we have upgraded, we need to:
|
||||
// - the EAM exists, has "empty" state
|
||||
// - the EthZeroAddress exists
|
||||
// - all actors have nil Address fields
|
||||
|
||||
bs := blockstore.NewAPIBlockstore(testClient)
|
||||
ctxStore := gstStore.WrapBlockStore(ctx, bs)
|
||||
|
||||
currTs, err := clientApi.ChainHead(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
newStateTree, err := state.LoadStateTree(ctxStore, currTs.Blocks()[0].ParentStateRoot)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, types.StateTreeVersion5, newStateTree.Version())
|
||||
|
||||
codeIDsv10, ok := actors.GetActorCodeIDsFromManifest(actorstypes.Version10)
|
||||
require.True(t, ok)
|
||||
|
||||
// check the EAM actor
|
||||
EAMActor, err := newStateTree.GetActor(builtin.EthereumAddressManagerActorAddr)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, vm.EmptyObjectCid, EAMActor.Head)
|
||||
EAMCodeID, ok := codeIDsv10[manifest.EamKey]
|
||||
require.True(t, ok)
|
||||
require.Equal(t, EAMCodeID, EAMActor.Code)
|
||||
|
||||
// check the EthZeroAddress
|
||||
ethZeroAddr, err := (ethtypes.EthAddress{}).ToFilecoinAddress()
|
||||
require.NoError(t, err)
|
||||
ethZeroAddrID, err := newStateTree.LookupID(ethZeroAddr)
|
||||
require.NoError(t, err)
|
||||
ethZeroActor, err := newStateTree.GetActor(ethZeroAddrID)
|
||||
require.NoError(t, err)
|
||||
require.True(t, builtin2.IsEthAccountActor(ethZeroActor.Code))
|
||||
require.Equal(t, vm.EmptyObjectCid, ethZeroActor.Head)
|
||||
|
||||
// check all actor's Address fields
|
||||
require.NoError(t, newStateTree.ForEach(func(address address.Address, actor *types.Actor) error {
|
||||
if address != ethZeroAddrID {
|
||||
require.Nil(t, actor.Address)
|
||||
}
|
||||
return nil
|
||||
}))
|
||||
}
|
||||
|
||||
func TestMigrationNV19(t *testing.T) {
|
||||
kit.QuietMiningLogs()
|
||||
|
||||
blockTime := 5 * time.Millisecond
|
||||
nv19epoch := abi.ChainEpoch(100)
|
||||
nv20epoch := nv19epoch + builtin.EpochsInDay
|
||||
testClient, testMiner, ens := kit.EnsembleMinimal(t, kit.MockProofs(),
|
||||
kit.UpgradeSchedule(stmgr.Upgrade{
|
||||
Network: network.Version18,
|
||||
Height: -1,
|
||||
}, stmgr.Upgrade{
|
||||
Network: network.Version19,
|
||||
Height: nv19epoch,
|
||||
Migration: filcns.UpgradeActorsV11,
|
||||
}, stmgr.Upgrade{
|
||||
Network: network.Version20,
|
||||
Height: nv20epoch,
|
||||
Migration: nil,
|
||||
},
|
||||
))
|
||||
|
||||
ens.InterconnectAll().BeginMining(blockTime)
|
||||
|
||||
clientApi := testClient.FullNode.(*impl.FullNodeAPI)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
testClient.WaitTillChain(ctx, kit.HeightAtLeast(nv19epoch+5))
|
||||
|
||||
bs := blockstore.NewAPIBlockstore(testClient)
|
||||
ctxStore := gstStore.WrapBlockStore(ctx, bs)
|
||||
|
||||
postMigrationTs, err := clientApi.ChainHead(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
newStateTree, err := state.LoadStateTree(ctxStore, postMigrationTs.Blocks()[0].ParentStateRoot)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, types.StateTreeVersion5, newStateTree.Version())
|
||||
|
||||
// Now that we have upgraded, we need to check that:
|
||||
|
||||
// - a PoSt is successfully submitted in nv19
|
||||
// - a PoSt is successfully submitted in nv20
|
||||
// - all claims in the Power actor are of v1_1 type
|
||||
// - the miner's info has been updated to the v1_1 type
|
||||
|
||||
// Wait for an nv19 PoSt
|
||||
|
||||
mi, err := testClient.StateMinerInfo(ctx, testMiner.ActorAddr, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
|
||||
wact19, err := testClient.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
en19 := wact19.Nonce
|
||||
|
||||
// wait for a new message to be sent from worker address, it will be a PoSt
|
||||
|
||||
waitForProof19:
|
||||
for {
|
||||
//stm: @CHAIN_STATE_GET_ACTOR_001
|
||||
wact, err := testClient.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
if wact.Nonce > en19 {
|
||||
break waitForProof19
|
||||
}
|
||||
|
||||
build.Clock.Sleep(blockTime)
|
||||
}
|
||||
|
||||
slm19, err := testClient.StateListMessages(ctx, &api.MessageMatch{To: testMiner.ActorAddr}, types.EmptyTSK, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
pmr19, err := testClient.StateSearchMsg(ctx, types.EmptyTSK, slm19[0], -1, false)
|
||||
require.NoError(t, err)
|
||||
|
||||
nv19, err := testClient.StateNetworkVersion(ctx, pmr19.TipSet)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, network.Version19, nv19)
|
||||
|
||||
require.True(t, pmr19.Receipt.ExitCode.IsSuccess())
|
||||
|
||||
slmsg19, err := testClient.ChainGetMessage(ctx, slm19[0])
|
||||
require.NoError(t, err)
|
||||
|
||||
var params19 miner11.SubmitWindowedPoStParams
|
||||
require.NoError(t, params19.UnmarshalCBOR(bytes.NewBuffer(slmsg19.Params)))
|
||||
require.Equal(t, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1, params19.Proofs[0].PoStProof)
|
||||
|
||||
// Wait for nv20
|
||||
|
||||
testClient.WaitTillChain(ctx, kit.HeightAtLeast(nv20epoch+5))
|
||||
|
||||
// Wait for an nv20 PoSt
|
||||
|
||||
wact20, err := testClient.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
en20 := wact20.Nonce
|
||||
|
||||
// wait for a new message to be sent from worker address, it will be a PoSt
|
||||
|
||||
waitForProof20:
|
||||
for {
|
||||
//stm: @CHAIN_STATE_GET_ACTOR_001
|
||||
wact, err := testClient.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
if wact.Nonce > en20 {
|
||||
break waitForProof20
|
||||
}
|
||||
|
||||
build.Clock.Sleep(blockTime)
|
||||
}
|
||||
|
||||
slm20, err := testClient.StateListMessages(ctx, &api.MessageMatch{To: testMiner.ActorAddr}, types.EmptyTSK, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
pmr20, err := testClient.StateSearchMsg(ctx, types.EmptyTSK, slm20[0], -1, false)
|
||||
require.NoError(t, err)
|
||||
|
||||
nv20, err := testClient.StateNetworkVersion(ctx, pmr20.TipSet)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, network.Version20, nv20)
|
||||
|
||||
require.True(t, pmr20.Receipt.ExitCode.IsSuccess())
|
||||
|
||||
slmsg20, err := testClient.ChainGetMessage(ctx, slm20[0])
|
||||
require.NoError(t, err)
|
||||
|
||||
var params20 miner11.SubmitWindowedPoStParams
|
||||
require.NoError(t, params20.UnmarshalCBOR(bytes.NewBuffer(slmsg20.Params)))
|
||||
require.Equal(t, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1, params20.Proofs[0].PoStProof)
|
||||
|
||||
// check claims in the Power actor
|
||||
|
||||
powerActor, err := newStateTree.GetActor(builtin.StoragePowerActorAddr)
|
||||
require.NoError(t, err)
|
||||
|
||||
var powerSt power11.State
|
||||
require.NoError(t, ctxStore.Get(ctx, powerActor.Head, &powerSt))
|
||||
|
||||
powerClaims, err := adt11.AsMap(ctxStore, powerSt.Claims, builtin.DefaultHamtBitwidth)
|
||||
require.NoError(t, err)
|
||||
|
||||
var claim power11.Claim
|
||||
require.NoError(t, powerClaims.ForEach(&claim, func(key string) error {
|
||||
v1proof, err := claim.WindowPoStProofType.ToV1_1PostProof()
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, v1proof, claim.WindowPoStProofType)
|
||||
return nil
|
||||
}))
|
||||
|
||||
// check MinerInfo
|
||||
|
||||
minerInfo, err := testClient.StateMinerInfo(ctx, testMiner.ActorAddr, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
|
||||
v1proof, err := minerInfo.WindowPoStProofType.ToV1_1PostProof()
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, v1proof, minerInfo.WindowPoStProofType)
|
||||
|
||||
}
|
@ -472,7 +472,7 @@ func (g *Garbager) createMiner(ctx context.Context) *lapi.MsgLookup {
|
||||
params, err := actors.SerializeParams(&power6.CreateMinerParams{
|
||||
Owner: owner,
|
||||
Worker: worker,
|
||||
WindowPoStProofType: abi.RegisteredPoStProof_StackedDrgWindow32GiBV1,
|
||||
WindowPoStProofType: abi.RegisteredPoStProof_StackedDrgWindow32GiBV1_1,
|
||||
})
|
||||
require.NoError(g.t, err)
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
package itests
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
@ -12,10 +13,13 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
miner11 "github.com/filecoin-project/go-state-types/builtin/v11/miner"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/itests/kit"
|
||||
"github.com/filecoin-project/lotus/node/impl"
|
||||
@ -53,9 +57,6 @@ func TestWindowedPost(t *testing.T) {
|
||||
|
||||
func testWindowPostUpgrade(t *testing.T, blocktime time.Duration, nSectors int, upgradeHeight abi.ChainEpoch) {
|
||||
|
||||
/// XXX TEMPORARILY DISABLED UNTIL NV18 MIGRATION IS IMPLEMENTED
|
||||
t.Skip("temporarily disabled as nv18 migration is not yet implemented")
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
@ -343,3 +344,182 @@ waitForProof:
|
||||
|
||||
require.NotEqual(t, pmr.GasCost.BaseFeeBurn, big.Zero())
|
||||
}
|
||||
|
||||
// Tests that V1_1 proofs are generated and accepted in nv19, and V1 proofs are accepted
|
||||
func TestWindowPostV1P1NV19(t *testing.T) {
|
||||
kit.QuietMiningLogs()
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
blocktime := 2 * time.Millisecond
|
||||
|
||||
client, miner, ens := kit.EnsembleMinimal(t, kit.GenesisNetworkVersion(network.Version19))
|
||||
ens.InterconnectAll().BeginMining(blocktime)
|
||||
|
||||
maddr, err := miner.ActorAddress(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
mi, err := client.StateMinerInfo(ctx, maddr, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
|
||||
wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
en := wact.Nonce
|
||||
|
||||
// wait for a new message to be sent from worker address, it will be a PoSt
|
||||
|
||||
waitForProof:
|
||||
for {
|
||||
wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
if wact.Nonce > en {
|
||||
break waitForProof
|
||||
}
|
||||
|
||||
build.Clock.Sleep(blocktime)
|
||||
}
|
||||
|
||||
slm, err := client.StateListMessages(ctx, &api.MessageMatch{To: maddr}, types.EmptyTSK, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
pmr, err := client.StateSearchMsg(ctx, types.EmptyTSK, slm[0], -1, false)
|
||||
require.NoError(t, err)
|
||||
|
||||
inclTs, err := client.ChainGetTipSet(ctx, pmr.TipSet)
|
||||
require.NoError(t, err)
|
||||
|
||||
inclTsParents, err := client.ChainGetTipSet(ctx, inclTs.Parents())
|
||||
require.NoError(t, err)
|
||||
|
||||
nv, err := client.StateNetworkVersion(ctx, pmr.TipSet)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, network.Version19, nv)
|
||||
|
||||
require.True(t, pmr.Receipt.ExitCode.IsSuccess())
|
||||
|
||||
slmsg, err := client.ChainGetMessage(ctx, slm[0])
|
||||
require.NoError(t, err)
|
||||
|
||||
var params miner11.SubmitWindowedPoStParams
|
||||
require.NoError(t, params.UnmarshalCBOR(bytes.NewBuffer(slmsg.Params)))
|
||||
require.Equal(t, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1, params.Proofs[0].PoStProof)
|
||||
|
||||
// "Turn" this into a V1 proof -- the proof will be invalid, but won't be validated, and so the call should succeed
|
||||
params.Proofs[0].PoStProof = abi.RegisteredPoStProof_StackedDrgWindow2KiBV1
|
||||
v1PostParams := new(bytes.Buffer)
|
||||
require.NoError(t, params.MarshalCBOR(v1PostParams))
|
||||
|
||||
slmsg.Params = v1PostParams.Bytes()
|
||||
|
||||
// Simulate call on inclTsParents's parents, so that the partition isn't already proven
|
||||
call, err := client.StateCall(ctx, slmsg, inclTsParents.Parents())
|
||||
require.NoError(t, err)
|
||||
require.True(t, call.MsgRct.ExitCode.IsSuccess())
|
||||
}
|
||||
|
||||
// Tests that V1_1 proofs are generated and accepted in nv20, and that V1 proofs are NOT
|
||||
func TestWindowPostV1P1NV20(t *testing.T) {
|
||||
kit.QuietMiningLogs()
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
blocktime := 2 * time.Millisecond
|
||||
|
||||
client, miner, ens := kit.EnsembleMinimal(t, kit.GenesisNetworkVersion(network.Version20))
|
||||
ens.InterconnectAll().BeginMining(blocktime)
|
||||
|
||||
maddr, err := miner.ActorAddress(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
mi, err := client.StateMinerInfo(ctx, maddr, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
|
||||
wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
en := wact.Nonce
|
||||
|
||||
// wait for a new message to be sent from worker address, it will be a PoSt
|
||||
|
||||
waitForProof:
|
||||
for {
|
||||
//stm: @CHAIN_STATE_GET_ACTOR_001
|
||||
wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
if wact.Nonce > en {
|
||||
break waitForProof
|
||||
}
|
||||
|
||||
build.Clock.Sleep(blocktime)
|
||||
}
|
||||
|
||||
slm, err := client.StateListMessages(ctx, &api.MessageMatch{To: maddr}, types.EmptyTSK, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
pmr, err := client.StateSearchMsg(ctx, types.EmptyTSK, slm[0], -1, false)
|
||||
require.NoError(t, err)
|
||||
|
||||
inclTs, err := client.ChainGetTipSet(ctx, pmr.TipSet)
|
||||
require.NoError(t, err)
|
||||
|
||||
nv, err := client.StateNetworkVersion(ctx, pmr.TipSet)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, network.Version20, nv)
|
||||
|
||||
require.True(t, pmr.Receipt.ExitCode.IsSuccess())
|
||||
|
||||
slmsg, err := client.ChainGetMessage(ctx, slm[0])
|
||||
require.NoError(t, err)
|
||||
|
||||
var params miner11.SubmitWindowedPoStParams
|
||||
require.NoError(t, params.UnmarshalCBOR(bytes.NewBuffer(slmsg.Params)))
|
||||
require.Equal(t, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1, params.Proofs[0].PoStProof)
|
||||
|
||||
// "Turn" this into a V1 proof -- the proof will be invalid, but we won't get that far
|
||||
params.Proofs[0].PoStProof = abi.RegisteredPoStProof_StackedDrgWindow2KiBV1
|
||||
v1PostParams := new(bytes.Buffer)
|
||||
require.NoError(t, params.MarshalCBOR(v1PostParams))
|
||||
|
||||
slmsg.Params = v1PostParams.Bytes()
|
||||
|
||||
// Simulate call on inclTs's parents, so that the partition isn't already proven
|
||||
_, err = client.StateCall(ctx, slmsg, inclTs.Parents())
|
||||
require.ErrorContains(t, err, "expected proof of type StackedDRGWindow2KiBV1P1, got StackedDRGWindow2KiBV1")
|
||||
|
||||
for {
|
||||
//stm: @CHAIN_STATE_MINER_CALCULATE_DEADLINE_001
|
||||
di, err := client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK)
|
||||
require.NoError(t, err)
|
||||
// wait until the deadline finishes.
|
||||
if di.Index == ((params.Deadline + 1) % di.WPoStPeriodDeadlines) {
|
||||
break
|
||||
}
|
||||
|
||||
build.Clock.Sleep(blocktime)
|
||||
}
|
||||
|
||||
// Try to object to the proof. This should fail.
|
||||
|
||||
disputeParams := &miner11.DisputeWindowedPoStParams{
|
||||
Deadline: params.Deadline,
|
||||
PoStIndex: 0,
|
||||
}
|
||||
|
||||
enc, aerr := actors.SerializeParams(disputeParams)
|
||||
require.NoError(t, aerr)
|
||||
|
||||
disputeMsg := &types.Message{
|
||||
To: maddr,
|
||||
Method: builtin.MethodsMiner.DisputeWindowedPoSt,
|
||||
Params: enc,
|
||||
Value: types.NewInt(0),
|
||||
From: client.DefaultKey.Address,
|
||||
}
|
||||
|
||||
_, err = client.MpoolPushMessage(ctx, disputeMsg, nil)
|
||||
require.Error(t, err)
|
||||
require.Contains(t, err.Error(), "failed to dispute valid post")
|
||||
require.Contains(t, err.Error(), "(RetCode=16)")
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package bundle
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
@ -53,6 +54,7 @@ func LoadBundles(ctx context.Context, bs blockstore.Blockstore, versions ...acto
|
||||
// All manifests are registered on start, so this must succeed.
|
||||
return xerrors.Errorf("unknown actor version v%d", av)
|
||||
}
|
||||
fmt.Printf("manifest cid: %s\n", manifestCid)
|
||||
|
||||
if haveManifest, err := bs.Has(ctx, manifestCid); err != nil {
|
||||
return xerrors.Errorf("blockstore error when loading manifest %s: %w", manifestCid, err)
|
||||
|
@ -1808,6 +1808,8 @@ func (a *StateAPI) StateGetNetworkParams(ctx context.Context) (*api.NetworkParam
|
||||
UpgradeSkyrHeight: build.UpgradeSkyrHeight,
|
||||
UpgradeSharkHeight: build.UpgradeSharkHeight,
|
||||
UpgradeHyggeHeight: build.UpgradeHyggeHeight,
|
||||
UpgradeLightningHeight: build.UpgradeLightningHeight,
|
||||
UpgradeThunderHeight: build.UpgradeThunderHeight,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ func (p *BasicPreCommitPolicy) getCCSectorLifetime() (abi.ChainEpoch, error) {
|
||||
}
|
||||
|
||||
var ccLifetimeEpochs = abi.ChainEpoch(uint64(c.CommittedCapacitySectorLifetime.Seconds()) / builtin.EpochDurationSeconds)
|
||||
// if zero value in config, assume maximum sector extension
|
||||
// if zero value in config, assume default sector extension
|
||||
if ccLifetimeEpochs == 0 {
|
||||
ccLifetimeEpochs = policy.GetMaxSectorExpirationExtension()
|
||||
}
|
||||
|
@ -97,13 +97,7 @@ func (m *Manager) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof,
|
||||
return
|
||||
}
|
||||
|
||||
wpp, err := sector.ProofType.RegisteredWindowPoStProof()
|
||||
if err != nil {
|
||||
addBad(sector.ID, fmt.Sprint("can't get proof type"))
|
||||
return
|
||||
}
|
||||
|
||||
ch, err := ffi.GeneratePoStFallbackSectorChallenges(wpp, sector.ID.Miner, postRand, []abi.SectorNumber{
|
||||
ch, err := ffi.GeneratePoStFallbackSectorChallenges(pp, sector.ID.Miner, postRand, []abi.SectorNumber{
|
||||
sector.ID.Number,
|
||||
})
|
||||
if err != nil {
|
||||
@ -126,7 +120,7 @@ func (m *Manager) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof,
|
||||
SealedCID: commr,
|
||||
Challenge: ch.Challenges[sector.ID.Number],
|
||||
Update: update,
|
||||
}, wpp)
|
||||
}, pp)
|
||||
if err != nil {
|
||||
log.Warnw("CheckProvable Sector FAULT: generating vanilla proof", "sector", sector, "err", err)
|
||||
addBad(sector.ID, fmt.Sprintf("generating vanilla proof: %s", err))
|
||||
|
@ -189,7 +189,18 @@ func post(t *testing.T, sealer *Sealer, skipped []abi.SectorID, seals ...seal) {
|
||||
}
|
||||
}
|
||||
|
||||
proofs, skp, err := sealer.GenerateWindowPoSt(context.TODO(), seals[0].ref.ID.Miner, xsis, randomness)
|
||||
ppt, err := xsis[0].SealProof.RegisteredWindowPoStProof()
|
||||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
}
|
||||
|
||||
ppt, err = ppt.ToV1_1PostProof()
|
||||
if err != nil {
|
||||
|
||||
t.Fatalf("%+v", err)
|
||||
}
|
||||
|
||||
proofs, skp, err := sealer.GenerateWindowPoSt(context.TODO(), seals[0].ref.ID.Miner, ppt, xsis, randomness)
|
||||
if len(skipped) > 0 {
|
||||
require.Error(t, err)
|
||||
require.EqualValues(t, skipped, skp)
|
||||
|
@ -18,7 +18,15 @@ import (
|
||||
|
||||
func (sb *Sealer) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error) {
|
||||
randomness[31] &= 0x3f
|
||||
privsectors, skipped, done, err := sb.pubExtendedSectorToPriv(ctx, minerID, sectorInfo, nil, abi.RegisteredSealProof.RegisteredWinningPoStProof) // TODO: FAULTS?
|
||||
if len(sectorInfo) == 0 {
|
||||
return nil, xerrors.Errorf("must provide sectors for winning post")
|
||||
}
|
||||
ppt, err := sectorInfo[0].SealProof.RegisteredWinningPoStProof()
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to convert to winning post proof: %w", err)
|
||||
}
|
||||
|
||||
privsectors, skipped, done, err := sb.pubExtendedSectorToPriv(ctx, minerID, sectorInfo, nil, ppt) // TODO: FAULTS?
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -30,9 +38,9 @@ func (sb *Sealer) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID,
|
||||
return ffi.GenerateWinningPoSt(minerID, privsectors, randomness)
|
||||
}
|
||||
|
||||
func (sb *Sealer) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, []abi.SectorID, error) {
|
||||
func (sb *Sealer) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, postProofType abi.RegisteredPoStProof, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, []abi.SectorID, error) {
|
||||
randomness[31] &= 0x3f
|
||||
privsectors, skipped, done, err := sb.pubExtendedSectorToPriv(ctx, minerID, sectorInfo, nil, abi.RegisteredSealProof.RegisteredWindowPoStProof)
|
||||
privsectors, skipped, done, err := sb.pubExtendedSectorToPriv(ctx, minerID, sectorInfo, nil, postProofType)
|
||||
if err != nil {
|
||||
return nil, nil, xerrors.Errorf("gathering sector info: %w", err)
|
||||
}
|
||||
@ -55,7 +63,7 @@ func (sb *Sealer) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, s
|
||||
return proof, faultyIDs, err
|
||||
}
|
||||
|
||||
func (sb *Sealer) pubExtendedSectorToPriv(ctx context.Context, mid abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, faults []abi.SectorNumber, rpt func(abi.RegisteredSealProof) (abi.RegisteredPoStProof, error)) (ffi.SortedPrivateSectorInfo, []abi.SectorID, func(), error) {
|
||||
func (sb *Sealer) pubExtendedSectorToPriv(ctx context.Context, mid abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, faults []abi.SectorNumber, postProofType abi.RegisteredPoStProof) (ffi.SortedPrivateSectorInfo, []abi.SectorID, func(), error) {
|
||||
fmap := map[abi.SectorNumber]struct{}{}
|
||||
for _, fault := range faults {
|
||||
fmap[fault] = struct{}{}
|
||||
@ -106,12 +114,6 @@ func (sb *Sealer) pubExtendedSectorToPriv(ctx context.Context, mid abi.ActorID,
|
||||
sealed = paths.Sealed
|
||||
}
|
||||
|
||||
postProofType, err := rpt(s.SealProof)
|
||||
if err != nil {
|
||||
done()
|
||||
return ffi.SortedPrivateSectorInfo{}, nil, nil, xerrors.Errorf("acquiring registered PoSt proof from sector info %+v: %w", s, err)
|
||||
}
|
||||
|
||||
ffiInfo := proof.SectorInfo{
|
||||
SealProof: s.SealProof,
|
||||
SectorNumber: s.SectorNumber,
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
|
||||
ffi "github.com/filecoin-project/filecoin-ffi"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/specs-actors/v7/actors/runtime/proof"
|
||||
|
||||
"github.com/filecoin-project/lotus/storage/sealer/storiface"
|
||||
@ -78,12 +78,12 @@ func (m *Manager) generateWinningPoSt(ctx context.Context, minerID abi.ActorID,
|
||||
return proofs, nil
|
||||
}
|
||||
|
||||
func (m *Manager) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (proof []proof.PoStProof, skipped []abi.SectorID, err error) {
|
||||
func (m *Manager) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, postProofType abi.RegisteredPoStProof, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (proof []proof.PoStProof, skipped []abi.SectorID, err error) {
|
||||
if !m.disableBuiltinWindowPoSt && !m.windowPoStSched.CanSched(ctx) {
|
||||
// if builtin PoSt isn't disabled, and there are no workers, compute the PoSt locally
|
||||
|
||||
log.Info("GenerateWindowPoSt run at lotus-miner")
|
||||
p, s, err := m.localProver.GenerateWindowPoSt(ctx, minerID, sectorInfo, randomness)
|
||||
p, s, err := m.localProver.GenerateWindowPoSt(ctx, minerID, postProofType, sectorInfo, randomness)
|
||||
if err != nil {
|
||||
return nil, nil, xerrors.Errorf("local prover: %w", err)
|
||||
}
|
||||
@ -91,7 +91,7 @@ func (m *Manager) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, s
|
||||
return p, s, nil
|
||||
}
|
||||
|
||||
return m.generateWindowPoSt(ctx, minerID, sectorInfo, randomness)
|
||||
return m.generateWindowPoSt(ctx, minerID, postProofType, sectorInfo, randomness)
|
||||
}
|
||||
|
||||
func dedupeSectorInfo(sectorInfo []proof.ExtendedSectorInfo) []proof.ExtendedSectorInfo {
|
||||
@ -107,7 +107,7 @@ func dedupeSectorInfo(sectorInfo []proof.ExtendedSectorInfo) []proof.ExtendedSec
|
||||
return out
|
||||
}
|
||||
|
||||
func (m *Manager) generateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, []abi.SectorID, error) {
|
||||
func (m *Manager) generateWindowPoSt(ctx context.Context, minerID abi.ActorID, ppt abi.RegisteredPoStProof, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, []abi.SectorID, error) {
|
||||
var retErr error = nil
|
||||
randomness[31] &= 0x3f
|
||||
|
||||
@ -119,11 +119,6 @@ func (m *Manager) generateWindowPoSt(ctx context.Context, minerID abi.ActorID, s
|
||||
|
||||
spt := sectorInfo[0].SealProof
|
||||
|
||||
ppt, err := spt.RegisteredWindowPoStProof()
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
maxPartitionSize, err := builtin.PoStProofWindowPoStPartitionSectors(ppt) // todo proxy through chain/actors
|
||||
if err != nil {
|
||||
return nil, nil, xerrors.Errorf("get sectors count of partition failed:%+v", err)
|
||||
|
@ -349,10 +349,15 @@ func (mgr *SectorMgr) GenerateWinningPoSt(ctx context.Context, minerID abi.Actor
|
||||
}
|
||||
}
|
||||
|
||||
return generateFakePoSt(sectorInfo, abi.RegisteredSealProof.RegisteredWinningPoStProof, randomness), nil
|
||||
ppt, err := sectorInfo[0].SealProof.RegisteredWinningPoStProof()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return generateFakePoSt(sectorInfo, ppt, randomness), nil
|
||||
}
|
||||
|
||||
func (mgr *SectorMgr) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, xSectorInfo []prooftypes.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]prooftypes.PoStProof, []abi.SectorID, error) {
|
||||
func (mgr *SectorMgr) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, ppt abi.RegisteredPoStProof, xSectorInfo []prooftypes.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]prooftypes.PoStProof, []abi.SectorID, error) {
|
||||
mgr.lk.Lock()
|
||||
defer mgr.lk.Unlock()
|
||||
|
||||
@ -395,7 +400,7 @@ func (mgr *SectorMgr) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorI
|
||||
}
|
||||
}
|
||||
|
||||
return generateFakePoSt(sectorInfo, abi.RegisteredSealProof.RegisteredWindowPoStProof, randomness), skipped, nil
|
||||
return generateFakePoSt(sectorInfo, ppt, randomness), skipped, nil
|
||||
}
|
||||
|
||||
func generateFakePoStProof(sectorInfo []prooftypes.SectorInfo, randomness abi.PoStRandomness) []byte {
|
||||
@ -413,15 +418,10 @@ func generateFakePoStProof(sectorInfo []prooftypes.SectorInfo, randomness abi.Po
|
||||
|
||||
}
|
||||
|
||||
func generateFakePoSt(sectorInfo []prooftypes.SectorInfo, rpt func(abi.RegisteredSealProof) (abi.RegisteredPoStProof, error), randomness abi.PoStRandomness) []prooftypes.PoStProof {
|
||||
wp, err := rpt(sectorInfo[0].SealProof)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
func generateFakePoSt(sectorInfo []prooftypes.SectorInfo, ppt abi.RegisteredPoStProof, randomness abi.PoStRandomness) []prooftypes.PoStProof {
|
||||
return []prooftypes.PoStProof{
|
||||
{
|
||||
PoStProof: wp,
|
||||
PoStProof: ppt,
|
||||
ProofBytes: generateFakePoStProof(sectorInfo, randomness),
|
||||
},
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ var NoSectorRef = SectorRef{}
|
||||
|
||||
type ProverPoSt interface {
|
||||
GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error)
|
||||
GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (proof []proof.PoStProof, skipped []abi.SectorID, err error)
|
||||
GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, ppt abi.RegisteredPoStProof, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (proof []proof.PoStProof, skipped []abi.SectorID, err error)
|
||||
|
||||
GenerateWinningPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte) ([]proof.PoStProof, error)
|
||||
GenerateWindowPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte, partitionIdx int) (proof.PoStProof, error)
|
||||
|
@ -33,7 +33,7 @@ func (t *testExec) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID,
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (t *testExec) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (miner []proof.PoStProof, skipped []abi.SectorID, err error) {
|
||||
func (t *testExec) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, ppt abi.RegisteredPoStProof, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (miner []proof.PoStProof, skipped []abi.SectorID, err error) {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
|
@ -189,12 +189,12 @@ func (s *WindowPoStScheduler) runSubmitPoST(
|
||||
func (s *WindowPoStScheduler) checkSectors(ctx context.Context, check bitfield.BitField, tsk types.TipSetKey) (bitfield.BitField, error) {
|
||||
mid, err := address.IDFromAddress(s.actor)
|
||||
if err != nil {
|
||||
return bitfield.BitField{}, err
|
||||
return bitfield.BitField{}, xerrors.Errorf("failed to convert to ID addr: %w", err)
|
||||
}
|
||||
|
||||
sectorInfos, err := s.api.StateMinerSectors(ctx, s.actor, &check, tsk)
|
||||
if err != nil {
|
||||
return bitfield.BitField{}, err
|
||||
return bitfield.BitField{}, xerrors.Errorf("failed to get sector infos: %w", err)
|
||||
}
|
||||
|
||||
type checkSector struct {
|
||||
@ -218,7 +218,21 @@ func (s *WindowPoStScheduler) checkSectors(ctx context.Context, check bitfield.B
|
||||
})
|
||||
}
|
||||
|
||||
bad, err := s.faultTracker.CheckProvable(ctx, s.proofType, tocheck, func(ctx context.Context, id abi.SectorID) (cid.Cid, bool, error) {
|
||||
nv, err := s.api.StateNetworkVersion(ctx, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return bitfield.BitField{}, xerrors.Errorf("failed to get network version: %w", err)
|
||||
}
|
||||
|
||||
pp := s.proofType
|
||||
// TODO: Drop after nv19 comes and goes
|
||||
if nv >= network.Version19 {
|
||||
pp, err = pp.ToV1_1PostProof()
|
||||
if err != nil {
|
||||
return bitfield.BitField{}, xerrors.Errorf("failed to convert to v1_1 post proof: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
bad, err := s.faultTracker.CheckProvable(ctx, pp, tocheck, func(ctx context.Context, id abi.SectorID) (cid.Cid, bool, error) {
|
||||
s, ok := sectors[id.Number]
|
||||
if !ok {
|
||||
return cid.Undef, false, xerrors.Errorf("sealed CID not found")
|
||||
@ -407,7 +421,12 @@ func (s *WindowPoStScheduler) runPoStCycle(ctx context.Context, manual bool, di
|
||||
return nil, err
|
||||
}
|
||||
|
||||
postOut, ps, err := s.prover.GenerateWindowPoSt(ctx, abi.ActorID(mid), xsinfos, append(abi.PoStRandomness{}, rand...))
|
||||
ppt, err := xsinfos[0].SealProof.RegisteredWindowPoStProofByNetworkVersion(nv)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to get window post type: %w", err)
|
||||
}
|
||||
|
||||
postOut, ps, err := s.prover.GenerateWindowPoSt(ctx, abi.ActorID(mid), ppt, xsinfos, append(abi.PoStRandomness{}, rand...))
|
||||
elapsed := time.Since(tsStart)
|
||||
log.Infow("computing window post", "batch", batchIdx, "elapsed", elapsed, "skip", len(ps), "err", err)
|
||||
if err != nil {
|
||||
|
@ -125,10 +125,10 @@ func (m *mockProver) GenerateWinningPoSt(context.Context, abi.ActorID, []proofty
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (m *mockProver) GenerateWindowPoSt(ctx context.Context, aid abi.ActorID, sis []prooftypes.ExtendedSectorInfo, pr abi.PoStRandomness) ([]prooftypes.PoStProof, []abi.SectorID, error) {
|
||||
func (m *mockProver) GenerateWindowPoSt(ctx context.Context, aid abi.ActorID, ppt abi.RegisteredPoStProof, sis []prooftypes.ExtendedSectorInfo, pr abi.PoStRandomness) ([]prooftypes.PoStProof, []abi.SectorID, error) {
|
||||
return []prooftypes.PoStProof{
|
||||
{
|
||||
PoStProof: abi.RegisteredPoStProof_StackedDrgWindow2KiBV1,
|
||||
PoStProof: ppt,
|
||||
ProofBytes: []byte("post-proof"),
|
||||
},
|
||||
}, nil, nil
|
||||
|
Loading…
Reference in New Issue
Block a user