Merge branch 'main' into btrfly-calib-all-in-one
This commit is contained in:
commit
17a130d13d
@ -98,6 +98,7 @@ commands:
|
||||
sudo bash install.sh
|
||||
popd
|
||||
rm -rf kubo
|
||||
rm kubo_v0.16.0_linux-amd64.tar.gz
|
||||
git_fetch_all_tags:
|
||||
steps:
|
||||
- run:
|
||||
@ -385,13 +386,13 @@ jobs:
|
||||
- when:
|
||||
condition: << parameters.dry-run >>
|
||||
steps:
|
||||
- run: goreleaser release --rm-dist --snapshot
|
||||
- run: goreleaser release --rm-dist --snapshot --debug
|
||||
- run: ./scripts/generate-checksums.sh
|
||||
- when:
|
||||
condition:
|
||||
not: << parameters.dry-run >>
|
||||
steps:
|
||||
- run: goreleaser release --rm-dist
|
||||
- run: goreleaser release --rm-dist --debug
|
||||
- run: ./scripts/generate-checksums.sh
|
||||
- run: ./scripts/publish-checksums.sh
|
||||
|
||||
@ -834,6 +835,11 @@ workflows:
|
||||
suite: itest-mpool_msg_uuid
|
||||
target: "./itests/mpool_msg_uuid_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-mpool_push_with_uuid
|
||||
suite: itest-mpool_push_with_uuid
|
||||
target: "./itests/mpool_push_with_uuid_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-multisig
|
||||
suite: itest-multisig
|
||||
@ -874,6 +880,11 @@ workflows:
|
||||
suite: itest-pending_deal_allocation
|
||||
target: "./itests/pending_deal_allocation_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-raft_messagesigner
|
||||
suite: itest-raft_messagesigner
|
||||
target: "./itests/raft_messagesigner_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-remove_verifreg_datacap
|
||||
suite: itest-remove_verifreg_datacap
|
||||
@ -934,6 +945,11 @@ workflows:
|
||||
suite: itest-sector_terminate
|
||||
target: "./itests/sector_terminate_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-sector_unseal
|
||||
suite: itest-sector_unseal
|
||||
target: "./itests/sector_unseal_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-self_sent_txn
|
||||
suite: itest-self_sent_txn
|
||||
@ -984,6 +1000,11 @@ workflows:
|
||||
suite: itest-worker
|
||||
target: "./itests/worker_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-worker_upgrade
|
||||
suite: itest-worker_upgrade
|
||||
target: "./itests/worker_upgrade_test.go"
|
||||
|
||||
- test:
|
||||
name: test-unit-cli
|
||||
suite: utest-unit-cli
|
||||
@ -1052,6 +1073,8 @@ workflows:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- release:
|
||||
name: "Release"
|
||||
context:
|
||||
- filecoin-goreleaser-key
|
||||
requires:
|
||||
- "Build ( darwin / amd64 )"
|
||||
- "Build ( linux / amd64 )"
|
||||
@ -1065,6 +1088,8 @@ workflows:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- release:
|
||||
name: "Release (dry-run)"
|
||||
context:
|
||||
- filecoin-goreleaser-key
|
||||
dry-run: true
|
||||
requires:
|
||||
- "Build ( darwin / amd64 )"
|
||||
|
@ -98,6 +98,7 @@ commands:
|
||||
sudo bash install.sh
|
||||
popd
|
||||
rm -rf kubo
|
||||
rm kubo_v0.16.0_linux-amd64.tar.gz
|
||||
git_fetch_all_tags:
|
||||
steps:
|
||||
- run:
|
||||
@ -385,13 +386,13 @@ jobs:
|
||||
- when:
|
||||
condition: << parameters.dry-run >>
|
||||
steps:
|
||||
- run: goreleaser release --rm-dist --snapshot
|
||||
- run: goreleaser release --rm-dist --snapshot --debug
|
||||
- run: ./scripts/generate-checksums.sh
|
||||
- when:
|
||||
condition:
|
||||
not: << parameters.dry-run >>
|
||||
steps:
|
||||
- run: goreleaser release --rm-dist
|
||||
- run: goreleaser release --rm-dist --debug
|
||||
- run: ./scripts/generate-checksums.sh
|
||||
- run: ./scripts/publish-checksums.sh
|
||||
|
||||
@ -757,6 +758,8 @@ workflows:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- release:
|
||||
name: "Release"
|
||||
context:
|
||||
- filecoin-goreleaser-key
|
||||
requires:
|
||||
- "Build ( darwin / amd64 )"
|
||||
- "Build ( linux / amd64 )"
|
||||
@ -770,6 +773,8 @@ workflows:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- release:
|
||||
name: "Release (dry-run)"
|
||||
context:
|
||||
- filecoin-goreleaser-key
|
||||
dry-run: true
|
||||
requires:
|
||||
- "Build ( darwin / amd64 )"
|
||||
|
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
chain/actors/builtin/*/v* linguist-generated=true
|
||||
chain/actors/builtin/*/message* linguist-generated=true
|
@ -13,36 +13,51 @@ universal_binaries:
|
||||
|
||||
builds:
|
||||
- id: lotus
|
||||
binary: lotus
|
||||
builder: prebuilt
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
goamd64:
|
||||
- v1
|
||||
ignore:
|
||||
- goos: linux
|
||||
goarch: arm64
|
||||
prebuilt:
|
||||
path: /tmp/workspace/{{ .Os }}_{{ .Arch }}{{ with .Amd64 }}_{{ . }}{{ end }}/lotus
|
||||
- id: lotus-miner
|
||||
binary: lotus-miner
|
||||
builder: prebuilt
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
goamd64:
|
||||
- v1
|
||||
ignore:
|
||||
- goos: linux
|
||||
goarch: arm64
|
||||
prebuilt:
|
||||
path: /tmp/workspace/{{ .Os }}_{{ .Arch }}{{ with .Amd64 }}_{{ . }}{{ end }}/lotus-miner
|
||||
- id: lotus-worker
|
||||
binary: lotus-worker
|
||||
builder: prebuilt
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
goamd64:
|
||||
- v1
|
||||
ignore:
|
||||
- goos: linux
|
||||
goarch: arm64
|
||||
prebuilt:
|
||||
path: /tmp/workspace/{{ .Os }}_{{ .Arch }}{{ with .Amd64 }}_{{ . }}{{ end }}/lotus-worker
|
||||
|
||||
|
90
CHANGELOG.md
90
CHANGELOG.md
@ -1,29 +1,30 @@
|
||||
# Lotus changelog
|
||||
|
||||
# 1.18.0-rc5 / 2022-11-1
|
||||
# 1.18.0 / 2022-11-15
|
||||
|
||||
> ⚠️ **Please note that from Lotus v1.17.2&^ will require a Go-version of v1.18.1&^**
|
||||
|
||||
This is the fifth release canadiate of the upcoming MANDATORY release of Lotus that introduces [Filecoin network v17,
|
||||
This is the final release of the upcoming MANDATORY release of Lotus that introduces [Filecoin network v17,
|
||||
codenamed the Shark upgrade](https://github.com/filecoin-project/community/discussions/74?sort=top#discussioncomment-3825422). Shark upgrade delivers a wave of protocol refinements that will allow for useful smart contracts to be written using the FVM (eg. programmable markets, lending contracts, etc.).
|
||||
|
||||
A full changelog will be published upon final release.
|
||||
**The Filecoin mainnet is scheduled to upgrade to nv17 at epoch 2383680, on Nov 30th on 2022-11-30T14:00:00Z. All node operators, including storage providers, must upgrade to this release before that time. Storage providers must update their daemons, miners, market and worker(s)/boost.**
|
||||
|
||||
The Shark upgrade introduces the following FIPs, delivered in [actors v9](https://github.com/filecoin-project/specs-actors/releases/tag/v9.0.1):
|
||||
The Shark upgrade introduces the following FIPs, delivered in [actors v9](https://github.com/filecoin-project/builtin-actors/releases/tag/v9.0.3):
|
||||
- [FIP0029 Beneficiary Address for Storage Providers](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0029.md): step towards better lending market for SP
|
||||
- [FIP0034 Fix PreCommit Deposit Independent of Sector Content](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0034.md): resolves a significant weakening of Filecoin PoRep’s security guarantees
|
||||
- ❗Pre-commit deposit will be calculated as the 20-day projection of expected reward earned by a sector with a sector quality of 10 (i.e. full of verified deals), regardless of sector content. Leave the initial pledge value, due when the sector is proven, unchanged.
|
||||
- ❗Pre-commit deposit will be calculated as the 20-day projection of expected reward earned by a sector with **a sector quality of 10 (i.e. full of verified deals)**, regardless of sector content. The Initial Pledge value, due when the sector is proven, is left **unchanged**.
|
||||
- [FIP0041 Forward Compatibility for PreCommit](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0041.md): enables a cleaner and easier transition to Programmable Storage Markets
|
||||
- [FIP0044 Standard Message Authentication](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0044.md): enable metadata authentication for user defined actor
|
||||
- [FIP0045 Decoupling Fil+ from Marketplace](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0045.md): DataCap and the QAP it brings is now associated with DATA. DataCap for the data many have terms where anyone who cares about that piece of data may extend the term, which incentives SPs to store the data longer on the network
|
||||
- HUGE step towards user programmable storage market
|
||||
- ⭐️ First Fungible Token Contract - Datacap Actor, on Filecoin! ([fungible token standard](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0046.md), [token contract library](https://github.com/helix-onchain/filecoin/tree/5455f4f831e0f3f20005a9a789623d7ad6dada15/frc46_token))
|
||||
|
||||
|
||||
## Calibration-net Upgrade
|
||||
|
||||
This release candidate sets the calibration-net upgrade at epoch 16800. The bundle the network will be using is [v9.0.3](https://github.com/filecoin-project/builtin-actors/releases/tag/v9.0.3)(located at `build/actors/v9.tar.zst` ). Upon the migration, the manifest CID should be `bafy2bzacedbedgynklc4dgpyxippkxmba2mgtw7ecntoneclsvvl4klqwuyyy`.
|
||||
|
||||
- [FIP0045 Decoupling Fil+ from Marketplace](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0045.md): DataCap and the 10x QAP is now only associated with how long DATA is wanted to be stored on the network.
|
||||
- This is a transitional state to enabling far more efficient and dynamic storage markets on Filecoin network in the future.
|
||||
- ⭐️ First Fungible Token Contract - Datacap Actor, on Filecoin! ([fungible token standard](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0046.md), [token contract library](https://github.com/helix-onchain/filecoin/tree/5455f4f831e0f3f20005a9a789623d7ad6dada15/frc46_token)).
|
||||
- For storage deal participants (clients and storage providers):
|
||||
- `PublishStorageDeals`/`ProveCommit(Aggregate)`/`ProveReplicaUpdates` message that includes verified deals will see a gas usage increase, more details can be found [here](https://github.com/filecoin-project/FIPs/blob/385f069b3b146c5fef4fdc1109a0e2f35f399e48/FIPS/fip-0045.md?plain=1#L784)
|
||||
- `Term` is introduced for defining how long the DataCap is assigned to a piece of data. Anyone who cares about that piece of data may extend the _term_, which incentives SPs to store the data longer on the network without a new deal/resealing.
|
||||
- There is no more diluted verified deal QAP due to deal/sector space time for new sectors that contains verified deals after this upgrade.
|
||||
- SPs may enjoy 90 days of extra QAP than deal duration by default, given `term_max` is always `deal duration + 90 days`.
|
||||
❗ We highly recommend all lotus users, especially storage providers, developers and clients to read the FIPs in detail to understand the protocol changes and potential impact to network participants!
|
||||
|
||||
## Snapshots
|
||||
|
||||
The [#fil-infra](https://filecoinproject.slack.com/archives/C039RBG3RPC) team at PL has launched a brand new Lightweight Filecoin Chain Snapshots Service to support chain management needs for the node operators, check [here](https://www.notion.so/pl-strflt/Lightweight-Filecoin-Chain-Snapshots-17e4c386f35c44548f5863afb7b5e024) for the full detail.
|
||||
@ -31,7 +32,34 @@ We are planning to switch [the snapshot service listed in lotus docs](https://lo
|
||||
|
||||
## Migration
|
||||
|
||||
(TBC)
|
||||
We are expecting a heavier than normal state migration for this upgrade due to the amount of the state changes introduced.
|
||||
All node operators, including storage providers, should be aware that two pre-migrations are being scheduled. The first pre-migration will begin at 2022-11-30T12:00:00Z (120 minutes before the real upgrade), the second pre-migration will begin at 2022-11-30T13:45:00Z (7.5 minutes before the real upgrade).
|
||||
The first pre-migration will take up to 1.5hr, depending on the amount of the historical state in the node blockstore and the hardware specs the node is running on. During this time, expect slower block validation times, increased CPU and memory usage, and longer delays for API queries.
|
||||
We recommend node operators (who haven't enbabled splistore `universal` mode) that do not care about historical chain states, to prune the chain blockstore by syncing from a snapshot 1-2 days before the upgrade.
|
||||
Note to full archival node operators: you may expect a migration that takes up to 20 min upon the upgrade, during this period your node will fall out of sync and your chain service may have some disruption. However, you can expect the node to catch up soon after the migration completes.
|
||||
|
||||
### v9 Built-in actor bundles
|
||||
|
||||
Bundles for all networks(mainnet, calibnet, and etc) are included in the lotus source tree (`build/actors/`) and embedded on build, for v9 actors you can find it [here](https://github.com/filecoin-project/lotus/blob/master/build/actors/v9.tar.zst).
|
||||
Reminder: Lotus verifies that the bundle CIDs are the right ones upon build & upgrade against the values in `build/builtin_actors_gen.go`, according to the network you are building. You may also check the bundle manifest CID matches the bundle gen-ed values by running `lotus state actor-cids --network-version 17`.
|
||||
|
||||
The manifest CID & full list of actor code CIDs for nv17 using [actor v9](https://github.com/filecoin-project/builtin-actors/releases/tag/v9.0.3) is:
|
||||
|
||||
```
|
||||
"_manifest": "bafy2bzaceb6j6666h36xnhksu3ww4kxb6e25niayfgkdnifaqi6m6ooc66i6i"
|
||||
"account": "bafk2bzacect2p7urje3pylrrrjy3tngn6yaih4gtzauuatf2jllk3ksgfiw2y"
|
||||
"cron": "bafk2bzacebcec3lffmos3nawm5cvwehssxeqwxixoyyfvejy7viszzsxzyu26"
|
||||
"datacap": "bafk2bzacebb6uy2ys7tapekmtj7apnjg7oyj4ia5t7tlkvbmwtxwv74lb2pug"
|
||||
"init": "bafk2bzacebtdq4zyuxk2fzbdkva6kc4mx75mkbfmldplfntayhbl5wkqou33i"
|
||||
"multisig": "bafk2bzacec4va3nmugyqjqrs3lqyr2ij67jhjia5frvx7omnh2isha6abxzya"
|
||||
"paymentchannel": "bafk2bzacebhdvjbjcgupklddfavzef4e4gnkt3xk3rbmgfmk7xhecszhfxeds"
|
||||
"reward": "bafk2bzacebezgbbmcm2gbcqwisus5fjvpj7hhmu5ubd37phuku3hmkfulxm2o"
|
||||
"storagemarket": "bafk2bzacec3j7p6gklk64stax5px3xxd7hdtejaepnd4nw7s2adihde6emkcu"
|
||||
"storageminer": "bafk2bzacedyux5hlrildwutvvjdcsvjtwsoc5xnqdjl73ouiukgklekeuyfl4"
|
||||
"storagepower": "bafk2bzacedsetphfajgne4qy3vdrpyd6ekcmtfs2zkjut4r34cvnuoqemdrtw"
|
||||
"system": "bafk2bzaceagvlo2jtahj7dloshrmwfulrd6e2izqev32qm46eumf754weec6c"
|
||||
"verifiedregistry": "bafk2bzacecf3yodlyudzukumehbuabgqljyhjt5ifiv4vetcfohnvsxzynwga"
|
||||
```
|
||||
|
||||
## New Features
|
||||
- Integrate actor v9:
|
||||
@ -61,7 +89,6 @@ We are planning to switch [the snapshot service listed in lotus docs](https://lo
|
||||
- github.com/filecoin-project/go-jsonrpc (v0.1.7 -> v0.1.8)
|
||||
- github.com/filecoin-project/go-state-types (v0.1.12-beta -> v0.9.0):
|
||||
|
||||
|
||||
## Others
|
||||
- fix: upgrade: no splash banner for nv17 :( ([filecoin-project/lotus#9486](https://github.com/filecoin-project/lotus/pull/9486))
|
||||
- chore: build: add calib upgrade param for shark ([filecoin-project/lotus#9483](https://github.com/filecoin-project/lotus/pull/9483))
|
||||
@ -70,22 +97,35 @@ We are planning to switch [the snapshot service listed in lotus docs](https://lo
|
||||
- Delete lotus-pond (#9352) ([filecoin-project/lotus#9352](https://github.com/filecoin-project/lotus/pull/9352))
|
||||
- build: set version to v1.18.0-dev
|
||||
|
||||
## lotus-market EOL notice
|
||||
|
||||
As mentioned in [lotus v1.17.0 release notes](https://github.com/filecoin-project/lotus/releases/tag/v1.17.0), markets related features, enhancements and fixes is now lower priority for Lotus. We recommend our users to migrate to other deal making focused software, like [boost](https://boost.filecoin.io/) as soon as possible. That being said, the lotus maintainers will be:
|
||||
- Lotus maintainers will stop supporting lotus-market subcomponent/**storage** deal making related issues or enhancements on Jan 31, 2023.
|
||||
- In Q2 2023, we will be deprecating/removing lotus-market related code from this repository.
|
||||
If you have any questions or concerns, please raise them in [Lotus discussion](https://github.com/filecoin-project/lotus/discussions/categories/market)!
|
||||
|
||||
|
||||
## Contributors
|
||||
|
||||
| Contributor | Commits | Lines ± | Files Changed |
|
||||
|-------------|---------|---------|---------------|
|
||||
| Geoff Stuart | 51 | +8677/-19320 | 401 |
|
||||
| Aayush Rajasekaran | 5 | +1452/-166 | 34 |
|
||||
| Łukasz Magiera | 5 | +429/-135 | 45 |
|
||||
| Aayush | 19 | +281/-157 | 72 |
|
||||
| Shrenuj Bansal | 3 | +176/-61 | 10 |
|
||||
| Jennifer Wang | 7 | +19/-18 | 15 |
|
||||
| simlecode | 1 | +5/-5 | 4 |
|
||||
| @geoff-vball | 73 | +14533/-19712 | 509 |
|
||||
| @arajasek | 16 | +2230/-303 | 49 |
|
||||
| @arajasek | 29 | +701/-297 | 117 |
|
||||
| @magik6k | 5 | +429/-135 | 45 |
|
||||
| @Frrist | 1 | +246/-203 | 25 |
|
||||
| @stebalien | 2 | +323/-2 | 6 |
|
||||
| @shrenujbansal | 3 | +176/-61 | 10 |
|
||||
| @ZenGround0 | 2 | +78/-38 | 5 |
|
||||
| @jennijuju | 8 | +97/-18 | 16 |
|
||||
| @simlecode | 5 | +18/-9 | 11 |
|
||||
| Kevin Li | 1 | +7/-0 | 1 |
|
||||
| @zenground0 | 2 | +3/-3 | 3 |
|
||||
| @jennijuju | 1 | +3/-3 | 2 |
|
||||
| Rod Vagg | 1 | +3/-2 | 2 |
|
||||
| @jennijuju | 1 | +2/-2 | 2 |
|
||||
| Peter Rabbitson | 1 | +3/-0 | 1 |
|
||||
| ZenGround0 | 1 | +2/-0 | 1 |
|
||||
|
||||
| Jakub Sztandera | 1 | +1/-1 | 1 |
|
||||
|
||||
# v1.17.2 / 2022-10-05
|
||||
|
||||
|
@ -764,6 +764,9 @@ type FullNode interface {
|
||||
// LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that
|
||||
// the path specified when calling CreateBackup is within the base path
|
||||
CreateBackup(ctx context.Context, fpath string) error //perm:admin
|
||||
|
||||
RaftState(ctx context.Context) (*RaftStateData, error) //perm:read
|
||||
RaftLeader(ctx context.Context) (peer.ID, error) //perm:read
|
||||
}
|
||||
|
||||
type StorageAsk struct {
|
||||
|
@ -320,7 +320,7 @@ type StorageMiner interface {
|
||||
// the path specified when calling CreateBackup is within the base path
|
||||
CreateBackup(ctx context.Context, fpath string) error //perm:admin
|
||||
|
||||
CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storiface.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) //perm:admin
|
||||
CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storiface.SectorRef) (map[abi.SectorNumber]string, error) //perm:admin
|
||||
|
||||
ComputeProof(ctx context.Context, ssi []builtin.ExtendedSectorInfo, rand abi.PoStRandomness, poStEpoch abi.ChainEpoch, nv abinetwork.Version) ([]builtin.PoStProof, error) //perm:read
|
||||
|
||||
@ -417,6 +417,10 @@ func (st *SealSeed) Equals(ost *SealSeed) bool {
|
||||
|
||||
type SectorState string
|
||||
|
||||
func (s *SectorState) String() string {
|
||||
return string(*s)
|
||||
}
|
||||
|
||||
type AddrUse int
|
||||
|
||||
const (
|
||||
|
@ -39,13 +39,13 @@ type Worker interface {
|
||||
SealPreCommit2(ctx context.Context, sector storiface.SectorRef, pc1o storiface.PreCommit1Out) (storiface.CallID, error) //perm:admin
|
||||
SealCommit1(ctx context.Context, sector storiface.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storiface.SectorCids) (storiface.CallID, error) //perm:admin
|
||||
SealCommit2(ctx context.Context, sector storiface.SectorRef, c1o storiface.Commit1Out) (storiface.CallID, error) //perm:admin
|
||||
FinalizeSector(ctx context.Context, sector storiface.SectorRef, keepUnsealed []storiface.Range) (storiface.CallID, error) //perm:admin
|
||||
FinalizeReplicaUpdate(ctx context.Context, sector storiface.SectorRef, keepUnsealed []storiface.Range) (storiface.CallID, error) //perm:admin
|
||||
FinalizeSector(ctx context.Context, sector storiface.SectorRef) (storiface.CallID, error) //perm:admin
|
||||
FinalizeReplicaUpdate(ctx context.Context, sector storiface.SectorRef) (storiface.CallID, error) //perm:admin
|
||||
ReplicaUpdate(ctx context.Context, sector storiface.SectorRef, pieces []abi.PieceInfo) (storiface.CallID, error) //perm:admin
|
||||
ProveReplicaUpdate1(ctx context.Context, sector storiface.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid) (storiface.CallID, error) //perm:admin
|
||||
ProveReplicaUpdate2(ctx context.Context, sector storiface.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid, vanillaProofs storiface.ReplicaVanillaProofs) (storiface.CallID, error) //perm:admin
|
||||
GenerateSectorKeyFromData(ctx context.Context, sector storiface.SectorRef, commD cid.Cid) (storiface.CallID, error) //perm:admin
|
||||
ReleaseUnsealed(ctx context.Context, sector storiface.SectorRef, safeToFree []storiface.Range) (storiface.CallID, error) //perm:admin
|
||||
ReleaseUnsealed(ctx context.Context, sector storiface.SectorRef, keepUnsealed []storiface.Range) (storiface.CallID, error) //perm:admin
|
||||
MoveStorage(ctx context.Context, sector storiface.SectorRef, types storiface.SectorFileType) (storiface.CallID, error) //perm:admin
|
||||
UnsealPiece(context.Context, storiface.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (storiface.CallID, error) //perm:admin
|
||||
Fetch(context.Context, storiface.SectorRef, storiface.SectorFileType, storiface.PathType, storiface.AcquireMode) (storiface.CallID, error) //perm:admin
|
||||
|
@ -349,6 +349,10 @@ func init() {
|
||||
addExample(map[string]bitfield.BitField{
|
||||
"": bitfield.NewFromSet([]uint64{5, 6, 7, 10}),
|
||||
})
|
||||
addExample(&api.RaftStateData{
|
||||
NonceMap: make(map[address.Address]uint64),
|
||||
MsgUuids: make(map[uuid.UUID]*types.SignedMessage),
|
||||
})
|
||||
|
||||
addExample(http.Header{
|
||||
"Authorization": []string{"Bearer ey.."},
|
||||
|
@ -2244,6 +2244,36 @@ func (mr *MockFullNodeMockRecorder) PaychVoucherSubmit(arg0, arg1, arg2, arg3, a
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherSubmit", reflect.TypeOf((*MockFullNode)(nil).PaychVoucherSubmit), arg0, arg1, arg2, arg3, arg4)
|
||||
}
|
||||
|
||||
// RaftLeader mocks base method.
|
||||
func (m *MockFullNode) RaftLeader(arg0 context.Context) (peer.ID, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "RaftLeader", arg0)
|
||||
ret0, _ := ret[0].(peer.ID)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// RaftLeader indicates an expected call of RaftLeader.
|
||||
func (mr *MockFullNodeMockRecorder) RaftLeader(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RaftLeader", reflect.TypeOf((*MockFullNode)(nil).RaftLeader), arg0)
|
||||
}
|
||||
|
||||
// RaftState mocks base method.
|
||||
func (m *MockFullNode) RaftState(arg0 context.Context) (*api.RaftStateData, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "RaftState", arg0)
|
||||
ret0, _ := ret[0].(*api.RaftStateData)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// RaftState indicates an expected call of RaftState.
|
||||
func (mr *MockFullNodeMockRecorder) RaftState(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RaftState", reflect.TypeOf((*MockFullNode)(nil).RaftState), arg0)
|
||||
}
|
||||
|
||||
// Session mocks base method.
|
||||
func (m *MockFullNode) Session(arg0 context.Context) (uuid.UUID, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
@ -342,6 +342,10 @@ type FullNodeStruct struct {
|
||||
|
||||
PaychVoucherSubmit func(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (cid.Cid, error) `perm:"sign"`
|
||||
|
||||
RaftLeader func(p0 context.Context) (peer.ID, error) `perm:"read"`
|
||||
|
||||
RaftState func(p0 context.Context) (*RaftStateData, error) `perm:"read"`
|
||||
|
||||
StateAccountKey func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `perm:"read"`
|
||||
|
||||
StateActorCodeCIDs func(p0 context.Context, p1 abinetwork.Version) (map[string]cid.Cid, error) `perm:"read"`
|
||||
@ -679,7 +683,7 @@ type StorageMinerStruct struct {
|
||||
|
||||
BeneficiaryWithdrawBalance func(p0 context.Context, p1 abi.TokenAmount) (cid.Cid, error) `perm:"admin"`
|
||||
|
||||
CheckProvable func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storiface.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) `perm:"admin"`
|
||||
CheckProvable func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storiface.SectorRef) (map[abi.SectorNumber]string, error) `perm:"admin"`
|
||||
|
||||
ComputeDataCid func(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storiface.Data) (abi.PieceInfo, error) `perm:"admin"`
|
||||
|
||||
@ -974,9 +978,9 @@ type WorkerStruct struct {
|
||||
|
||||
Fetch func(p0 context.Context, p1 storiface.SectorRef, p2 storiface.SectorFileType, p3 storiface.PathType, p4 storiface.AcquireMode) (storiface.CallID, error) `perm:"admin"`
|
||||
|
||||
FinalizeReplicaUpdate func(p0 context.Context, p1 storiface.SectorRef, p2 []storiface.Range) (storiface.CallID, error) `perm:"admin"`
|
||||
FinalizeReplicaUpdate func(p0 context.Context, p1 storiface.SectorRef) (storiface.CallID, error) `perm:"admin"`
|
||||
|
||||
FinalizeSector func(p0 context.Context, p1 storiface.SectorRef, p2 []storiface.Range) (storiface.CallID, error) `perm:"admin"`
|
||||
FinalizeSector func(p0 context.Context, p1 storiface.SectorRef) (storiface.CallID, error) `perm:"admin"`
|
||||
|
||||
GenerateSectorKeyFromData func(p0 context.Context, p1 storiface.SectorRef, p2 cid.Cid) (storiface.CallID, error) `perm:"admin"`
|
||||
|
||||
@ -2473,6 +2477,28 @@ func (s *FullNodeStub) PaychVoucherSubmit(p0 context.Context, p1 address.Address
|
||||
return *new(cid.Cid), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) RaftLeader(p0 context.Context) (peer.ID, error) {
|
||||
if s.Internal.RaftLeader == nil {
|
||||
return *new(peer.ID), ErrNotSupported
|
||||
}
|
||||
return s.Internal.RaftLeader(p0)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) RaftLeader(p0 context.Context) (peer.ID, error) {
|
||||
return *new(peer.ID), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) RaftState(p0 context.Context) (*RaftStateData, error) {
|
||||
if s.Internal.RaftState == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.RaftState(p0)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) RaftState(p0 context.Context) (*RaftStateData, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
|
||||
if s.Internal.StateAccountKey == nil {
|
||||
return *new(address.Address), ErrNotSupported
|
||||
@ -4134,14 +4160,14 @@ func (s *StorageMinerStub) BeneficiaryWithdrawBalance(p0 context.Context, p1 abi
|
||||
return *new(cid.Cid), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storiface.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) {
|
||||
func (s *StorageMinerStruct) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storiface.SectorRef) (map[abi.SectorNumber]string, error) {
|
||||
if s.Internal.CheckProvable == nil {
|
||||
return *new(map[abi.SectorNumber]string), ErrNotSupported
|
||||
}
|
||||
return s.Internal.CheckProvable(p0, p1, p2, p3)
|
||||
return s.Internal.CheckProvable(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storiface.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) {
|
||||
func (s *StorageMinerStub) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storiface.SectorRef) (map[abi.SectorNumber]string, error) {
|
||||
return *new(map[abi.SectorNumber]string), ErrNotSupported
|
||||
}
|
||||
|
||||
@ -5663,25 +5689,25 @@ func (s *WorkerStub) Fetch(p0 context.Context, p1 storiface.SectorRef, p2 storif
|
||||
return *new(storiface.CallID), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *WorkerStruct) FinalizeReplicaUpdate(p0 context.Context, p1 storiface.SectorRef, p2 []storiface.Range) (storiface.CallID, error) {
|
||||
func (s *WorkerStruct) FinalizeReplicaUpdate(p0 context.Context, p1 storiface.SectorRef) (storiface.CallID, error) {
|
||||
if s.Internal.FinalizeReplicaUpdate == nil {
|
||||
return *new(storiface.CallID), ErrNotSupported
|
||||
}
|
||||
return s.Internal.FinalizeReplicaUpdate(p0, p1, p2)
|
||||
return s.Internal.FinalizeReplicaUpdate(p0, p1)
|
||||
}
|
||||
|
||||
func (s *WorkerStub) FinalizeReplicaUpdate(p0 context.Context, p1 storiface.SectorRef, p2 []storiface.Range) (storiface.CallID, error) {
|
||||
func (s *WorkerStub) FinalizeReplicaUpdate(p0 context.Context, p1 storiface.SectorRef) (storiface.CallID, error) {
|
||||
return *new(storiface.CallID), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *WorkerStruct) FinalizeSector(p0 context.Context, p1 storiface.SectorRef, p2 []storiface.Range) (storiface.CallID, error) {
|
||||
func (s *WorkerStruct) FinalizeSector(p0 context.Context, p1 storiface.SectorRef) (storiface.CallID, error) {
|
||||
if s.Internal.FinalizeSector == nil {
|
||||
return *new(storiface.CallID), ErrNotSupported
|
||||
}
|
||||
return s.Internal.FinalizeSector(p0, p1, p2)
|
||||
return s.Internal.FinalizeSector(p0, p1)
|
||||
}
|
||||
|
||||
func (s *WorkerStub) FinalizeSector(p0 context.Context, p1 storiface.SectorRef, p2 []storiface.Range) (storiface.CallID, error) {
|
||||
func (s *WorkerStub) FinalizeSector(p0 context.Context, p1 storiface.SectorRef) (storiface.CallID, error) {
|
||||
return *new(storiface.CallID), ErrNotSupported
|
||||
}
|
||||
|
||||
|
63
api/types.go
63
api/types.go
@ -59,6 +59,11 @@ type MessageSendSpec struct {
|
||||
MsgUuid uuid.UUID
|
||||
}
|
||||
|
||||
type MpoolMessageWhole struct {
|
||||
Msg *types.Message
|
||||
Spec *MessageSendSpec
|
||||
}
|
||||
|
||||
// GraphSyncDataTransfer provides diagnostics on a data transfer happening over graphsync
|
||||
type GraphSyncDataTransfer struct {
|
||||
// GraphSync request id for this transfer
|
||||
@ -334,3 +339,61 @@ type ForkUpgradeParams struct {
|
||||
UpgradeSkyrHeight abi.ChainEpoch
|
||||
UpgradeSharkHeight abi.ChainEpoch
|
||||
}
|
||||
|
||||
type NonceMapType map[address.Address]uint64
|
||||
type MsgUuidMapType map[uuid.UUID]*types.SignedMessage
|
||||
|
||||
type RaftStateData struct {
|
||||
NonceMap NonceMapType
|
||||
MsgUuids MsgUuidMapType
|
||||
}
|
||||
|
||||
func (n *NonceMapType) MarshalJSON() ([]byte, error) {
|
||||
marshalled := make(map[string]uint64)
|
||||
for a, n := range *n {
|
||||
marshalled[a.String()] = n
|
||||
}
|
||||
return json.Marshal(marshalled)
|
||||
}
|
||||
|
||||
func (n *NonceMapType) UnmarshalJSON(b []byte) error {
|
||||
unmarshalled := make(map[string]uint64)
|
||||
err := json.Unmarshal(b, &unmarshalled)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*n = make(map[address.Address]uint64)
|
||||
for saddr, nonce := range unmarshalled {
|
||||
a, err := address.NewFromString(saddr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
(*n)[a] = nonce
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MsgUuidMapType) MarshalJSON() ([]byte, error) {
|
||||
marshalled := make(map[string]*types.SignedMessage)
|
||||
for u, msg := range *m {
|
||||
marshalled[u.String()] = msg
|
||||
}
|
||||
return json.Marshal(marshalled)
|
||||
}
|
||||
|
||||
func (m *MsgUuidMapType) UnmarshalJSON(b []byte) error {
|
||||
unmarshalled := make(map[string]*types.SignedMessage)
|
||||
err := json.Unmarshal(b, &unmarshalled)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*m = make(map[uuid.UUID]*types.SignedMessage)
|
||||
for suid, msg := range unmarshalled {
|
||||
u, err := uuid.Parse(suid)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
(*m)[u] = msg
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ var (
|
||||
FullAPIVersion1 = newVer(2, 3, 0)
|
||||
|
||||
MinerAPIVersion0 = newVer(1, 5, 0)
|
||||
WorkerAPIVersion0 = newVer(1, 6, 0)
|
||||
WorkerAPIVersion0 = newVer(1, 7, 0)
|
||||
)
|
||||
|
||||
//nolint:varcheck,deadcode
|
||||
|
@ -21,16 +21,18 @@ func TestEmbeddedMetadata(t *testing.T) {
|
||||
|
||||
// Test that we're registering the manifest correctly.
|
||||
func TestRegistration(t *testing.T) {
|
||||
manifestCid, found := actors.GetManifest(actorstypes.Version9)
|
||||
require.True(t, found)
|
||||
require.True(t, manifestCid.Defined())
|
||||
for _, av := range []actorstypes.Version{actorstypes.Version8, actorstypes.Version9} {
|
||||
manifestCid, found := actors.GetManifest(av)
|
||||
require.True(t, found)
|
||||
require.True(t, manifestCid.Defined())
|
||||
|
||||
for _, key := range actors.GetBuiltinActorsKeys(actorstypes.Version9) {
|
||||
actorCid, found := actors.GetActorCodeID(actorstypes.Version9, key)
|
||||
require.True(t, found)
|
||||
name, version, found := actors.GetActorMetaByCode(actorCid)
|
||||
require.True(t, found)
|
||||
require.Equal(t, actorstypes.Version9, version)
|
||||
require.Equal(t, key, name)
|
||||
for _, key := range actors.GetBuiltinActorsKeys(av) {
|
||||
actorCid, found := actors.GetActorCodeID(av, key)
|
||||
require.True(t, found)
|
||||
name, version, found := actors.GetActorMetaByCode(actorCid)
|
||||
require.True(t, found)
|
||||
require.Equal(t, av, version)
|
||||
require.Equal(t, key, name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,10 @@ var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{
|
||||
ChainInfoJSON: `{"public_key":"8cda589f88914aa728fd183f383980b35789ce81b274e5daee1f338b77d02566ef4d3fb0098af1f844f10f9c803c1827","period":25,"genesis_time":1595348225,"hash":"e73b7dc3c4f6a236378220c0dd6aa110eb16eed26c11259606e07ee122838d4f","groupHash":"567d4785122a5a3e75a9bc9911d7ea807dd85ff76b78dc4ff06b075712898607"}`,
|
||||
},
|
||||
DrandIncentinet: {
|
||||
Servers: []string{
|
||||
"https://dev1.drand.sh",
|
||||
"https://dev2.drand.sh",
|
||||
},
|
||||
ChainInfoJSON: `{"public_key":"8cad0c72c606ab27d36ee06de1d5b2db1faf92e447025ca37575ab3a8aac2eaae83192f846fc9e158bc738423753d000","period":30,"genesis_time":1595873820,"hash":"80c8b872c714f4c00fdd3daa465d5514049f457f01f85a4caf68cdcd394ba039","groupHash":"d9406aaed487f7af71851b4399448e311f2328923d454e971536c05398ce2d9b"}`,
|
||||
},
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -79,14 +79,14 @@ const UpgradeOhSnapHeight = 1594680
|
||||
// 2022-07-06T14:00:00Z
|
||||
const UpgradeSkyrHeight = 1960320
|
||||
|
||||
var UpgradeSharkHeight = abi.ChainEpoch(99999999999999)
|
||||
// 2022-11-30T14:00:00Z
|
||||
var UpgradeSharkHeight = abi.ChainEpoch(2383680)
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
}
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(10 << 40)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(150)
|
||||
var PropagationDelaySecs = uint64(10)
|
||||
|
||||
|
@ -37,7 +37,7 @@ func BuildTypeString() string {
|
||||
}
|
||||
|
||||
// BuildVersion is the local build version
|
||||
const BuildVersion = "1.19.0-dev"
|
||||
const BuildVersion = "1.19.1-dev"
|
||||
|
||||
func UserVersion() string {
|
||||
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
@ -104,6 +105,24 @@ func MakeState(store adt.Store, av actorstypes.Version, addr address.Address) (S
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
PubkeyAddress() (address.Address, error)
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{
|
||||
(&state0{}).Code(),
|
||||
(&state2{}).Code(),
|
||||
(&state3{}).Code(),
|
||||
(&state4{}).Code(),
|
||||
(&state5{}).Code(),
|
||||
(&state6{}).Code(),
|
||||
(&state7{}).Code(),
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"golang.org/x/xerrors"
|
||||
@ -62,6 +63,17 @@ func MakeState(store adt.Store, av actorstypes.Version, addr address.Address) (S
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
PubkeyAddress() (address.Address, error)
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{ {{range .versions}}
|
||||
(&state{{.}}{}).Code(),
|
||||
{{- end}}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,14 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
|
||||
{{if (le .v 7)}}
|
||||
account{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/account"
|
||||
@ -41,4 +45,21 @@ func (s *state{{.v}}) PubkeyAddress() (address.Address, error) {
|
||||
|
||||
func (s *state{{.v}}) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorKey() string {
|
||||
return actors.AccountKey
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version{{.v}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) 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
|
||||
}
|
21
chain/actors/builtin/account/v0.go
generated
21
chain/actors/builtin/account/v0.go
generated
@ -1,11 +1,15 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
account0 "github.com/filecoin-project/specs-actors/actors/builtin/account"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -38,3 +42,20 @@ func (s *state0) PubkeyAddress() (address.Address, error) {
|
||||
func (s *state0) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state0) ActorKey() string {
|
||||
return actors.AccountKey
|
||||
}
|
||||
|
||||
func (s *state0) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version0
|
||||
}
|
||||
|
||||
func (s *state0) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/account/v2.go
generated
21
chain/actors/builtin/account/v2.go
generated
@ -1,11 +1,15 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
account2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/account"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -38,3 +42,20 @@ func (s *state2) PubkeyAddress() (address.Address, error) {
|
||||
func (s *state2) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state2) ActorKey() string {
|
||||
return actors.AccountKey
|
||||
}
|
||||
|
||||
func (s *state2) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version2
|
||||
}
|
||||
|
||||
func (s *state2) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/account/v3.go
generated
21
chain/actors/builtin/account/v3.go
generated
@ -1,11 +1,15 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
account3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/account"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -38,3 +42,20 @@ func (s *state3) PubkeyAddress() (address.Address, error) {
|
||||
func (s *state3) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state3) ActorKey() string {
|
||||
return actors.AccountKey
|
||||
}
|
||||
|
||||
func (s *state3) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version3
|
||||
}
|
||||
|
||||
func (s *state3) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/account/v4.go
generated
21
chain/actors/builtin/account/v4.go
generated
@ -1,11 +1,15 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
account4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/account"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -38,3 +42,20 @@ func (s *state4) PubkeyAddress() (address.Address, error) {
|
||||
func (s *state4) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state4) ActorKey() string {
|
||||
return actors.AccountKey
|
||||
}
|
||||
|
||||
func (s *state4) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version4
|
||||
}
|
||||
|
||||
func (s *state4) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/account/v5.go
generated
21
chain/actors/builtin/account/v5.go
generated
@ -1,11 +1,15 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
account5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/account"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -38,3 +42,20 @@ func (s *state5) PubkeyAddress() (address.Address, error) {
|
||||
func (s *state5) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state5) ActorKey() string {
|
||||
return actors.AccountKey
|
||||
}
|
||||
|
||||
func (s *state5) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version5
|
||||
}
|
||||
|
||||
func (s *state5) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/account/v6.go
generated
21
chain/actors/builtin/account/v6.go
generated
@ -1,11 +1,15 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
account6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/account"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -38,3 +42,20 @@ func (s *state6) PubkeyAddress() (address.Address, error) {
|
||||
func (s *state6) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state6) ActorKey() string {
|
||||
return actors.AccountKey
|
||||
}
|
||||
|
||||
func (s *state6) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version6
|
||||
}
|
||||
|
||||
func (s *state6) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/account/v7.go
generated
21
chain/actors/builtin/account/v7.go
generated
@ -1,11 +1,15 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
account7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/account"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -38,3 +42,20 @@ func (s *state7) PubkeyAddress() (address.Address, error) {
|
||||
func (s *state7) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state7) ActorKey() string {
|
||||
return actors.AccountKey
|
||||
}
|
||||
|
||||
func (s *state7) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version7
|
||||
}
|
||||
|
||||
func (s *state7) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/account/v8.go
generated
21
chain/actors/builtin/account/v8.go
generated
@ -1,11 +1,15 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
account8 "github.com/filecoin-project/go-state-types/builtin/v8/account"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -38,3 +42,20 @@ func (s *state8) PubkeyAddress() (address.Address, error) {
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state8) ActorKey() string {
|
||||
return actors.AccountKey
|
||||
}
|
||||
|
||||
func (s *state8) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version8
|
||||
}
|
||||
|
||||
func (s *state8) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/account/v9.go
generated
21
chain/actors/builtin/account/v9.go
generated
@ -1,11 +1,15 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
account9 "github.com/filecoin-project/go-state-types/builtin/v9/account"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -38,3 +42,20 @@ func (s *state9) PubkeyAddress() (address.Address, error) {
|
||||
func (s *state9) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state9) ActorKey() string {
|
||||
return actors.AccountKey
|
||||
}
|
||||
|
||||
func (s *state9) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version9
|
||||
}
|
||||
|
||||
func (s *state9) 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
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
@ -60,5 +61,16 @@ var (
|
||||
|
||||
|
||||
type State interface {
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{ {{range .versions}}
|
||||
(&state{{.}}{}).Code(),
|
||||
{{- end}}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
@ -103,5 +104,23 @@ var (
|
||||
)
|
||||
|
||||
type State interface {
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{
|
||||
(&state0{}).Code(),
|
||||
(&state2{}).Code(),
|
||||
(&state3{}).Code(),
|
||||
(&state4{}).Code(),
|
||||
(&state5{}).Code(),
|
||||
(&state6{}).Code(),
|
||||
(&state7{}).Code(),
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
|
||||
{{if (le .v 7)}}
|
||||
cron{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/cron"
|
||||
@ -36,4 +39,21 @@ type state{{.v}} struct {
|
||||
|
||||
func (s *state{{.v}}) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorKey() string {
|
||||
return actors.CronKey
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version{{.v}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/cron/v0.go
generated
21
chain/actors/builtin/cron/v0.go
generated
@ -1,10 +1,14 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
cron0 "github.com/filecoin-project/specs-actors/actors/builtin/cron"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -33,3 +37,20 @@ type state0 struct {
|
||||
func (s *state0) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state0) ActorKey() string {
|
||||
return actors.CronKey
|
||||
}
|
||||
|
||||
func (s *state0) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version0
|
||||
}
|
||||
|
||||
func (s *state0) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/cron/v2.go
generated
21
chain/actors/builtin/cron/v2.go
generated
@ -1,10 +1,14 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
cron2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/cron"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -33,3 +37,20 @@ type state2 struct {
|
||||
func (s *state2) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state2) ActorKey() string {
|
||||
return actors.CronKey
|
||||
}
|
||||
|
||||
func (s *state2) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version2
|
||||
}
|
||||
|
||||
func (s *state2) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/cron/v3.go
generated
21
chain/actors/builtin/cron/v3.go
generated
@ -1,10 +1,14 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
cron3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/cron"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -33,3 +37,20 @@ type state3 struct {
|
||||
func (s *state3) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state3) ActorKey() string {
|
||||
return actors.CronKey
|
||||
}
|
||||
|
||||
func (s *state3) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version3
|
||||
}
|
||||
|
||||
func (s *state3) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/cron/v4.go
generated
21
chain/actors/builtin/cron/v4.go
generated
@ -1,10 +1,14 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
cron4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/cron"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -33,3 +37,20 @@ type state4 struct {
|
||||
func (s *state4) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state4) ActorKey() string {
|
||||
return actors.CronKey
|
||||
}
|
||||
|
||||
func (s *state4) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version4
|
||||
}
|
||||
|
||||
func (s *state4) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/cron/v5.go
generated
21
chain/actors/builtin/cron/v5.go
generated
@ -1,10 +1,14 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
cron5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/cron"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -33,3 +37,20 @@ type state5 struct {
|
||||
func (s *state5) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state5) ActorKey() string {
|
||||
return actors.CronKey
|
||||
}
|
||||
|
||||
func (s *state5) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version5
|
||||
}
|
||||
|
||||
func (s *state5) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/cron/v6.go
generated
21
chain/actors/builtin/cron/v6.go
generated
@ -1,10 +1,14 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
cron6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/cron"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -33,3 +37,20 @@ type state6 struct {
|
||||
func (s *state6) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state6) ActorKey() string {
|
||||
return actors.CronKey
|
||||
}
|
||||
|
||||
func (s *state6) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version6
|
||||
}
|
||||
|
||||
func (s *state6) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/cron/v7.go
generated
21
chain/actors/builtin/cron/v7.go
generated
@ -1,10 +1,14 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
cron7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/cron"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -33,3 +37,20 @@ type state7 struct {
|
||||
func (s *state7) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state7) ActorKey() string {
|
||||
return actors.CronKey
|
||||
}
|
||||
|
||||
func (s *state7) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version7
|
||||
}
|
||||
|
||||
func (s *state7) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/cron/v8.go
generated
21
chain/actors/builtin/cron/v8.go
generated
@ -1,10 +1,14 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
cron8 "github.com/filecoin-project/go-state-types/builtin/v8/cron"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -33,3 +37,20 @@ type state8 struct {
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state8) ActorKey() string {
|
||||
return actors.CronKey
|
||||
}
|
||||
|
||||
func (s *state8) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version8
|
||||
}
|
||||
|
||||
func (s *state8) 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
|
||||
}
|
||||
|
21
chain/actors/builtin/cron/v9.go
generated
21
chain/actors/builtin/cron/v9.go
generated
@ -1,10 +1,14 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
cron9 "github.com/filecoin-project/go-state-types/builtin/v9/cron"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -33,3 +37,20 @@ type state9 struct {
|
||||
func (s *state9) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state9) ActorKey() string {
|
||||
return actors.CronKey
|
||||
}
|
||||
|
||||
func (s *state9) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version9
|
||||
}
|
||||
|
||||
func (s *state9) 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
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package datacap
|
||||
import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"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"
|
||||
@ -50,8 +52,19 @@ func MakeState(store adt.Store, av actorstypes.Version, governor address.Address
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error
|
||||
VerifiedClientDataCap(address.Address) (bool, abi.StoragePower, error)
|
||||
Governor() (address.Address, error)
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{ {{range .versions}}
|
||||
(&state{{.}}{}).Code(),
|
||||
{{- end}}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package datacap
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
@ -51,8 +52,18 @@ func MakeState(store adt.Store, av actorstypes.Version, governor address.Address
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error
|
||||
VerifiedClientDataCap(address.Address) (bool, abi.StoragePower, error)
|
||||
Governor() (address.Address, error)
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{
|
||||
(&state9{}).Code(),
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,14 @@
|
||||
package datacap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
|
||||
datacap{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}datacap"
|
||||
adt{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}util/adt"
|
||||
@ -59,3 +61,20 @@ func (s *state{{.v}}) verifiedClients() (adt.Map, error) {
|
||||
func (s *state{{.v}}) VerifiedClientDataCap(addr address.Address) (bool, abi.StoragePower, error) {
|
||||
return getDataCap(s.store, actors.Version{{.v}}, s.verifiedClients, addr)
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorKey() string {
|
||||
return actors.DatacapKey
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version{{.v}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) 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
|
||||
}
|
||||
|
@ -54,6 +54,9 @@ func forEachClient(store adt.Store, ver actors.Version, root rootFunc, cb func(a
|
||||
}
|
||||
|
||||
a, err := address.NewIDAddress(id)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("creating ID address from actor ID: %w", err)
|
||||
}
|
||||
|
||||
return cb(a, big.Div(dcap, verifreg.DataCapGranularity))
|
||||
})
|
||||
|
20
chain/actors/builtin/datacap/v9.go
generated
20
chain/actors/builtin/datacap/v9.go
generated
@ -1,10 +1,13 @@
|
||||
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"
|
||||
datacap9 "github.com/filecoin-project/go-state-types/builtin/v9/datacap"
|
||||
adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt"
|
||||
|
||||
@ -59,3 +62,20 @@ func (s *state9) verifiedClients() (adt.Map, error) {
|
||||
func (s *state9) VerifiedClientDataCap(addr address.Address) (bool, abi.StoragePower, error) {
|
||||
return getDataCap(s.store, actors.Version9, s.verifiedClients, addr)
|
||||
}
|
||||
|
||||
func (s *state9) ActorKey() string {
|
||||
return actors.DatacapKey
|
||||
}
|
||||
|
||||
func (s *state9) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version9
|
||||
}
|
||||
|
||||
func (s *state9) 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
|
||||
}
|
||||
|
@ -67,6 +67,10 @@ func MakeState(store adt.Store, av actorstypes.Version, networkName string) (Sta
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
ResolveAddress(address address.Address) (address.Address, bool, error)
|
||||
MapAddressToNewID(address address.Address) (address.Address, error)
|
||||
NetworkName() (dtypes.NetworkName, error)
|
||||
@ -87,6 +91,16 @@ type State interface {
|
||||
// Sets the address map for the init actor. This should only be used for testing.
|
||||
SetAddressMap(mcid cid.Cid) error
|
||||
|
||||
AddressMap() (adt.Map, error)
|
||||
GetState() interface{}
|
||||
|
||||
AddressMap() (adt.Map, error)
|
||||
AddressMapBitWidth() int
|
||||
AddressMapHashFunction() func(input []byte) []byte
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{ {{range .versions}}
|
||||
(&state{{.}}{}).Code(),
|
||||
{{- end}}
|
||||
}
|
||||
}
|
||||
|
@ -110,6 +110,10 @@ func MakeState(store adt.Store, av actorstypes.Version, networkName string) (Sta
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
ResolveAddress(address address.Address) (address.Address, bool, error)
|
||||
MapAddressToNewID(address address.Address) (address.Address, error)
|
||||
NetworkName() (dtypes.NetworkName, error)
|
||||
@ -130,6 +134,23 @@ type State interface {
|
||||
// Sets the address map for the init actor. This should only be used for testing.
|
||||
SetAddressMap(mcid cid.Cid) error
|
||||
|
||||
AddressMap() (adt.Map, error)
|
||||
GetState() interface{}
|
||||
|
||||
AddressMap() (adt.Map, error)
|
||||
AddressMapBitWidth() int
|
||||
AddressMapHashFunction() func(input []byte) []byte
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{
|
||||
(&state0{}).Code(),
|
||||
(&state2{}).Code(),
|
||||
(&state3{}).Code(),
|
||||
(&state4{}).Code(),
|
||||
(&state5{}).Code(),
|
||||
(&state6{}).Code(),
|
||||
(&state7{}).Code(),
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,18 @@
|
||||
package init
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
|
||||
{{if (le .v 7)}}
|
||||
@ -119,10 +124,42 @@ func (s *state{{.v}}) SetAddressMap(mcid cid.Cid) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) AddressMap() (adt.Map, error) {
|
||||
return adt{{.v}}.AsMap(s.store, s.State.AddressMap{{if (ge .v 3)}}, builtin{{.v}}.DefaultHamtBitwidth{{end}})
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
func (s *state{{.v}}) AddressMapBitWidth() int {
|
||||
{{- if (ge .v 3)}}
|
||||
return builtin{{.v}}.DefaultHamtBitwidth
|
||||
{{- else}}
|
||||
return 5
|
||||
{{- end}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorKey() string {
|
||||
return actors.InitKey
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version{{.v}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) 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
|
||||
}
|
||||
|
37
chain/actors/builtin/init/v0.go
generated
37
chain/actors/builtin/init/v0.go
generated
@ -1,15 +1,20 @@
|
||||
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"
|
||||
init0 "github.com/filecoin-project/specs-actors/actors/builtin/init"
|
||||
adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
)
|
||||
@ -103,10 +108,38 @@ func (s *state0) SetAddressMap(mcid cid.Cid) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state0) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state0) AddressMap() (adt.Map, error) {
|
||||
return adt0.AsMap(s.store, s.State.AddressMap)
|
||||
}
|
||||
|
||||
func (s *state0) GetState() interface{} {
|
||||
return &s.State
|
||||
func (s *state0) AddressMapBitWidth() int {
|
||||
return 5
|
||||
}
|
||||
|
||||
func (s *state0) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state0) ActorKey() string {
|
||||
return actors.InitKey
|
||||
}
|
||||
|
||||
func (s *state0) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version0
|
||||
}
|
||||
|
||||
func (s *state0) 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
|
||||
}
|
||||
|
37
chain/actors/builtin/init/v2.go
generated
37
chain/actors/builtin/init/v2.go
generated
@ -1,15 +1,20 @@
|
||||
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"
|
||||
init2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/init"
|
||||
adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
)
|
||||
@ -103,10 +108,38 @@ func (s *state2) SetAddressMap(mcid cid.Cid) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state2) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state2) AddressMap() (adt.Map, error) {
|
||||
return adt2.AsMap(s.store, s.State.AddressMap)
|
||||
}
|
||||
|
||||
func (s *state2) GetState() interface{} {
|
||||
return &s.State
|
||||
func (s *state2) AddressMapBitWidth() int {
|
||||
return 5
|
||||
}
|
||||
|
||||
func (s *state2) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state2) ActorKey() string {
|
||||
return actors.InitKey
|
||||
}
|
||||
|
||||
func (s *state2) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version2
|
||||
}
|
||||
|
||||
func (s *state2) 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
|
||||
}
|
||||
|
37
chain/actors/builtin/init/v3.go
generated
37
chain/actors/builtin/init/v3.go
generated
@ -1,16 +1,21 @@
|
||||
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"
|
||||
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
|
||||
init3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/init"
|
||||
adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
)
|
||||
@ -104,10 +109,38 @@ func (s *state3) SetAddressMap(mcid cid.Cid) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state3) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state3) AddressMap() (adt.Map, error) {
|
||||
return adt3.AsMap(s.store, s.State.AddressMap, builtin3.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state3) GetState() interface{} {
|
||||
return &s.State
|
||||
func (s *state3) AddressMapBitWidth() int {
|
||||
return builtin3.DefaultHamtBitwidth
|
||||
}
|
||||
|
||||
func (s *state3) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state3) ActorKey() string {
|
||||
return actors.InitKey
|
||||
}
|
||||
|
||||
func (s *state3) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version3
|
||||
}
|
||||
|
||||
func (s *state3) 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
|
||||
}
|
||||
|
37
chain/actors/builtin/init/v4.go
generated
37
chain/actors/builtin/init/v4.go
generated
@ -1,16 +1,21 @@
|
||||
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"
|
||||
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
||||
init4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/init"
|
||||
adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
)
|
||||
@ -104,10 +109,38 @@ func (s *state4) SetAddressMap(mcid cid.Cid) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state4) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state4) AddressMap() (adt.Map, error) {
|
||||
return adt4.AsMap(s.store, s.State.AddressMap, builtin4.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state4) GetState() interface{} {
|
||||
return &s.State
|
||||
func (s *state4) AddressMapBitWidth() int {
|
||||
return builtin4.DefaultHamtBitwidth
|
||||
}
|
||||
|
||||
func (s *state4) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state4) ActorKey() string {
|
||||
return actors.InitKey
|
||||
}
|
||||
|
||||
func (s *state4) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version4
|
||||
}
|
||||
|
||||
func (s *state4) 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
|
||||
}
|
||||
|
37
chain/actors/builtin/init/v5.go
generated
37
chain/actors/builtin/init/v5.go
generated
@ -1,16 +1,21 @@
|
||||
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"
|
||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||
init5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/init"
|
||||
adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
)
|
||||
@ -104,10 +109,38 @@ func (s *state5) SetAddressMap(mcid cid.Cid) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state5) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state5) AddressMap() (adt.Map, error) {
|
||||
return adt5.AsMap(s.store, s.State.AddressMap, builtin5.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state5) GetState() interface{} {
|
||||
return &s.State
|
||||
func (s *state5) AddressMapBitWidth() int {
|
||||
return builtin5.DefaultHamtBitwidth
|
||||
}
|
||||
|
||||
func (s *state5) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state5) ActorKey() string {
|
||||
return actors.InitKey
|
||||
}
|
||||
|
||||
func (s *state5) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version5
|
||||
}
|
||||
|
||||
func (s *state5) 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
|
||||
}
|
||||
|
37
chain/actors/builtin/init/v6.go
generated
37
chain/actors/builtin/init/v6.go
generated
@ -1,16 +1,21 @@
|
||||
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"
|
||||
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||
init6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/init"
|
||||
adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
)
|
||||
@ -104,10 +109,38 @@ func (s *state6) SetAddressMap(mcid cid.Cid) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state6) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state6) AddressMap() (adt.Map, error) {
|
||||
return adt6.AsMap(s.store, s.State.AddressMap, builtin6.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state6) GetState() interface{} {
|
||||
return &s.State
|
||||
func (s *state6) AddressMapBitWidth() int {
|
||||
return builtin6.DefaultHamtBitwidth
|
||||
}
|
||||
|
||||
func (s *state6) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state6) ActorKey() string {
|
||||
return actors.InitKey
|
||||
}
|
||||
|
||||
func (s *state6) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version6
|
||||
}
|
||||
|
||||
func (s *state6) 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
|
||||
}
|
||||
|
37
chain/actors/builtin/init/v7.go
generated
37
chain/actors/builtin/init/v7.go
generated
@ -1,16 +1,21 @@
|
||||
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"
|
||||
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||
init7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/init"
|
||||
adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
)
|
||||
@ -104,10 +109,38 @@ func (s *state7) SetAddressMap(mcid cid.Cid) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state7) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state7) AddressMap() (adt.Map, error) {
|
||||
return adt7.AsMap(s.store, s.State.AddressMap, builtin7.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state7) GetState() interface{} {
|
||||
return &s.State
|
||||
func (s *state7) AddressMapBitWidth() int {
|
||||
return builtin7.DefaultHamtBitwidth
|
||||
}
|
||||
|
||||
func (s *state7) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state7) ActorKey() string {
|
||||
return actors.InitKey
|
||||
}
|
||||
|
||||
func (s *state7) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version7
|
||||
}
|
||||
|
||||
func (s *state7) 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
|
||||
}
|
||||
|
37
chain/actors/builtin/init/v8.go
generated
37
chain/actors/builtin/init/v8.go
generated
@ -1,16 +1,21 @@
|
||||
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"
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
init8 "github.com/filecoin-project/go-state-types/builtin/v8/init"
|
||||
adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
)
|
||||
@ -104,10 +109,38 @@ func (s *state8) SetAddressMap(mcid cid.Cid) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state8) AddressMap() (adt.Map, error) {
|
||||
return adt8.AsMap(s.store, s.State.AddressMap, builtin8.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
func (s *state8) AddressMapBitWidth() int {
|
||||
return builtin8.DefaultHamtBitwidth
|
||||
}
|
||||
|
||||
func (s *state8) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state8) ActorKey() string {
|
||||
return actors.InitKey
|
||||
}
|
||||
|
||||
func (s *state8) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version8
|
||||
}
|
||||
|
||||
func (s *state8) 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
|
||||
}
|
||||
|
37
chain/actors/builtin/init/v9.go
generated
37
chain/actors/builtin/init/v9.go
generated
@ -1,16 +1,21 @@
|
||||
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"
|
||||
builtin9 "github.com/filecoin-project/go-state-types/builtin"
|
||||
init9 "github.com/filecoin-project/go-state-types/builtin/v9/init"
|
||||
adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
)
|
||||
@ -104,10 +109,38 @@ func (s *state9) SetAddressMap(mcid cid.Cid) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state9) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state9) AddressMap() (adt.Map, error) {
|
||||
return adt9.AsMap(s.store, s.State.AddressMap, builtin9.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state9) GetState() interface{} {
|
||||
return &s.State
|
||||
func (s *state9) AddressMapBitWidth() int {
|
||||
return builtin9.DefaultHamtBitwidth
|
||||
}
|
||||
|
||||
func (s *state9) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state9) ActorKey() string {
|
||||
return actors.InitKey
|
||||
}
|
||||
|
||||
func (s *state9) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version9
|
||||
}
|
||||
|
||||
func (s *state9) 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
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package market
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"unicode/utf8"
|
||||
|
||||
@ -73,6 +74,11 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
BalancesChanged(State) (bool, error)
|
||||
EscrowTable() (BalanceTable, error)
|
||||
LockedTable() (BalanceTable, error)
|
||||
@ -200,3 +206,10 @@ func labelFromGoString(s string) (markettypes.DealLabel, error) {
|
||||
return markettypes.NewLabelFromBytes([]byte(s))
|
||||
}
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{ {{range .versions}}
|
||||
(&state{{.}}{}).Code(),
|
||||
{{- end}}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package market
|
||||
import (
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@ -114,6 +115,11 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
BalancesChanged(State) (bool, error)
|
||||
EscrowTable() (BalanceTable, error)
|
||||
LockedTable() (BalanceTable, error)
|
||||
@ -264,3 +270,17 @@ func labelFromGoString(s string) (markettypes.DealLabel, error) {
|
||||
return markettypes.NewLabelFromBytes([]byte(s))
|
||||
}
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{
|
||||
(&state0{}).Code(),
|
||||
(&state2{}).Code(),
|
||||
(&state3{}).Code(),
|
||||
(&state4{}).Code(),
|
||||
(&state5{}).Code(),
|
||||
(&state6{}).Code(),
|
||||
(&state7{}).Code(),
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package market
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"bytes"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
@ -14,7 +15,9 @@ import (
|
||||
{{end}}
|
||||
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
|
||||
@ -387,3 +390,21 @@ func (s *state{{.v}}) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifreg
|
||||
return verifregtypes.AllocationId(allocationId), nil
|
||||
{{end}}
|
||||
}
|
||||
|
||||
|
||||
func (s *state{{.v}}) ActorKey() string {
|
||||
return actors.MarketKey
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version{{.v}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/market/v0.go
generated
20
chain/actors/builtin/market/v0.go
generated
@ -2,6 +2,7 @@ package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -9,10 +10,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
market0 "github.com/filecoin-project/specs-actors/actors/builtin/market"
|
||||
adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
@ -307,3 +310,20 @@ func (s *state0) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
|
||||
|
||||
}
|
||||
|
||||
func (s *state0) ActorKey() string {
|
||||
return actors.MarketKey
|
||||
}
|
||||
|
||||
func (s *state0) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version0
|
||||
}
|
||||
|
||||
func (s *state0) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/market/v2.go
generated
20
chain/actors/builtin/market/v2.go
generated
@ -2,6 +2,7 @@ package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -9,10 +10,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
|
||||
adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
@ -307,3 +310,20 @@ func (s *state2) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
|
||||
|
||||
}
|
||||
|
||||
func (s *state2) ActorKey() string {
|
||||
return actors.MarketKey
|
||||
}
|
||||
|
||||
func (s *state2) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version2
|
||||
}
|
||||
|
||||
func (s *state2) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/market/v3.go
generated
20
chain/actors/builtin/market/v3.go
generated
@ -2,6 +2,7 @@ package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -9,10 +10,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
market3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/market"
|
||||
adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
@ -302,3 +305,20 @@ func (s *state3) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
|
||||
|
||||
}
|
||||
|
||||
func (s *state3) ActorKey() string {
|
||||
return actors.MarketKey
|
||||
}
|
||||
|
||||
func (s *state3) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version3
|
||||
}
|
||||
|
||||
func (s *state3) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/market/v4.go
generated
20
chain/actors/builtin/market/v4.go
generated
@ -2,6 +2,7 @@ package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -9,10 +10,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
market4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/market"
|
||||
adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
@ -302,3 +305,20 @@ func (s *state4) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
|
||||
|
||||
}
|
||||
|
||||
func (s *state4) ActorKey() string {
|
||||
return actors.MarketKey
|
||||
}
|
||||
|
||||
func (s *state4) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version4
|
||||
}
|
||||
|
||||
func (s *state4) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/market/v5.go
generated
20
chain/actors/builtin/market/v5.go
generated
@ -2,6 +2,7 @@ package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -9,10 +10,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
market5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/market"
|
||||
adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
@ -302,3 +305,20 @@ func (s *state5) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
|
||||
|
||||
}
|
||||
|
||||
func (s *state5) ActorKey() string {
|
||||
return actors.MarketKey
|
||||
}
|
||||
|
||||
func (s *state5) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version5
|
||||
}
|
||||
|
||||
func (s *state5) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/market/v6.go
generated
20
chain/actors/builtin/market/v6.go
generated
@ -2,6 +2,7 @@ package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,10 +12,12 @@ import (
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
market6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/market"
|
||||
adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
@ -320,3 +323,20 @@ func (s *state6) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
|
||||
|
||||
}
|
||||
|
||||
func (s *state6) ActorKey() string {
|
||||
return actors.MarketKey
|
||||
}
|
||||
|
||||
func (s *state6) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version6
|
||||
}
|
||||
|
||||
func (s *state6) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/market/v7.go
generated
20
chain/actors/builtin/market/v7.go
generated
@ -2,6 +2,7 @@ package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,10 +12,12 @@ import (
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
market7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/market"
|
||||
adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
@ -320,3 +323,20 @@ func (s *state7) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
|
||||
|
||||
}
|
||||
|
||||
func (s *state7) ActorKey() string {
|
||||
return actors.MarketKey
|
||||
}
|
||||
|
||||
func (s *state7) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version7
|
||||
}
|
||||
|
||||
func (s *state7) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/market/v8.go
generated
20
chain/actors/builtin/market/v8.go
generated
@ -2,6 +2,7 @@ package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,11 +12,13 @@ import (
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
market8 "github.com/filecoin-project/go-state-types/builtin/v8/market"
|
||||
adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
|
||||
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
@ -337,3 +340,20 @@ func (s *state8) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
|
||||
|
||||
}
|
||||
|
||||
func (s *state8) ActorKey() string {
|
||||
return actors.MarketKey
|
||||
}
|
||||
|
||||
func (s *state8) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version8
|
||||
}
|
||||
|
||||
func (s *state8) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/market/v9.go
generated
20
chain/actors/builtin/market/v9.go
generated
@ -2,6 +2,7 @@ package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,12 +12,14 @@ import (
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
market9 "github.com/filecoin-project/go-state-types/builtin/v9/market"
|
||||
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
|
||||
adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
@ -347,3 +350,20 @@ func (s *state9) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes
|
||||
return verifregtypes.AllocationId(allocationId), nil
|
||||
|
||||
}
|
||||
|
||||
func (s *state9) ActorKey() string {
|
||||
return actors.MarketKey
|
||||
}
|
||||
|
||||
func (s *state9) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version9
|
||||
}
|
||||
|
||||
func (s *state9) 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
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package miner
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
@ -66,6 +67,10 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
// Total available balance to spend.
|
||||
AvailableBalance(abi.TokenAmount) (abi.TokenAmount, error)
|
||||
// Funds that will vest by the given epoch.
|
||||
@ -243,3 +248,10 @@ type LockedFunds struct {
|
||||
func (lf LockedFunds) TotalLockedFunds() abi.TokenAmount {
|
||||
return big.Add(lf.VestingFunds, big.Add(lf.InitialPledgeRequirement, lf.PreCommitDeposits))
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{ {{range .versions}}
|
||||
(&state{{.}}{}).Code(),
|
||||
{{- end}}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package miner
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@ -108,6 +109,10 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
// Total available balance to spend.
|
||||
AvailableBalance(abi.TokenAmount) (abi.TokenAmount, error)
|
||||
// Funds that will vest by the given epoch.
|
||||
@ -285,3 +290,17 @@ type LockedFunds struct {
|
||||
func (lf LockedFunds) TotalLockedFunds() abi.TokenAmount {
|
||||
return big.Add(lf.VestingFunds, big.Add(lf.InitialPledgeRequirement, lf.PreCommitDeposits))
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{
|
||||
(&state0{}).Code(),
|
||||
(&state2{}).Code(),
|
||||
(&state3{}).Code(),
|
||||
(&state4{}).Code(),
|
||||
(&state5{}).Code(),
|
||||
(&state6{}).Code(),
|
||||
(&state7{}).Code(),
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package miner
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"bytes"
|
||||
"errors"
|
||||
{{if (le .v 1)}}
|
||||
@ -15,6 +16,8 @@ import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v{{.latestVersion}}/miner"
|
||||
|
||||
{{if (le .v 7)}}
|
||||
@ -602,3 +605,20 @@ func fromV{{.v}}SectorPreCommitOnChainInfo(v{{.v}} miner{{.v}}.SectorPreCommitOn
|
||||
func (s *state{{.v}}) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorKey() string {
|
||||
return actors.MinerKey
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version{{.v}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/miner/v0.go
generated
20
chain/actors/builtin/miner/v0.go
generated
@ -3,6 +3,7 @@ package miner
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,12 +12,14 @@ import (
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -528,3 +531,20 @@ func fromV0SectorPreCommitOnChainInfo(v0 miner0.SectorPreCommitOnChainInfo) mine
|
||||
func (s *state0) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state0) ActorKey() string {
|
||||
return actors.MinerKey
|
||||
}
|
||||
|
||||
func (s *state0) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version0
|
||||
}
|
||||
|
||||
func (s *state0) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/miner/v2.go
generated
20
chain/actors/builtin/miner/v2.go
generated
@ -3,6 +3,7 @@ package miner
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,11 +12,13 @@ import (
|
||||
"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"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
|
||||
adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -559,3 +562,20 @@ func fromV2SectorPreCommitOnChainInfo(v2 miner2.SectorPreCommitOnChainInfo) mine
|
||||
func (s *state2) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state2) ActorKey() string {
|
||||
return actors.MinerKey
|
||||
}
|
||||
|
||||
func (s *state2) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version2
|
||||
}
|
||||
|
||||
func (s *state2) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/miner/v3.go
generated
20
chain/actors/builtin/miner/v3.go
generated
@ -3,6 +3,7 @@ package miner
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,12 +12,14 @@ import (
|
||||
"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"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
|
||||
miner3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/miner"
|
||||
adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -559,3 +562,20 @@ func fromV3SectorPreCommitOnChainInfo(v3 miner3.SectorPreCommitOnChainInfo) mine
|
||||
func (s *state3) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state3) ActorKey() string {
|
||||
return actors.MinerKey
|
||||
}
|
||||
|
||||
func (s *state3) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version3
|
||||
}
|
||||
|
||||
func (s *state3) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/miner/v4.go
generated
20
chain/actors/builtin/miner/v4.go
generated
@ -3,6 +3,7 @@ package miner
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,12 +12,14 @@ import (
|
||||
"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"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
||||
miner4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/miner"
|
||||
adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -559,3 +562,20 @@ func fromV4SectorPreCommitOnChainInfo(v4 miner4.SectorPreCommitOnChainInfo) mine
|
||||
func (s *state4) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state4) ActorKey() string {
|
||||
return actors.MinerKey
|
||||
}
|
||||
|
||||
func (s *state4) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version4
|
||||
}
|
||||
|
||||
func (s *state4) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/miner/v5.go
generated
20
chain/actors/builtin/miner/v5.go
generated
@ -3,6 +3,7 @@ package miner
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,12 +12,14 @@ import (
|
||||
"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"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||
miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner"
|
||||
adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -559,3 +562,20 @@ func fromV5SectorPreCommitOnChainInfo(v5 miner5.SectorPreCommitOnChainInfo) mine
|
||||
func (s *state5) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state5) ActorKey() string {
|
||||
return actors.MinerKey
|
||||
}
|
||||
|
||||
func (s *state5) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version5
|
||||
}
|
||||
|
||||
func (s *state5) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/miner/v6.go
generated
20
chain/actors/builtin/miner/v6.go
generated
@ -3,6 +3,7 @@ package miner
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,12 +12,14 @@ import (
|
||||
"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"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||
miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner"
|
||||
adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -559,3 +562,20 @@ func fromV6SectorPreCommitOnChainInfo(v6 miner6.SectorPreCommitOnChainInfo) mine
|
||||
func (s *state6) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state6) ActorKey() string {
|
||||
return actors.MinerKey
|
||||
}
|
||||
|
||||
func (s *state6) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version6
|
||||
}
|
||||
|
||||
func (s *state6) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/miner/v7.go
generated
20
chain/actors/builtin/miner/v7.go
generated
@ -3,6 +3,7 @@ package miner
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,12 +12,14 @@ import (
|
||||
"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"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||
miner7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/miner"
|
||||
adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -560,3 +563,20 @@ func fromV7SectorPreCommitOnChainInfo(v7 miner7.SectorPreCommitOnChainInfo) mine
|
||||
func (s *state7) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state7) ActorKey() string {
|
||||
return actors.MinerKey
|
||||
}
|
||||
|
||||
func (s *state7) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version7
|
||||
}
|
||||
|
||||
func (s *state7) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/miner/v8.go
generated
20
chain/actors/builtin/miner/v8.go
generated
@ -3,6 +3,7 @@ package miner
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,12 +12,14 @@ import (
|
||||
"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"
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -560,3 +563,20 @@ func fromV8SectorPreCommitOnChainInfo(v8 miner8.SectorPreCommitOnChainInfo) mine
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state8) ActorKey() string {
|
||||
return actors.MinerKey
|
||||
}
|
||||
|
||||
func (s *state8) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version8
|
||||
}
|
||||
|
||||
func (s *state8) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/miner/v9.go
generated
20
chain/actors/builtin/miner/v9.go
generated
@ -3,6 +3,7 @@ package miner
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -11,12 +12,14 @@ import (
|
||||
"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"
|
||||
builtin9 "github.com/filecoin-project/go-state-types/builtin"
|
||||
miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -552,3 +555,20 @@ func fromV9SectorPreCommitOnChainInfo(v9 miner9.SectorPreCommitOnChainInfo) mine
|
||||
func (s *state9) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state9) ActorKey() string {
|
||||
return actors.MinerKey
|
||||
}
|
||||
|
||||
func (s *state9) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version9
|
||||
}
|
||||
|
||||
func (s *state9) 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
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package multisig
|
||||
|
||||
import (
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/ipfs/go-cid"
|
||||
"fmt"
|
||||
|
||||
"github.com/minio/blake2b-simd"
|
||||
@ -67,6 +68,10 @@ func MakeState(store adt.Store, av actorstypes.Version, signers []address.Addres
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
LockedBalance(epoch abi.ChainEpoch) (abi.TokenAmount, error)
|
||||
StartEpoch() (abi.ChainEpoch, error)
|
||||
UnlockDuration() (abi.ChainEpoch, error)
|
||||
@ -141,3 +146,10 @@ func txnParams(id uint64, data *ProposalHashData) ([]byte, error) {
|
||||
|
||||
return actors.SerializeParams(¶ms)
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{ {{range .versions}}
|
||||
(&state{{.}}{}).Code(),
|
||||
{{- end}}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package multisig
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/minio/blake2b-simd"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
@ -108,6 +109,10 @@ func MakeState(store adt.Store, av actorstypes.Version, signers []address.Addres
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
LockedBalance(epoch abi.ChainEpoch) (abi.TokenAmount, error)
|
||||
StartEpoch() (abi.ChainEpoch, error)
|
||||
UnlockDuration() (abi.ChainEpoch, error)
|
||||
@ -206,3 +211,17 @@ func txnParams(id uint64, data *ProposalHashData) ([]byte, error) {
|
||||
|
||||
return actors.SerializeParams(¶ms)
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{
|
||||
(&state0{}).Code(),
|
||||
(&state2{}).Code(),
|
||||
(&state3{}).Code(),
|
||||
(&state4{}).Code(),
|
||||
(&state5{}).Code(),
|
||||
(&state6{}).Code(),
|
||||
(&state7{}).Code(),
|
||||
(&state8{}).Code(),
|
||||
(&state9{}).Code(),
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
package multisig
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
@ -12,6 +14,7 @@ import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
|
||||
{{if (le .v 7)}}
|
||||
{{if (ge .v 3)}}
|
||||
@ -131,3 +134,20 @@ func (s *state{{.v}}) decodeTransaction(val *cbg.Deferred) (Transaction, error)
|
||||
func (s *state{{.v}}) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorKey() string {
|
||||
return actors.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version{{.v}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/multisig/v0.go
generated
20
chain/actors/builtin/multisig/v0.go
generated
@ -3,6 +3,7 @@ package multisig
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -10,9 +11,11 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
msig0 "github.com/filecoin-project/specs-actors/actors/builtin/multisig"
|
||||
adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -114,3 +117,20 @@ func (s *state0) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
func (s *state0) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state0) ActorKey() string {
|
||||
return actors.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state0) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version0
|
||||
}
|
||||
|
||||
func (s *state0) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/multisig/v2.go
generated
20
chain/actors/builtin/multisig/v2.go
generated
@ -3,6 +3,7 @@ package multisig
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -10,9 +11,11 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
msig2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/multisig"
|
||||
adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -114,3 +117,20 @@ func (s *state2) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
func (s *state2) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state2) ActorKey() string {
|
||||
return actors.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state2) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version2
|
||||
}
|
||||
|
||||
func (s *state2) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/multisig/v3.go
generated
20
chain/actors/builtin/multisig/v3.go
generated
@ -3,6 +3,7 @@ package multisig
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -10,10 +11,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
|
||||
msig3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/multisig"
|
||||
adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -115,3 +118,20 @@ func (s *state3) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
func (s *state3) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state3) ActorKey() string {
|
||||
return actors.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state3) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version3
|
||||
}
|
||||
|
||||
func (s *state3) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/multisig/v4.go
generated
20
chain/actors/builtin/multisig/v4.go
generated
@ -3,6 +3,7 @@ package multisig
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -10,10 +11,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
||||
msig4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/multisig"
|
||||
adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -115,3 +118,20 @@ func (s *state4) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
func (s *state4) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state4) ActorKey() string {
|
||||
return actors.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state4) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version4
|
||||
}
|
||||
|
||||
func (s *state4) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/multisig/v5.go
generated
20
chain/actors/builtin/multisig/v5.go
generated
@ -3,6 +3,7 @@ package multisig
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -10,10 +11,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||
msig5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/multisig"
|
||||
adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -115,3 +118,20 @@ func (s *state5) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
func (s *state5) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state5) ActorKey() string {
|
||||
return actors.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state5) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version5
|
||||
}
|
||||
|
||||
func (s *state5) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/multisig/v6.go
generated
20
chain/actors/builtin/multisig/v6.go
generated
@ -3,6 +3,7 @@ package multisig
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -10,10 +11,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||
msig6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/multisig"
|
||||
adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -115,3 +118,20 @@ func (s *state6) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
func (s *state6) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state6) ActorKey() string {
|
||||
return actors.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state6) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version6
|
||||
}
|
||||
|
||||
func (s *state6) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/multisig/v7.go
generated
20
chain/actors/builtin/multisig/v7.go
generated
@ -3,6 +3,7 @@ package multisig
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -10,10 +11,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||
msig7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/multisig"
|
||||
adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -115,3 +118,20 @@ func (s *state7) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
func (s *state7) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state7) ActorKey() string {
|
||||
return actors.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state7) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version7
|
||||
}
|
||||
|
||||
func (s *state7) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/multisig/v8.go
generated
20
chain/actors/builtin/multisig/v8.go
generated
@ -3,6 +3,7 @@ package multisig
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -10,10 +11,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
msig8 "github.com/filecoin-project/go-state-types/builtin/v8/multisig"
|
||||
adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -115,3 +118,20 @@ func (s *state8) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state8) ActorKey() string {
|
||||
return actors.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state8) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version8
|
||||
}
|
||||
|
||||
func (s *state8) 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
|
||||
}
|
||||
|
20
chain/actors/builtin/multisig/v9.go
generated
20
chain/actors/builtin/multisig/v9.go
generated
@ -3,6 +3,7 @@ package multisig
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
@ -10,10 +11,12 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin9 "github.com/filecoin-project/go-state-types/builtin"
|
||||
msig9 "github.com/filecoin-project/go-state-types/builtin/v9/multisig"
|
||||
adt9 "github.com/filecoin-project/go-state-types/builtin/v9/util/adt"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
@ -115,3 +118,20 @@ func (s *state9) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
func (s *state9) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state9) ActorKey() string {
|
||||
return actors.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state9) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version9
|
||||
}
|
||||
|
||||
func (s *state9) 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
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
package paych
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/ipfs/go-cid"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
|
||||
@ -59,6 +61,11 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
// versions
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
Code() cid.Cid
|
||||
ActorKey() string
|
||||
ActorVersion() actorstypes.Version
|
||||
|
||||
// Channel owner, who has funded the actor
|
||||
From() (address.Address, error)
|
||||
// Recipient of payouts from channel
|
||||
@ -132,4 +139,11 @@ func toV0SignedVoucher(sv paychtypes.SignedVoucher) paych0.SignedVoucher {
|
||||
Merges: nil,
|
||||
Signature: sv.Signature,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func AllCodes() []cid.Cid {
|
||||
return []cid.Cid{ {{range .versions}}
|
||||
(&state{{.}}{}).Code(),
|
||||
{{- end}}
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,14 @@ package mock
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
|
||||
)
|
||||
|
||||
@ -18,6 +22,18 @@ type mockState struct {
|
||||
lanes map[uint64]paych.LaneState
|
||||
}
|
||||
|
||||
func (ms *mockState) Code() cid.Cid {
|
||||
panic("paych mock does not have CID")
|
||||
}
|
||||
|
||||
func (ms *mockState) ActorKey() string {
|
||||
return actors.PaychKey
|
||||
}
|
||||
|
||||
func (ms *mockState) ActorVersion() actorstypes.Version {
|
||||
panic("paych mock is unversioned")
|
||||
}
|
||||
|
||||
func (ms *mockState) GetState() interface{} {
|
||||
panic("implement me")
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user