v1.27.0-a #10
@ -657,6 +657,18 @@ workflows:
|
||||
- build
|
||||
suite: itest-decode_params
|
||||
target: "./itests/decode_params_test.go"
|
||||
- test:
|
||||
name: test-itest-direct_data_onboard
|
||||
requires:
|
||||
- build
|
||||
suite: itest-direct_data_onboard
|
||||
target: "./itests/direct_data_onboard_test.go"
|
||||
- test:
|
||||
name: test-itest-direct_data_onboard_verified
|
||||
requires:
|
||||
- build
|
||||
suite: itest-direct_data_onboard_verified
|
||||
target: "./itests/direct_data_onboard_verified_test.go"
|
||||
- test:
|
||||
name: test-itest-dup_mpool_messages
|
||||
requires:
|
||||
|
132
CHANGELOG.md
132
CHANGELOG.md
@ -2,9 +2,74 @@
|
||||
|
||||
# UNRELEASED
|
||||
|
||||
## New features
|
||||
|
||||
## Improvements
|
||||
|
||||
### Tracing API
|
||||
# v1.26.0-rc2 / 2024-03-0y
|
||||
|
||||
This is a release candidate of the upcoming MANDATORY Lotus v1.26.0 release, which will deliver the Filecoin network version 22, codenamed Dragon 🐉.
|
||||
|
||||
**This release candidate sets the calibration network to upgrade at epoch 1427974, which is 2024-03-11T14:00:00Z**
|
||||
This release does NOT set the mainnet upgrade epoch yet, in which will be updated in the final release.
|
||||
The Filecoin network version 22 delivers the following FIPs:
|
||||
|
||||
- [FIP-0063: Switching to new Drand mainnet network](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0063.md)
|
||||
- [FIP-0074: Remove cron-based automatic deal settlement](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0074.md)
|
||||
- [FIP-0076: Direct data onboarding](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0076.md)
|
||||
- [FIP-0083: Add built-in Actor events in the Verified Registry, Miner and Market Actors](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0083.md)
|
||||
|
||||
## v13 Builtin Actor Bundle
|
||||
|
||||
The actor bundles for the **calibration network** can be checked as follows:
|
||||
|
||||
```
|
||||
lotus state actor-cids --network-version=22
|
||||
Network Version: 22
|
||||
Actor Version: 13
|
||||
Manifest CID: bafy2bzacea4firkyvt2zzdwqjrws5pyeluaesh6uaid246tommayr4337xpmi
|
||||
|
||||
Actor CID
|
||||
account bafk2bzaceb3j36ri5y5mfklgp5emlvrms6g4733ss2j3l7jismrxq6ng3tcc6
|
||||
cron bafk2bzaceaz6rocamdxehgpwcbku6wlapwpgzyyvkrploj66mlqptsulf52bs
|
||||
datacap bafk2bzacea22nv5g3yngpxvonqfj4r2nkfk64y6yw2malicm7odk77x7zuads
|
||||
eam bafk2bzaceatqtjzj7623i426noaslouvluhz6e3md3vvquqzku5qj3532uaxg
|
||||
ethaccount bafk2bzacean3hs7ga5csw6g3uu7watxfnqv5uvxviebn3ba6vg4sagwdur5pu
|
||||
evm bafk2bzacec5ibmbtzuzjgwjmksm2n6zfq3gkicxqywwu7tsscqgdzajpfctxk
|
||||
init bafk2bzaced5sq72oemz6qwi6yssxwlos2g54zfprslrx5qfhhx2vlgsbvdpcs
|
||||
multisig bafk2bzacedbgei6jkx36fwdgvoohce4aghvpohqdhoco7p4thszgssms7olv2
|
||||
paymentchannel bafk2bzaceasmgmfsi4mjanxlowsub65fmevhzky4toeqbtw4kp6tmu4kxjpgq
|
||||
placeholder bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro
|
||||
reward bafk2bzacedjyp6ll5ez27dfgldjj4tntxfvyp4pa5zkk7s5uhipzqjyx2gmuc
|
||||
storagemarket bafk2bzaceabolct6qdnefwcrtati2us3sxtxfghyqk6aamfhl6byyefmtssqi
|
||||
storageminer bafk2bzaceckzw3v7wqliyggvjvihz4wywchnnsie4frfvkm3fm5znb64mofri
|
||||
storagepower bafk2bzacea7t4wynzjajl442mpdqbnh3wusjusqtnzgpvefvweh4n2tgzgqhu
|
||||
system bafk2bzacedjnrb5glewazsxpcx6rwiuhl4kwrfcqolyprn6rrjtlzmthlhdq6
|
||||
verifiedregistry bafk2bzacednskl3bykz5qpo54z2j2p4q44t5of4ktd6vs6ymmg2zebsbxazkm
|
||||
```
|
||||
|
||||
## Migration
|
||||
|
||||
We are expecting a bit heavier than normal state migration for this upgrade due to the amount of state changes introduced with Direct Data Onboarding.
|
||||
|
||||
All node operators, including storage providers, should be aware that ONE pre-migration is being scheduled 120 epochs before the upgrade. It will take around 10-20 minutes for the pre-migration and less than 30 seconds for the final migration, depending on the amount of 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 enabled splitstore discard 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.
|
||||
|
||||
You can test out the migration by running running the [`benchmarking a network migration` tutorial.](https://lotus.filecoin.io/kb/test-migration/)
|
||||
|
||||
For certain node operators, such as full archival nodes or systems that need to keep large amounts of state (RPC providers), completing the pre-migration in time before the network upgrade might not be achievable. For those node operators, it is recommended to skip the pre-migration and run the non-cached migration (i.e., just running the migration at the exact upgrade epoch), and schedule for some downtime during the upgrade epoch. Operators of such nodes can read the [`How to disable premigration in network upgrade` tutorial.](https://lotus.filecoin.io/kb/disable-premigration/)
|
||||
|
||||
## New features
|
||||
- feat: api: new verified registry methods to get all allocations and claims (#11631) ([filecoin-project/lotus#11631](https://github.com/filecoin-project/lotus/pull/11631))
|
||||
- new: add forest bootstrap nodes (#11636) ([filecoin-project/lotus#11636](https://github.com/filecoin-project/lotus/pull/11636))
|
||||
- feat: sealing: Support nv22 DDO features in the sealing pipeline (#11226) ([filecoin-project/lotus#11226](https://github.com/filecoin-project/lotus/pull/11226))
|
||||
- feat: implement FIP-0063 ([filecoin-project/lotus#11572](https://github.com/filecoin-project/lotus/pull/11572))
|
||||
- feat: events: Add Lotus APIs to consume smart contract and built-in actor events ([filecoin-project/lotus#11618](https://github.com/filecoin-project/lotus/pull/11618))
|
||||
|
||||
## Improvements
|
||||
|
||||
## Tracing API
|
||||
|
||||
Replace the `CodeCid` field in the message trace (added in 1.23.4) with an `InvokedActor` field.
|
||||
|
||||
@ -67,6 +132,71 @@ Additionally, Filecoin is not Ethereum no matter how much we try to provide API/
|
||||
|
||||
[handlefilecoinmethod]: https://fips.filecoin.io/FIPS/fip-0054.html#handlefilecoinmethod-general-handler-for-method-numbers--1024
|
||||
|
||||
### GetActorEvents and SubscribeActorEvents
|
||||
|
||||
[FIP-0049](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0049.md) introduced _Actor Events_ that can be emitted by user programmed actors. [FIP-0083](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0083.md) introduces new events emitted by the builtin Verified Registry, Miner and Market Actors. These new events for builtin actors are being activated with network version 22 to coincide with _Direct Data Onboarding_ as defined in [FIP-0076](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0076.md) which introduces additional flexibility for data onboarding. Sector, Deal and DataCap lifecycles can be tracked with these events, providing visibility and options for programmatic responses to changes in state.
|
||||
|
||||
Actor events are available on message receipts, but can now be retrieved from a node using the new `GetActorEvents` and `SubscribeActorEvents` methods. These methods allow for querying and subscribing to actor events, respectively. They depend on the Lotus node both collecting events (with `Fevm.Events.RealTimeFilterAPI` and `Fevm.Events.HistoricFilterAPI`) and being enabled with the new configuration option `Events.EnableActorEventsAPI`. Note that a Lotus node can only respond to requests for historic events that it retains in its event store.
|
||||
|
||||
Both `GetActorEvents` and `SubscribeActorEvents` take a filter parameter which can optionally filter events on:
|
||||
|
||||
* `Addresses` of the actor(s) emitting the event
|
||||
* Specific `Fields` within the event
|
||||
* `FromHeight` and `ToHeight` to filter events by block height
|
||||
* `TipSetKey` to restrict events contained within a specific tipset
|
||||
|
||||
`GetActorEvents` provides a one-time query for actor events, while `SubscribeActorEvents` provides a long-lived connection (via websockets) to the Lotus node, allowing for real-time updates on actor events. The subscription can be cancelled by the client at any time.
|
||||
|
||||
### GetAllClaims and GetAllAlocations
|
||||
Additionally the methods `GetAllAllocations` and `GetAllClaims` has been added to the Lotus API. These methods lists all the available allocations and claims available in the actor state.
|
||||
|
||||
### Lotus CLI
|
||||
|
||||
The `filplus` commands used for listing allocations and claims have been updated. If no argument is provided to the either command, they will list out all the allocations and claims in the verified registry actor.
|
||||
The output list columns have been modified to `AllocationID` and `ClaimID` instead of ID.
|
||||
|
||||
```shell
|
||||
lotus filplus list-allocations --help
|
||||
NAME:
|
||||
lotus filplus list-allocations - List allocations available in verified registry actor or made by a client if specified
|
||||
|
||||
USAGE:
|
||||
lotus filplus list-allocations [command options] clientAddress
|
||||
|
||||
OPTIONS:
|
||||
--expired list only expired allocations (default: false)
|
||||
--json output results in json format (default: false)
|
||||
--help, -h show help
|
||||
|
||||
|
||||
lotus filplus list-claims --help
|
||||
NAME:
|
||||
lotus filplus list-claims - List claims available in verified registry actor or made by provider if specified
|
||||
|
||||
USAGE:
|
||||
lotus filplus list-claims [command options] providerAddress
|
||||
|
||||
OPTIONS:
|
||||
--expired list only expired claims (default: false)
|
||||
--help, -h show help
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
- github.com/filecoin-project/go-state-types (v0.12.8 -> v0.13.0-rc.2)
|
||||
- chore: deps: update to go-state-types v13.0.0-rc.1 ([filecoin-project/lotus#11662](https://github.com/filecoin-project/lotus/pull/11662))
|
||||
- chore: deps: update to go-state-types v13.0.0-rc.2 ([filecoin-project/lotus#11675](https://github.com/filecoin-project/lotus/pull/11675))
|
||||
- chore: deps: update to go-multiaddr v0.12.2 (#11602) ([filecoin-project/lotus#11602](https://github.com/filecoin-project/lotus/pull/11602))
|
||||
- feat: fvm: update the FVM/FFI to v4.1 (#11608) (#11612) ([filecoin-project/lotus#11612](https://github.com/filecoin-project/lotus/pull/11612))
|
||||
|
||||
## Others
|
||||
- Remove PL operated bootstrap nodes from mainnet.pi ([filecoin-project/lotus#11491](https://github.com/filecoin-project/lotus/pull/11491))
|
||||
- Update epoch heights (#11637) ([filecoin-project/lotus#11637](https://github.com/filecoin-project/lotus/pull/11637))
|
||||
- chore: Set upgrade heights and change codename ([filecoin-project/lotus#11599](https://github.com/filecoin-project/lotus/pull/11599))
|
||||
- chore:: backport #11609 to the feat/nv22 branch (#11644) ([filecoin-project/lotus#11644](https://github.com/filecoin-project/lotus/pull/11644))
|
||||
- fix: add UpgradePhoenixHeight to StateGetNetworkParams (#11648) ([filecoin-project/lotus#11648](https://github.com/filecoin-project/lotus/pull/11648))
|
||||
- feat: drand quicknet: allow scheduling drand quicknet upgrade before nv22 on 2k devnet ([filecoin-project/lotus#11667]https://github.com/filecoin-project/lotus/pull/11667)
|
||||
- chore: backport #11632 to release/v1.26.0 ([filecoin-project/lotus#11667](https://github.com/filecoin-project/lotus/pull/11667))
|
||||
|
||||
# v1.25.2 / 2024-01-11
|
||||
|
||||
This is an optional but **highly recommended feature release** of Lotus, as it includes fixes for synchronizations issues that users have experienced. The feature release also introduces `Lotus-Provider` in its alpha testing phase, as well as the ability to call external PC2-binaries during the sealing process.
|
||||
|
@ -20,7 +20,6 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v9/market"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
@ -28,8 +27,10 @@ import (
|
||||
|
||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/verifreg"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/chain/types/ethtypes"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
@ -552,14 +553,20 @@ type FullNode interface {
|
||||
// StateGetAllocationForPendingDeal returns the allocation for a given deal ID of a pending deal. Returns nil if
|
||||
// pending allocation is not found.
|
||||
StateGetAllocationForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*verifregtypes.Allocation, error) //perm:read
|
||||
// StateGetAllocationIdForPendingDeal is like StateGetAllocationForPendingDeal except it returns the allocation ID
|
||||
StateGetAllocationIdForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (verifreg.AllocationId, error) //perm:read
|
||||
// StateGetAllocation returns the allocation for a given address and allocation ID.
|
||||
StateGetAllocation(ctx context.Context, clientAddr address.Address, allocationId verifregtypes.AllocationId, tsk types.TipSetKey) (*verifregtypes.Allocation, error) //perm:read
|
||||
// StateGetAllocations returns the all the allocations for a given client.
|
||||
StateGetAllocations(ctx context.Context, clientAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) //perm:read
|
||||
// StateGetAllAllocations returns the all the allocations available in verified registry actor.
|
||||
StateGetAllAllocations(ctx context.Context, tsk types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) //perm:read
|
||||
// StateGetClaim returns the claim for a given address and claim ID.
|
||||
StateGetClaim(ctx context.Context, providerAddr address.Address, claimId verifregtypes.ClaimId, tsk types.TipSetKey) (*verifregtypes.Claim, error) //perm:read
|
||||
// StateGetClaims returns the all the claims for a given provider.
|
||||
StateGetClaims(ctx context.Context, providerAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) //perm:read
|
||||
// StateGetAllClaims returns the all the claims available in verified registry actor.
|
||||
StateGetAllClaims(ctx context.Context, tsk types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) //perm:read
|
||||
// StateComputeDataCID computes DataCID from a set of on-chain deals
|
||||
StateComputeDataCID(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tsk types.TipSetKey) (cid.Cid, error) //perm:read
|
||||
// StateLookupID retrieves the ID address of the given address
|
||||
@ -896,6 +903,33 @@ 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
|
||||
|
||||
// Actor events
|
||||
|
||||
// GetActorEvents returns all user-programmed and built-in actor events that match the given
|
||||
// filter.
|
||||
// This is a request/response API.
|
||||
// Results available from this API may be limited by the MaxFilterResults and MaxFilterHeightRange
|
||||
// configuration options and also the amount of historical data available in the node.
|
||||
//
|
||||
// This is an EXPERIMENTAL API and may be subject to change.
|
||||
GetActorEvents(ctx context.Context, filter *types.ActorEventFilter) ([]*types.ActorEvent, error) //perm:read
|
||||
|
||||
// SubscribeActorEvents returns a long-lived stream of all user-programmed and built-in actor
|
||||
// events that match the given filter.
|
||||
// Events that match the given filter are written to the stream in real-time as they are emitted
|
||||
// from the FVM.
|
||||
// The response stream is closed when the client disconnects, when a ToHeight is specified and is
|
||||
// reached, or if there is an error while writing an event to the stream.
|
||||
// This API also allows clients to read all historical events matching the given filter before any
|
||||
// real-time events are written to the response stream if the filter specifies an earlier
|
||||
// FromHeight.
|
||||
// Results available from this API may be limited by the MaxFilterResults and MaxFilterHeightRange
|
||||
// configuration options and also the amount of historical data available in the node.
|
||||
//
|
||||
// Note: this API is only available via websocket connections.
|
||||
// This is an EXPERIMENTAL API and may be subject to change.
|
||||
SubscribeActorEvents(ctx context.Context, filter *types.ActorEventFilter) (<-chan *types.ActorEvent, error) //perm:read
|
||||
}
|
||||
|
||||
// reverse interface to the client, called after EthSubscribe
|
||||
@ -1131,9 +1165,47 @@ type MarketBalance struct {
|
||||
Locked big.Int
|
||||
}
|
||||
|
||||
type MarketDealState struct {
|
||||
SectorStartEpoch abi.ChainEpoch // -1 if not yet included in proven sector
|
||||
LastUpdatedEpoch abi.ChainEpoch // -1 if deal state never updated
|
||||
SlashEpoch abi.ChainEpoch // -1 if deal never slashed
|
||||
}
|
||||
|
||||
func MakeDealState(mds market.DealState) MarketDealState {
|
||||
return MarketDealState{
|
||||
SectorStartEpoch: mds.SectorStartEpoch(),
|
||||
LastUpdatedEpoch: mds.LastUpdatedEpoch(),
|
||||
SlashEpoch: mds.SlashEpoch(),
|
||||
}
|
||||
}
|
||||
|
||||
type mstate struct {
|
||||
s MarketDealState
|
||||
}
|
||||
|
||||
func (m mstate) SectorStartEpoch() abi.ChainEpoch {
|
||||
return m.s.SectorStartEpoch
|
||||
}
|
||||
|
||||
func (m mstate) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return m.s.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (m mstate) SlashEpoch() abi.ChainEpoch {
|
||||
return m.s.SlashEpoch
|
||||
}
|
||||
|
||||
func (m mstate) Equals(o market.DealState) bool {
|
||||
return market.DealStatesEqual(m, o)
|
||||
}
|
||||
|
||||
func (m MarketDealState) Iface() market.DealState {
|
||||
return mstate{m}
|
||||
}
|
||||
|
||||
type MarketDeal struct {
|
||||
Proposal market.DealProposal
|
||||
State market.DealState
|
||||
State MarketDealState
|
||||
}
|
||||
|
||||
type RetrievalOrder struct {
|
||||
|
@ -129,4 +129,7 @@ type Gateway interface {
|
||||
Web3ClientVersion(ctx context.Context) (string, error)
|
||||
EthTraceBlock(ctx context.Context, blkNum string) ([]*ethtypes.EthTraceBlock, error)
|
||||
EthTraceReplayBlockTransactions(ctx context.Context, blkNum string, traceTypes []string) ([]*ethtypes.EthTraceReplayBlockTransaction, error)
|
||||
|
||||
GetActorEvents(ctx context.Context, filter *types.ActorEventFilter) ([]*types.ActorEvent, error)
|
||||
SubscribeActorEvents(ctx context.Context, filter *types.ActorEventFilter) (<-chan *types.ActorEvent, error)
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ import (
|
||||
builtinactors "github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/storage/pipeline/piece"
|
||||
"github.com/filecoin-project/lotus/storage/pipeline/sealiface"
|
||||
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
|
||||
"github.com/filecoin-project/lotus/storage/sealer/storiface"
|
||||
@ -75,7 +76,7 @@ type StorageMiner interface {
|
||||
// Add piece to an open sector. If no sectors with enough space are open,
|
||||
// either a new sector will be created, or this call will block until more
|
||||
// sectors can be created.
|
||||
SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPieceSize, r storiface.Data, d PieceDealInfo) (SectorOffset, error) //perm:admin
|
||||
SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPieceSize, r storiface.Data, d piece.PieceDealInfo) (SectorOffset, error) //perm:admin
|
||||
|
||||
SectorsUnsealPiece(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, commd *cid.Cid) error //perm:admin
|
||||
|
||||
@ -354,9 +355,20 @@ type SectorLog struct {
|
||||
|
||||
type SectorPiece struct {
|
||||
Piece abi.PieceInfo
|
||||
DealInfo *PieceDealInfo // nil for pieces which do not appear in deals (e.g. filler pieces)
|
||||
|
||||
// DealInfo is nil for pieces which do not appear in deals (e.g. filler pieces)
|
||||
// NOTE: DDO pieces which aren't associated with a market deal and have no
|
||||
// verified allocation will still have a non-nil DealInfo.
|
||||
// nil DealInfo indicates that the piece is a filler, and has zero piece commitment.
|
||||
DealInfo *piece.PieceDealInfo
|
||||
}
|
||||
|
||||
// DEPRECATED: Use piece.PieceDealInfo instead
|
||||
type PieceDealInfo = piece.PieceDealInfo
|
||||
|
||||
// DEPRECATED: Use piece.DealSchedule instead
|
||||
type DealSchedule = piece.DealSchedule
|
||||
|
||||
type SectorInfo struct {
|
||||
SectorID abi.SectorNumber
|
||||
State SectorState
|
||||
@ -459,28 +471,6 @@ type SectorOffset struct {
|
||||
Offset abi.PaddedPieceSize
|
||||
}
|
||||
|
||||
// DealInfo is a tuple of deal identity and its schedule
|
||||
type PieceDealInfo struct {
|
||||
// "Old" builtin-market deal info
|
||||
PublishCid *cid.Cid
|
||||
DealID abi.DealID
|
||||
DealProposal *market.DealProposal
|
||||
|
||||
// Common deal info
|
||||
DealSchedule DealSchedule
|
||||
|
||||
// Best-effort deal asks
|
||||
KeepUnsealed bool
|
||||
}
|
||||
|
||||
// DealSchedule communicates the time interval of a storage deal. The deal must
|
||||
// appear in a sealed (proven) sector no later than StartEpoch, otherwise it
|
||||
// is invalid.
|
||||
type DealSchedule struct {
|
||||
StartEpoch abi.ChainEpoch
|
||||
EndEpoch abi.ChainEpoch
|
||||
}
|
||||
|
||||
// DagstoreShardInfo is the serialized form of dagstore.DagstoreShardInfo that
|
||||
// we expose through JSON-RPC to avoid clients having to depend on the
|
||||
// dagstore lib.
|
||||
|
474
api/cbor_gen.go
474
api/cbor_gen.go
@ -14,7 +14,8 @@ import (
|
||||
|
||||
abi "github.com/filecoin-project/go-state-types/abi"
|
||||
paych "github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
market "github.com/filecoin-project/go-state-types/builtin/v9/market"
|
||||
|
||||
piece "github.com/filecoin-project/lotus/storage/pipeline/piece"
|
||||
)
|
||||
|
||||
var _ = xerrors.Errorf
|
||||
@ -35,7 +36,7 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Channel (address.Address) (struct)
|
||||
if len("Channel") > cbg.MaxLength {
|
||||
if len("Channel") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"Channel\" was too long")
|
||||
}
|
||||
|
||||
@ -51,7 +52,7 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Vouchers ([]*paych.SignedVoucher) (slice)
|
||||
if len("Vouchers") > cbg.MaxLength {
|
||||
if len("Vouchers") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"Vouchers\" was too long")
|
||||
}
|
||||
|
||||
@ -62,7 +63,7 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(t.Vouchers) > cbg.MaxLength {
|
||||
if len(t.Vouchers) > 8192 {
|
||||
return xerrors.Errorf("Slice value in field t.Vouchers was too long")
|
||||
}
|
||||
|
||||
@ -73,10 +74,11 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
|
||||
if err := v.MarshalCBOR(cw); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// t.WaitSentinel (cid.Cid) (struct)
|
||||
if len("WaitSentinel") > cbg.MaxLength {
|
||||
if len("WaitSentinel") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"WaitSentinel\" was too long")
|
||||
}
|
||||
|
||||
@ -123,7 +125,7 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadString(cr)
|
||||
sval, err := cbg.ReadStringWithMax(cr, 8192)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -150,7 +152,7 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
if extra > 8192 {
|
||||
return fmt.Errorf("t.Vouchers: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@ -188,9 +190,9 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// t.WaitSentinel (cid.Cid) (struct)
|
||||
case "WaitSentinel":
|
||||
|
||||
@ -226,7 +228,7 @@ func (t *SealedRef) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Size (abi.UnpaddedPieceSize) (uint64)
|
||||
if len("Size") > cbg.MaxLength {
|
||||
if len("Size") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"Size\" was too long")
|
||||
}
|
||||
|
||||
@ -242,7 +244,7 @@ func (t *SealedRef) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Offset (abi.PaddedPieceSize) (uint64)
|
||||
if len("Offset") > cbg.MaxLength {
|
||||
if len("Offset") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"Offset\" was too long")
|
||||
}
|
||||
|
||||
@ -258,7 +260,7 @@ func (t *SealedRef) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.SectorID (abi.SectorNumber) (uint64)
|
||||
if len("SectorID") > cbg.MaxLength {
|
||||
if len("SectorID") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"SectorID\" was too long")
|
||||
}
|
||||
|
||||
@ -305,7 +307,7 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadString(cr)
|
||||
sval, err := cbg.ReadStringWithMax(cr, 8192)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -381,7 +383,7 @@ func (t *SealedRefs) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Refs ([]api.SealedRef) (slice)
|
||||
if len("Refs") > cbg.MaxLength {
|
||||
if len("Refs") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"Refs\" was too long")
|
||||
}
|
||||
|
||||
@ -392,7 +394,7 @@ func (t *SealedRefs) MarshalCBOR(w io.Writer) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(t.Refs) > cbg.MaxLength {
|
||||
if len(t.Refs) > 8192 {
|
||||
return xerrors.Errorf("Slice value in field t.Refs was too long")
|
||||
}
|
||||
|
||||
@ -403,6 +405,7 @@ func (t *SealedRefs) MarshalCBOR(w io.Writer) error {
|
||||
if err := v.MarshalCBOR(cw); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -436,7 +439,7 @@ func (t *SealedRefs) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadString(cr)
|
||||
sval, err := cbg.ReadStringWithMax(cr, 8192)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -453,7 +456,7 @@ func (t *SealedRefs) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
if extra > 8192 {
|
||||
return fmt.Errorf("t.Refs: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@ -481,6 +484,7 @@ func (t *SealedRefs) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -505,7 +509,7 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Epoch (abi.ChainEpoch) (int64)
|
||||
if len("Epoch") > cbg.MaxLength {
|
||||
if len("Epoch") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"Epoch\" was too long")
|
||||
}
|
||||
|
||||
@ -527,7 +531,7 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Value (abi.SealRandomness) (slice)
|
||||
if len("Value") > cbg.MaxLength {
|
||||
if len("Value") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"Value\" was too long")
|
||||
}
|
||||
|
||||
@ -538,7 +542,7 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(t.Value) > cbg.ByteArrayMaxLen {
|
||||
if len(t.Value) > 2097152 {
|
||||
return xerrors.Errorf("Byte array in field t.Value was too long")
|
||||
}
|
||||
|
||||
@ -546,9 +550,10 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := cw.Write(t.Value[:]); err != nil {
|
||||
if _, err := cw.Write(t.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -581,7 +586,7 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadString(cr)
|
||||
sval, err := cbg.ReadStringWithMax(cr, 8192)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -594,10 +599,10 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
case "Epoch":
|
||||
{
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
var extraI int64
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var extraI int64
|
||||
switch maj {
|
||||
case cbg.MajUnsignedInt:
|
||||
extraI = int64(extra)
|
||||
@ -624,7 +629,7 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if extra > cbg.ByteArrayMaxLen {
|
||||
if extra > 2097152 {
|
||||
return fmt.Errorf("t.Value: byte array too large (%d)", extra)
|
||||
}
|
||||
if maj != cbg.MajByteString {
|
||||
@ -635,7 +640,7 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
t.Value = make([]uint8, extra)
|
||||
}
|
||||
|
||||
if _, err := io.ReadFull(cr, t.Value[:]); err != nil {
|
||||
if _, err := io.ReadFull(cr, t.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -660,7 +665,7 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Epoch (abi.ChainEpoch) (int64)
|
||||
if len("Epoch") > cbg.MaxLength {
|
||||
if len("Epoch") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"Epoch\" was too long")
|
||||
}
|
||||
|
||||
@ -682,7 +687,7 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Value (abi.InteractiveSealRandomness) (slice)
|
||||
if len("Value") > cbg.MaxLength {
|
||||
if len("Value") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"Value\" was too long")
|
||||
}
|
||||
|
||||
@ -693,7 +698,7 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(t.Value) > cbg.ByteArrayMaxLen {
|
||||
if len(t.Value) > 2097152 {
|
||||
return xerrors.Errorf("Byte array in field t.Value was too long")
|
||||
}
|
||||
|
||||
@ -701,9 +706,10 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := cw.Write(t.Value[:]); err != nil {
|
||||
if _, err := cw.Write(t.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -736,7 +742,7 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadString(cr)
|
||||
sval, err := cbg.ReadStringWithMax(cr, 8192)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -749,10 +755,10 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
case "Epoch":
|
||||
{
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
var extraI int64
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var extraI int64
|
||||
switch maj {
|
||||
case cbg.MajUnsignedInt:
|
||||
extraI = int64(extra)
|
||||
@ -779,7 +785,7 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if extra > cbg.ByteArrayMaxLen {
|
||||
if extra > 2097152 {
|
||||
return fmt.Errorf("t.Value: byte array too large (%d)", extra)
|
||||
}
|
||||
if maj != cbg.MajByteString {
|
||||
@ -790,7 +796,7 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
t.Value = make([]uint8, extra)
|
||||
}
|
||||
|
||||
if _, err := io.ReadFull(cr, t.Value[:]); err != nil {
|
||||
if _, err := io.ReadFull(cr, t.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -802,239 +808,6 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
|
||||
return nil
|
||||
}
|
||||
func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error {
|
||||
if t == nil {
|
||||
_, err := w.Write(cbg.CborNull)
|
||||
return err
|
||||
}
|
||||
|
||||
cw := cbg.NewCborWriter(w)
|
||||
|
||||
if _, err := cw.Write([]byte{165}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// t.DealID (abi.DealID) (uint64)
|
||||
if len("DealID") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"DealID\" was too long")
|
||||
}
|
||||
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("DealID"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := cw.WriteString(string("DealID")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.DealID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// t.PublishCid (cid.Cid) (struct)
|
||||
if len("PublishCid") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"PublishCid\" was too long")
|
||||
}
|
||||
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PublishCid"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := cw.WriteString(string("PublishCid")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if t.PublishCid == nil {
|
||||
if _, err := cw.Write(cbg.CborNull); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := cbg.WriteCid(cw, *t.PublishCid); err != nil {
|
||||
return xerrors.Errorf("failed to write cid field t.PublishCid: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// t.DealProposal (market.DealProposal) (struct)
|
||||
if len("DealProposal") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"DealProposal\" was too long")
|
||||
}
|
||||
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("DealProposal"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := cw.WriteString(string("DealProposal")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := t.DealProposal.MarshalCBOR(cw); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// t.DealSchedule (api.DealSchedule) (struct)
|
||||
if len("DealSchedule") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"DealSchedule\" was too long")
|
||||
}
|
||||
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("DealSchedule"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := cw.WriteString(string("DealSchedule")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := t.DealSchedule.MarshalCBOR(cw); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// t.KeepUnsealed (bool) (bool)
|
||||
if len("KeepUnsealed") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"KeepUnsealed\" was too long")
|
||||
}
|
||||
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("KeepUnsealed"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := cw.WriteString(string("KeepUnsealed")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := cbg.WriteBool(w, t.KeepUnsealed); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
*t = PieceDealInfo{}
|
||||
|
||||
cr := cbg.NewCborReader(r)
|
||||
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err == io.EOF {
|
||||
err = io.ErrUnexpectedEOF
|
||||
}
|
||||
}()
|
||||
|
||||
if maj != cbg.MajMap {
|
||||
return fmt.Errorf("cbor input should be of type map")
|
||||
}
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("PieceDealInfo: map struct too large (%d)", extra)
|
||||
}
|
||||
|
||||
var name string
|
||||
n := extra
|
||||
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadString(cr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
name = string(sval)
|
||||
}
|
||||
|
||||
switch name {
|
||||
// t.DealID (abi.DealID) (uint64)
|
||||
case "DealID":
|
||||
|
||||
{
|
||||
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if maj != cbg.MajUnsignedInt {
|
||||
return fmt.Errorf("wrong type for uint64 field")
|
||||
}
|
||||
t.DealID = abi.DealID(extra)
|
||||
|
||||
}
|
||||
// t.PublishCid (cid.Cid) (struct)
|
||||
case "PublishCid":
|
||||
|
||||
{
|
||||
|
||||
b, err := cr.ReadByte()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if b != cbg.CborNull[0] {
|
||||
if err := cr.UnreadByte(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c, err := cbg.ReadCid(cr)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to read cid field t.PublishCid: %w", err)
|
||||
}
|
||||
|
||||
t.PublishCid = &c
|
||||
}
|
||||
|
||||
}
|
||||
// t.DealProposal (market.DealProposal) (struct)
|
||||
case "DealProposal":
|
||||
|
||||
{
|
||||
|
||||
b, err := cr.ReadByte()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if b != cbg.CborNull[0] {
|
||||
if err := cr.UnreadByte(); err != nil {
|
||||
return err
|
||||
}
|
||||
t.DealProposal = new(market.DealProposal)
|
||||
if err := t.DealProposal.UnmarshalCBOR(cr); err != nil {
|
||||
return xerrors.Errorf("unmarshaling t.DealProposal pointer: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// t.DealSchedule (api.DealSchedule) (struct)
|
||||
case "DealSchedule":
|
||||
|
||||
{
|
||||
|
||||
if err := t.DealSchedule.UnmarshalCBOR(cr); err != nil {
|
||||
return xerrors.Errorf("unmarshaling t.DealSchedule: %w", err)
|
||||
}
|
||||
|
||||
}
|
||||
// t.KeepUnsealed (bool) (bool)
|
||||
case "KeepUnsealed":
|
||||
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if maj != cbg.MajOther {
|
||||
return fmt.Errorf("booleans must be major type 7")
|
||||
}
|
||||
switch extra {
|
||||
case 20:
|
||||
t.KeepUnsealed = false
|
||||
case 21:
|
||||
t.KeepUnsealed = true
|
||||
default:
|
||||
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
|
||||
}
|
||||
|
||||
default:
|
||||
// Field doesn't exist on this type, so ignore it
|
||||
cbg.ScanForLinks(r, func(cid.Cid) {})
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
func (t *SectorPiece) MarshalCBOR(w io.Writer) error {
|
||||
if t == nil {
|
||||
_, err := w.Write(cbg.CborNull)
|
||||
@ -1048,7 +821,7 @@ func (t *SectorPiece) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Piece (abi.PieceInfo) (struct)
|
||||
if len("Piece") > cbg.MaxLength {
|
||||
if len("Piece") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"Piece\" was too long")
|
||||
}
|
||||
|
||||
@ -1063,8 +836,8 @@ func (t *SectorPiece) MarshalCBOR(w io.Writer) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// t.DealInfo (api.PieceDealInfo) (struct)
|
||||
if len("DealInfo") > cbg.MaxLength {
|
||||
// t.DealInfo (piece.PieceDealInfo) (struct)
|
||||
if len("DealInfo") > 8192 {
|
||||
return xerrors.Errorf("Value in field \"DealInfo\" was too long")
|
||||
}
|
||||
|
||||
@ -1110,7 +883,7 @@ func (t *SectorPiece) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadString(cr)
|
||||
sval, err := cbg.ReadStringWithMax(cr, 8192)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -1129,7 +902,7 @@ func (t *SectorPiece) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
}
|
||||
|
||||
}
|
||||
// t.DealInfo (api.PieceDealInfo) (struct)
|
||||
// t.DealInfo (piece.PieceDealInfo) (struct)
|
||||
case "DealInfo":
|
||||
|
||||
{
|
||||
@ -1142,7 +915,7 @@ func (t *SectorPiece) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
if err := cr.UnreadByte(); err != nil {
|
||||
return err
|
||||
}
|
||||
t.DealInfo = new(PieceDealInfo)
|
||||
t.DealInfo = new(piece.PieceDealInfo)
|
||||
if err := t.DealInfo.UnmarshalCBOR(cr); err != nil {
|
||||
return xerrors.Errorf("unmarshaling t.DealInfo pointer: %w", err)
|
||||
}
|
||||
@ -1158,160 +931,3 @@ func (t *SectorPiece) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
|
||||
return nil
|
||||
}
|
||||
func (t *DealSchedule) MarshalCBOR(w io.Writer) error {
|
||||
if t == nil {
|
||||
_, err := w.Write(cbg.CborNull)
|
||||
return err
|
||||
}
|
||||
|
||||
cw := cbg.NewCborWriter(w)
|
||||
|
||||
if _, err := cw.Write([]byte{162}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// t.EndEpoch (abi.ChainEpoch) (int64)
|
||||
if len("EndEpoch") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"EndEpoch\" was too long")
|
||||
}
|
||||
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("EndEpoch"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := cw.WriteString(string("EndEpoch")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if t.EndEpoch >= 0 {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.EndEpoch)); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.EndEpoch-1)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// t.StartEpoch (abi.ChainEpoch) (int64)
|
||||
if len("StartEpoch") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"StartEpoch\" was too long")
|
||||
}
|
||||
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("StartEpoch"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := cw.WriteString(string("StartEpoch")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if t.StartEpoch >= 0 {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StartEpoch)); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StartEpoch-1)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *DealSchedule) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
*t = DealSchedule{}
|
||||
|
||||
cr := cbg.NewCborReader(r)
|
||||
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err == io.EOF {
|
||||
err = io.ErrUnexpectedEOF
|
||||
}
|
||||
}()
|
||||
|
||||
if maj != cbg.MajMap {
|
||||
return fmt.Errorf("cbor input should be of type map")
|
||||
}
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
return fmt.Errorf("DealSchedule: map struct too large (%d)", extra)
|
||||
}
|
||||
|
||||
var name string
|
||||
n := extra
|
||||
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadString(cr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
name = string(sval)
|
||||
}
|
||||
|
||||
switch name {
|
||||
// t.EndEpoch (abi.ChainEpoch) (int64)
|
||||
case "EndEpoch":
|
||||
{
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
var extraI int64
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
switch maj {
|
||||
case cbg.MajUnsignedInt:
|
||||
extraI = int64(extra)
|
||||
if extraI < 0 {
|
||||
return fmt.Errorf("int64 positive overflow")
|
||||
}
|
||||
case cbg.MajNegativeInt:
|
||||
extraI = int64(extra)
|
||||
if extraI < 0 {
|
||||
return fmt.Errorf("int64 negative overflow")
|
||||
}
|
||||
extraI = -1 - extraI
|
||||
default:
|
||||
return fmt.Errorf("wrong type for int64 field: %d", maj)
|
||||
}
|
||||
|
||||
t.EndEpoch = abi.ChainEpoch(extraI)
|
||||
}
|
||||
// t.StartEpoch (abi.ChainEpoch) (int64)
|
||||
case "StartEpoch":
|
||||
{
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
var extraI int64
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
switch maj {
|
||||
case cbg.MajUnsignedInt:
|
||||
extraI = int64(extra)
|
||||
if extraI < 0 {
|
||||
return fmt.Errorf("int64 positive overflow")
|
||||
}
|
||||
case cbg.MajNegativeInt:
|
||||
extraI = int64(extra)
|
||||
if extraI < 0 {
|
||||
return fmt.Errorf("int64 negative overflow")
|
||||
}
|
||||
extraI = -1 - extraI
|
||||
default:
|
||||
return fmt.Errorf("wrong type for int64 field: %d", maj)
|
||||
}
|
||||
|
||||
t.StartEpoch = abi.ChainEpoch(extraI)
|
||||
}
|
||||
|
||||
default:
|
||||
// Field doesn't exist on this type, so ignore it
|
||||
cbg.ScanForLinks(r, func(cid.Cid) {})
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -32,7 +32,6 @@ import (
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/go-jsonrpc/auth"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v12/miner"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
"github.com/filecoin-project/go-state-types/exitcode"
|
||||
@ -41,6 +40,7 @@ import (
|
||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||
"github.com/filecoin-project/lotus/api/v0api"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/chain/types/ethtypes"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
@ -404,6 +404,32 @@ func init() {
|
||||
percent := types.Percent(123)
|
||||
addExample(percent)
|
||||
addExample(&percent)
|
||||
|
||||
addExample(&miner.PieceActivationManifest{
|
||||
CID: c,
|
||||
Size: 2032,
|
||||
VerifiedAllocationKey: nil,
|
||||
Notify: nil,
|
||||
})
|
||||
|
||||
addExample(&types.ActorEventBlock{
|
||||
Codec: 0x51,
|
||||
Value: []byte("ddata"),
|
||||
})
|
||||
|
||||
addExample(&types.ActorEventFilter{
|
||||
Addresses: []address.Address{addr},
|
||||
Fields: map[string][]types.ActorEventBlock{
|
||||
"abc": {
|
||||
{
|
||||
Codec: 0x51,
|
||||
Value: []byte("ddata"),
|
||||
},
|
||||
},
|
||||
},
|
||||
FromHeight: epochPtr(1010),
|
||||
ToHeight: epochPtr(1020),
|
||||
})
|
||||
}
|
||||
|
||||
func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {
|
||||
@ -509,6 +535,11 @@ func exampleStruct(method string, t, parent reflect.Type) interface{} {
|
||||
return ns.Interface()
|
||||
}
|
||||
|
||||
func epochPtr(ei int64) *abi.ChainEpoch {
|
||||
ep := abi.ChainEpoch(ei)
|
||||
return &ep
|
||||
}
|
||||
|
||||
type Visitor struct {
|
||||
Root string
|
||||
Methods map[string]ast.Node
|
||||
|
@ -27,7 +27,7 @@ import (
|
||||
auth "github.com/filecoin-project/go-jsonrpc/auth"
|
||||
abi "github.com/filecoin-project/go-state-types/abi"
|
||||
big "github.com/filecoin-project/go-state-types/big"
|
||||
miner "github.com/filecoin-project/go-state-types/builtin/v12/miner"
|
||||
miner "github.com/filecoin-project/go-state-types/builtin/v13/miner"
|
||||
paych "github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
miner0 "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
verifreg "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
@ -1627,6 +1627,21 @@ func (mr *MockFullNodeMockRecorder) GasEstimateMessageGas(arg0, arg1, arg2, arg3
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasEstimateMessageGas", reflect.TypeOf((*MockFullNode)(nil).GasEstimateMessageGas), arg0, arg1, arg2, arg3)
|
||||
}
|
||||
|
||||
// GetActorEvents mocks base method.
|
||||
func (m *MockFullNode) GetActorEvents(arg0 context.Context, arg1 *types.ActorEventFilter) ([]*types.ActorEvent, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetActorEvents", arg0, arg1)
|
||||
ret0, _ := ret[0].([]*types.ActorEvent)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetActorEvents indicates an expected call of GetActorEvents.
|
||||
func (mr *MockFullNodeMockRecorder) GetActorEvents(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetActorEvents", reflect.TypeOf((*MockFullNode)(nil).GetActorEvents), arg0, arg1)
|
||||
}
|
||||
|
||||
// ID mocks base method.
|
||||
func (m *MockFullNode) ID(arg0 context.Context) (peer.ID, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@ -3159,6 +3174,36 @@ func (mr *MockFullNodeMockRecorder) StateGetActor(arg0, arg1, arg2 interface{})
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateGetAllAllocations mocks base method.
|
||||
func (m *MockFullNode) StateGetAllAllocations(arg0 context.Context, arg1 types.TipSetKey) (map[verifreg.AllocationId]verifreg.Allocation, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateGetAllAllocations", arg0, arg1)
|
||||
ret0, _ := ret[0].(map[verifreg.AllocationId]verifreg.Allocation)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateGetAllAllocations indicates an expected call of StateGetAllAllocations.
|
||||
func (mr *MockFullNodeMockRecorder) StateGetAllAllocations(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllAllocations", reflect.TypeOf((*MockFullNode)(nil).StateGetAllAllocations), arg0, arg1)
|
||||
}
|
||||
|
||||
// StateGetAllClaims mocks base method.
|
||||
func (m *MockFullNode) StateGetAllClaims(arg0 context.Context, arg1 types.TipSetKey) (map[verifreg.ClaimId]verifreg.Claim, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateGetAllClaims", arg0, arg1)
|
||||
ret0, _ := ret[0].(map[verifreg.ClaimId]verifreg.Claim)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateGetAllClaims indicates an expected call of StateGetAllClaims.
|
||||
func (mr *MockFullNodeMockRecorder) StateGetAllClaims(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllClaims", reflect.TypeOf((*MockFullNode)(nil).StateGetAllClaims), arg0, arg1)
|
||||
}
|
||||
|
||||
// StateGetAllocation mocks base method.
|
||||
func (m *MockFullNode) StateGetAllocation(arg0 context.Context, arg1 address.Address, arg2 verifreg.AllocationId, arg3 types.TipSetKey) (*verifreg.Allocation, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@ -3189,6 +3234,21 @@ func (mr *MockFullNodeMockRecorder) StateGetAllocationForPendingDeal(arg0, arg1,
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllocationForPendingDeal", reflect.TypeOf((*MockFullNode)(nil).StateGetAllocationForPendingDeal), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateGetAllocationIdForPendingDeal mocks base method.
|
||||
func (m *MockFullNode) StateGetAllocationIdForPendingDeal(arg0 context.Context, arg1 abi.DealID, arg2 types.TipSetKey) (verifreg.AllocationId, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateGetAllocationIdForPendingDeal", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(verifreg.AllocationId)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateGetAllocationIdForPendingDeal indicates an expected call of StateGetAllocationIdForPendingDeal.
|
||||
func (mr *MockFullNodeMockRecorder) StateGetAllocationIdForPendingDeal(arg0, arg1, arg2 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllocationIdForPendingDeal", reflect.TypeOf((*MockFullNode)(nil).StateGetAllocationIdForPendingDeal), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateGetAllocations mocks base method.
|
||||
func (m *MockFullNode) StateGetAllocations(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (map[verifreg.AllocationId]verifreg.Allocation, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@ -3894,6 +3954,21 @@ func (mr *MockFullNodeMockRecorder) StateWaitMsg(arg0, arg1, arg2, arg3, arg4 in
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateWaitMsg", reflect.TypeOf((*MockFullNode)(nil).StateWaitMsg), arg0, arg1, arg2, arg3, arg4)
|
||||
}
|
||||
|
||||
// SubscribeActorEvents mocks base method.
|
||||
func (m *MockFullNode) SubscribeActorEvents(arg0 context.Context, arg1 *types.ActorEventFilter) (<-chan *types.ActorEvent, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "SubscribeActorEvents", arg0, arg1)
|
||||
ret0, _ := ret[0].(<-chan *types.ActorEvent)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// SubscribeActorEvents indicates an expected call of SubscribeActorEvents.
|
||||
func (mr *MockFullNodeMockRecorder) SubscribeActorEvents(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeActorEvents", reflect.TypeOf((*MockFullNode)(nil).SubscribeActorEvents), arg0, arg1)
|
||||
}
|
||||
|
||||
// SyncCheckBad mocks base method.
|
||||
func (m *MockFullNode) SyncCheckBad(arg0 context.Context, arg1 cid.Cid) (string, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
@ -37,11 +37,13 @@ import (
|
||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||
builtinactors "github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/verifreg"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/chain/types/ethtypes"
|
||||
"github.com/filecoin-project/lotus/journal/alerting"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
"github.com/filecoin-project/lotus/node/repo/imports"
|
||||
"github.com/filecoin-project/lotus/storage/pipeline/piece"
|
||||
"github.com/filecoin-project/lotus/storage/pipeline/sealiface"
|
||||
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
|
||||
"github.com/filecoin-project/lotus/storage/sealer/sealtasks"
|
||||
@ -335,6 +337,8 @@ type FullNodeMethods struct {
|
||||
|
||||
GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) `perm:"read"`
|
||||
|
||||
GetActorEvents func(p0 context.Context, p1 *types.ActorEventFilter) ([]*types.ActorEvent, error) `perm:"read"`
|
||||
|
||||
MarketAddBalance func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) `perm:"sign"`
|
||||
|
||||
MarketGetReserved func(p0 context.Context, p1 address.Address) (types.BigInt, error) `perm:"sign"`
|
||||
@ -481,10 +485,16 @@ type FullNodeMethods struct {
|
||||
|
||||
StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"`
|
||||
|
||||
StateGetAllAllocations func(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) `perm:"read"`
|
||||
|
||||
StateGetAllClaims func(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) `perm:"read"`
|
||||
|
||||
StateGetAllocation func(p0 context.Context, p1 address.Address, p2 verifregtypes.AllocationId, p3 types.TipSetKey) (*verifregtypes.Allocation, error) `perm:"read"`
|
||||
|
||||
StateGetAllocationForPendingDeal func(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*verifregtypes.Allocation, error) `perm:"read"`
|
||||
|
||||
StateGetAllocationIdForPendingDeal func(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (verifreg.AllocationId, error) `perm:"read"`
|
||||
|
||||
StateGetAllocations func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) `perm:"read"`
|
||||
|
||||
StateGetBeaconEntry func(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) `perm:"read"`
|
||||
@ -579,6 +589,8 @@ type FullNodeMethods struct {
|
||||
|
||||
StateWaitMsg func(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) `perm:"read"`
|
||||
|
||||
SubscribeActorEvents func(p0 context.Context, p1 *types.ActorEventFilter) (<-chan *types.ActorEvent, error) `perm:"read"`
|
||||
|
||||
SyncCheckBad func(p0 context.Context, p1 cid.Cid) (string, error) `perm:"read"`
|
||||
|
||||
SyncCheckpoint func(p0 context.Context, p1 types.TipSetKey) error `perm:"admin"`
|
||||
@ -745,6 +757,8 @@ type GatewayMethods struct {
|
||||
|
||||
GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) ``
|
||||
|
||||
GetActorEvents func(p0 context.Context, p1 *types.ActorEventFilter) ([]*types.ActorEvent, error) ``
|
||||
|
||||
MinerGetBaseInfo func(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*MiningBaseInfo, error) ``
|
||||
|
||||
MpoolGetNonce func(p0 context.Context, p1 address.Address) (uint64, error) ``
|
||||
@ -819,6 +833,8 @@ type GatewayMethods struct {
|
||||
|
||||
StateWaitMsg func(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) ``
|
||||
|
||||
SubscribeActorEvents func(p0 context.Context, p1 *types.ActorEventFilter) (<-chan *types.ActorEvent, error) ``
|
||||
|
||||
Version func(p0 context.Context) (APIVersion, error) ``
|
||||
|
||||
WalletBalance func(p0 context.Context, p1 address.Address) (types.BigInt, error) ``
|
||||
@ -1099,7 +1115,7 @@ type StorageMinerMethods struct {
|
||||
|
||||
SectorAbortUpgrade func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"`
|
||||
|
||||
SectorAddPieceToAny func(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storiface.Data, p3 PieceDealInfo) (SectorOffset, error) `perm:"admin"`
|
||||
SectorAddPieceToAny func(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storiface.Data, p3 piece.PieceDealInfo) (SectorOffset, error) `perm:"admin"`
|
||||
|
||||
SectorCommitFlush func(p0 context.Context) ([]sealiface.CommitBatchRes, error) `perm:"admin"`
|
||||
|
||||
@ -2590,6 +2606,17 @@ func (s *FullNodeStub) GasEstimateMessageGas(p0 context.Context, p1 *types.Messa
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) GetActorEvents(p0 context.Context, p1 *types.ActorEventFilter) ([]*types.ActorEvent, error) {
|
||||
if s.Internal.GetActorEvents == nil {
|
||||
return *new([]*types.ActorEvent), ErrNotSupported
|
||||
}
|
||||
return s.Internal.GetActorEvents(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) GetActorEvents(p0 context.Context, p1 *types.ActorEventFilter) ([]*types.ActorEvent, error) {
|
||||
return *new([]*types.ActorEvent), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) MarketAddBalance(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) {
|
||||
if s.Internal.MarketAddBalance == nil {
|
||||
return *new(cid.Cid), ErrNotSupported
|
||||
@ -3393,6 +3420,28 @@ func (s *FullNodeStub) StateGetActor(p0 context.Context, p1 address.Address, p2
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetAllAllocations(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) {
|
||||
if s.Internal.StateGetAllAllocations == nil {
|
||||
return *new(map[verifregtypes.AllocationId]verifregtypes.Allocation), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateGetAllAllocations(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateGetAllAllocations(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) {
|
||||
return *new(map[verifregtypes.AllocationId]verifregtypes.Allocation), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetAllClaims(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) {
|
||||
if s.Internal.StateGetAllClaims == nil {
|
||||
return *new(map[verifregtypes.ClaimId]verifregtypes.Claim), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateGetAllClaims(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateGetAllClaims(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) {
|
||||
return *new(map[verifregtypes.ClaimId]verifregtypes.Claim), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetAllocation(p0 context.Context, p1 address.Address, p2 verifregtypes.AllocationId, p3 types.TipSetKey) (*verifregtypes.Allocation, error) {
|
||||
if s.Internal.StateGetAllocation == nil {
|
||||
return nil, ErrNotSupported
|
||||
@ -3415,6 +3464,17 @@ func (s *FullNodeStub) StateGetAllocationForPendingDeal(p0 context.Context, p1 a
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetAllocationIdForPendingDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (verifreg.AllocationId, error) {
|
||||
if s.Internal.StateGetAllocationIdForPendingDeal == nil {
|
||||
return *new(verifreg.AllocationId), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateGetAllocationIdForPendingDeal(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateGetAllocationIdForPendingDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (verifreg.AllocationId, error) {
|
||||
return *new(verifreg.AllocationId), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetAllocations(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) {
|
||||
if s.Internal.StateGetAllocations == nil {
|
||||
return *new(map[verifregtypes.AllocationId]verifregtypes.Allocation), ErrNotSupported
|
||||
@ -3932,6 +3992,17 @@ func (s *FullNodeStub) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64, p
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) SubscribeActorEvents(p0 context.Context, p1 *types.ActorEventFilter) (<-chan *types.ActorEvent, error) {
|
||||
if s.Internal.SubscribeActorEvents == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.SubscribeActorEvents(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) SubscribeActorEvents(p0 context.Context, p1 *types.ActorEventFilter) (<-chan *types.ActorEvent, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) SyncCheckBad(p0 context.Context, p1 cid.Cid) (string, error) {
|
||||
if s.Internal.SyncCheckBad == nil {
|
||||
return "", ErrNotSupported
|
||||
@ -4779,6 +4850,17 @@ func (s *GatewayStub) GasEstimateMessageGas(p0 context.Context, p1 *types.Messag
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) GetActorEvents(p0 context.Context, p1 *types.ActorEventFilter) ([]*types.ActorEvent, error) {
|
||||
if s.Internal.GetActorEvents == nil {
|
||||
return *new([]*types.ActorEvent), ErrNotSupported
|
||||
}
|
||||
return s.Internal.GetActorEvents(p0, p1)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) GetActorEvents(p0 context.Context, p1 *types.ActorEventFilter) ([]*types.ActorEvent, error) {
|
||||
return *new([]*types.ActorEvent), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) MinerGetBaseInfo(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*MiningBaseInfo, error) {
|
||||
if s.Internal.MinerGetBaseInfo == nil {
|
||||
return nil, ErrNotSupported
|
||||
@ -5186,6 +5268,17 @@ func (s *GatewayStub) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64, p3
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) SubscribeActorEvents(p0 context.Context, p1 *types.ActorEventFilter) (<-chan *types.ActorEvent, error) {
|
||||
if s.Internal.SubscribeActorEvents == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.SubscribeActorEvents(p0, p1)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) SubscribeActorEvents(p0 context.Context, p1 *types.ActorEventFilter) (<-chan *types.ActorEvent, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) Version(p0 context.Context) (APIVersion, error) {
|
||||
if s.Internal.Version == nil {
|
||||
return *new(APIVersion), ErrNotSupported
|
||||
@ -6506,14 +6599,14 @@ func (s *StorageMinerStub) SectorAbortUpgrade(p0 context.Context, p1 abi.SectorN
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) SectorAddPieceToAny(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storiface.Data, p3 PieceDealInfo) (SectorOffset, error) {
|
||||
func (s *StorageMinerStruct) SectorAddPieceToAny(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storiface.Data, p3 piece.PieceDealInfo) (SectorOffset, error) {
|
||||
if s.Internal.SectorAddPieceToAny == nil {
|
||||
return *new(SectorOffset), ErrNotSupported
|
||||
}
|
||||
return s.Internal.SectorAddPieceToAny(p0, p1, p2, p3)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) SectorAddPieceToAny(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storiface.Data, p3 PieceDealInfo) (SectorOffset, error) {
|
||||
func (s *StorageMinerStub) SectorAddPieceToAny(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storiface.Data, p3 piece.PieceDealInfo) (SectorOffset, error) {
|
||||
return *new(SectorOffset), ErrNotSupported
|
||||
}
|
||||
|
||||
|
@ -344,6 +344,8 @@ type ForkUpgradeParams struct {
|
||||
UpgradeLightningHeight abi.ChainEpoch
|
||||
UpgradeThunderHeight abi.ChainEpoch
|
||||
UpgradeWatermelonHeight abi.ChainEpoch
|
||||
UpgradeDragonHeight abi.ChainEpoch
|
||||
UpgradePhoenixHeight abi.ChainEpoch
|
||||
}
|
||||
|
||||
// ChainExportConfig holds configuration for chain ranged exports.
|
||||
|
@ -537,10 +537,14 @@ type FullNode interface {
|
||||
StateGetAllocation(ctx context.Context, clientAddr address.Address, allocationId verifregtypes.AllocationId, tsk types.TipSetKey) (*verifregtypes.Allocation, error) //perm:read
|
||||
// StateGetAllocations returns the all the allocations for a given client.
|
||||
StateGetAllocations(ctx context.Context, clientAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) //perm:read
|
||||
// StateGetAllAllocations returns the all the allocations available in verified registry actor.
|
||||
StateGetAllAllocations(ctx context.Context, tsk types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) //perm:read
|
||||
// StateGetClaim returns the claim for a given address and claim ID.
|
||||
StateGetClaim(ctx context.Context, providerAddr address.Address, claimId verifregtypes.ClaimId, tsk types.TipSetKey) (*verifregtypes.Claim, error) //perm:read
|
||||
// StateGetClaims returns the all the claims for a given provider.
|
||||
StateGetClaims(ctx context.Context, providerAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) //perm:read
|
||||
// StateGetAllClaims returns the all the claims available in verified registry actor.
|
||||
StateGetAllClaims(ctx context.Context, tsk types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) //perm:read
|
||||
// StateLookupID retrieves the ID address of the given address
|
||||
StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
|
||||
// StateAccountKey returns the public key address of the given ID address
|
||||
|
@ -280,6 +280,10 @@ type FullNodeMethods struct {
|
||||
|
||||
StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"`
|
||||
|
||||
StateGetAllAllocations func(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) `perm:"read"`
|
||||
|
||||
StateGetAllClaims func(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) `perm:"read"`
|
||||
|
||||
StateGetAllocation func(p0 context.Context, p1 address.Address, p2 verifregtypes.AllocationId, p3 types.TipSetKey) (*verifregtypes.Allocation, error) `perm:"read"`
|
||||
|
||||
StateGetAllocationForPendingDeal func(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*verifregtypes.Allocation, error) `perm:"read"`
|
||||
@ -1837,6 +1841,28 @@ func (s *FullNodeStub) StateGetActor(p0 context.Context, p1 address.Address, p2
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetAllAllocations(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) {
|
||||
if s.Internal.StateGetAllAllocations == nil {
|
||||
return *new(map[verifregtypes.AllocationId]verifregtypes.Allocation), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateGetAllAllocations(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateGetAllAllocations(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error) {
|
||||
return *new(map[verifregtypes.AllocationId]verifregtypes.Allocation), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetAllClaims(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) {
|
||||
if s.Internal.StateGetAllClaims == nil {
|
||||
return *new(map[verifregtypes.ClaimId]verifregtypes.Claim), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateGetAllClaims(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateGetAllClaims(p0 context.Context, p1 types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error) {
|
||||
return *new(map[verifregtypes.ClaimId]verifregtypes.Claim), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetAllocation(p0 context.Context, p1 address.Address, p2 verifregtypes.AllocationId, p3 types.TipSetKey) (*verifregtypes.Allocation, error) {
|
||||
if s.Internal.StateGetAllocation == nil {
|
||||
return nil, ErrNotSupported
|
||||
|
@ -26,7 +26,7 @@ import (
|
||||
auth "github.com/filecoin-project/go-jsonrpc/auth"
|
||||
abi "github.com/filecoin-project/go-state-types/abi"
|
||||
big "github.com/filecoin-project/go-state-types/big"
|
||||
miner "github.com/filecoin-project/go-state-types/builtin/v12/miner"
|
||||
miner "github.com/filecoin-project/go-state-types/builtin/v13/miner"
|
||||
paych "github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
miner0 "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
verifreg "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
@ -2339,6 +2339,36 @@ func (mr *MockFullNodeMockRecorder) StateGetActor(arg0, arg1, arg2 interface{})
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateGetAllAllocations mocks base method.
|
||||
func (m *MockFullNode) StateGetAllAllocations(arg0 context.Context, arg1 types.TipSetKey) (map[verifreg.AllocationId]verifreg.Allocation, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateGetAllAllocations", arg0, arg1)
|
||||
ret0, _ := ret[0].(map[verifreg.AllocationId]verifreg.Allocation)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateGetAllAllocations indicates an expected call of StateGetAllAllocations.
|
||||
func (mr *MockFullNodeMockRecorder) StateGetAllAllocations(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllAllocations", reflect.TypeOf((*MockFullNode)(nil).StateGetAllAllocations), arg0, arg1)
|
||||
}
|
||||
|
||||
// StateGetAllClaims mocks base method.
|
||||
func (m *MockFullNode) StateGetAllClaims(arg0 context.Context, arg1 types.TipSetKey) (map[verifreg.ClaimId]verifreg.Claim, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateGetAllClaims", arg0, arg1)
|
||||
ret0, _ := ret[0].(map[verifreg.ClaimId]verifreg.Claim)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateGetAllClaims indicates an expected call of StateGetAllClaims.
|
||||
func (mr *MockFullNodeMockRecorder) StateGetAllClaims(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllClaims", reflect.TypeOf((*MockFullNode)(nil).StateGetAllClaims), arg0, arg1)
|
||||
}
|
||||
|
||||
// StateGetAllocation mocks base method.
|
||||
func (m *MockFullNode) StateGetAllocation(arg0 context.Context, arg1 address.Address, arg2 verifreg.AllocationId, arg3 types.TipSetKey) (*verifreg.Allocation, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
@ -44,7 +44,7 @@ func (t *NetRpcReq) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Cid ([]cid.Cid) (slice)
|
||||
if len(t.Cid) > cbg.MaxLength {
|
||||
if len(t.Cid) > 8192 {
|
||||
return xerrors.Errorf("Slice value in field t.Cid was too long")
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ func (t *NetRpcReq) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Data ([][]uint8) (slice)
|
||||
if len(t.Data) > cbg.MaxLength {
|
||||
if len(t.Data) > 8192 {
|
||||
return xerrors.Errorf("Slice value in field t.Data was too long")
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ func (t *NetRpcReq) MarshalCBOR(w io.Writer) error {
|
||||
return err
|
||||
}
|
||||
for _, v := range t.Data {
|
||||
if len(v) > cbg.ByteArrayMaxLen {
|
||||
if len(v) > 2097152 {
|
||||
return xerrors.Errorf("Byte array in field v was too long")
|
||||
}
|
||||
|
||||
@ -76,9 +76,10 @@ func (t *NetRpcReq) MarshalCBOR(w io.Writer) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := cw.Write(v[:]); err != nil {
|
||||
if _, err := cw.Write(v); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -140,7 +141,7 @@ func (t *NetRpcReq) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
if extra > 8192 {
|
||||
return fmt.Errorf("t.Cid: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@ -171,9 +172,9 @@ func (t *NetRpcReq) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
t.Cid[i] = c
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// t.Data ([][]uint8) (slice)
|
||||
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
@ -181,7 +182,7 @@ func (t *NetRpcReq) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if extra > cbg.MaxLength {
|
||||
if extra > 8192 {
|
||||
return fmt.Errorf("t.Data: array too large (%d)", extra)
|
||||
}
|
||||
|
||||
@ -207,7 +208,7 @@ func (t *NetRpcReq) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if extra > cbg.ByteArrayMaxLen {
|
||||
if extra > 2097152 {
|
||||
return fmt.Errorf("t.Data[i]: byte array too large (%d)", extra)
|
||||
}
|
||||
if maj != cbg.MajByteString {
|
||||
@ -218,12 +219,12 @@ func (t *NetRpcReq) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
t.Data[i] = make([]uint8, extra)
|
||||
}
|
||||
|
||||
if _, err := io.ReadFull(cr, t.Data[i][:]); err != nil {
|
||||
if _, err := io.ReadFull(cr, t.Data[i]); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -253,7 +254,7 @@ func (t *NetRpcResp) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Data ([]uint8) (slice)
|
||||
if len(t.Data) > cbg.ByteArrayMaxLen {
|
||||
if len(t.Data) > 2097152 {
|
||||
return xerrors.Errorf("Byte array in field t.Data was too long")
|
||||
}
|
||||
|
||||
@ -261,9 +262,10 @@ func (t *NetRpcResp) MarshalCBOR(w io.Writer) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := cw.Write(t.Data[:]); err != nil {
|
||||
if _, err := cw.Write(t.Data); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -324,7 +326,7 @@ func (t *NetRpcResp) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if extra > cbg.ByteArrayMaxLen {
|
||||
if extra > 2097152 {
|
||||
return fmt.Errorf("t.Data: byte array too large (%d)", extra)
|
||||
}
|
||||
if maj != cbg.MajByteString {
|
||||
@ -335,9 +337,10 @@ func (t *NetRpcResp) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
t.Data = make([]uint8, extra)
|
||||
}
|
||||
|
||||
if _, err := io.ReadFull(cr, t.Data[:]); err != nil {
|
||||
if _, err := io.ReadFull(cr, t.Data); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -361,7 +364,7 @@ func (t *NetRpcErr) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
// t.Msg (string) (string)
|
||||
if len(t.Msg) > cbg.MaxLength {
|
||||
if len(t.Msg) > 8192 {
|
||||
return xerrors.Errorf("Value in field t.Msg was too long")
|
||||
}
|
||||
|
||||
@ -426,7 +429,7 @@ func (t *NetRpcErr) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
// t.Msg (string) (string)
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadString(cr)
|
||||
sval, err := cbg.ReadStringWithMax(cr, 8192)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
BIN
build/actors/v13.tar.zst
Normal file
BIN
build/actors/v13.tar.zst
Normal file
Binary file not shown.
@ -97,7 +97,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "butterflynet",
|
||||
Version: 12,
|
||||
BundleGitTag: "v12.0.0",
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzacectxvbk77ntedhztd6sszp2btrtvsmy7lp2ypnrk6yl74zb34t2cq"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacebp7anjdtg2sohyt6lromx4xs7nujtwdfcsffnptphaayabx7ysxs"),
|
||||
@ -117,6 +117,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacec3vwj2chzaram3iqupkbfiein5h2l5qiltlrngbju2vg5umelclm"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacedv2irkql7nil3w5v3ohqq3e54w62pxeoppjmaktzokolaaoh5ksu"),
|
||||
},
|
||||
}, {
|
||||
Network: "butterflynet",
|
||||
Version: 13,
|
||||
BundleGitTag: "v13.0.0-rc.3",
|
||||
ManifestCid: MustParseCid("bafy2bzaceaqx5xa4cwso24rjiu2ketjlztrqlac6dkyol7tlyuhzrle3zfbos"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacedl533kwbzouqxibejpwp6syfdekvmzy4vmmno6j4iaydbdmv4xek"),
|
||||
"cron": MustParseCid("bafk2bzacecimv5xnuwyoqgxk26qt4xqpgntleret475pnh35s3vvhqtdct4ow"),
|
||||
"datacap": MustParseCid("bafk2bzacebpdd4ctavhs7wkcykfahpifct3p4hbptgtf4jfrqcp2trtlygvow"),
|
||||
"eam": MustParseCid("bafk2bzaceahw5rrgj7prgbnmn237di7ymjz2ssea32wr525jydpfrwpuhs67m"),
|
||||
"ethaccount": MustParseCid("bafk2bzacebrslcbew5mq3le2zsn36xqxd4gt5hryeoslxnuqwgw3rhuwh6ygu"),
|
||||
"evm": MustParseCid("bafk2bzaced5smz4lhpem4mbr7igcskv3e5qopbdp7dqshww2qs4ahacgzjzo4"),
|
||||
"init": MustParseCid("bafk2bzacedgj6hawhdw2ot2ufisci374o2bq6bfkvlvdt6q7s3uoe5ffyv43k"),
|
||||
"multisig": MustParseCid("bafk2bzacectnnnpwyqiccaymy3h6ghu74ghjrqyhtqv5odfd4opivzebjj6to"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceckhx44jawhzhkz6k23gfnv2gcutgb4j4ekhonj2plwaent4b2tpk"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacebbs3rlg7y3wbvxrj4wgbsqmasw4ksbbr3lyqbkaxj2t25qz6zzuy"),
|
||||
"storagemarket": MustParseCid("bafk2bzaced3zmxsmlhp2nsiwkxcp2ugonbsebcd53t7htzo2jcoidvu464xmm"),
|
||||
"storageminer": MustParseCid("bafk2bzacebedx7iaa2ruspxvghkg46ez7un5b7oiijjtnvddq2aot5wk7p7ry"),
|
||||
"storagepower": MustParseCid("bafk2bzacebvne7m2l3hxxw4xa6oujol75x35yqpnlqiwx74jilyrop4cs7cse"),
|
||||
"system": MustParseCid("bafk2bzaceacjmlxrvydlud77ilpzbscez46yedx6zjsj6olxsdeuv6d4x4cwe"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceaf2po4fxf7gw7cdvulwxxtvnsvzfn4gff5w267qnz7r44ywk25c6"),
|
||||
},
|
||||
}, {
|
||||
Network: "calibrationnet",
|
||||
Version: 8,
|
||||
@ -203,7 +226,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "calibrationnet",
|
||||
Version: 12,
|
||||
BundleGitTag: "v12.0.0",
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzacednzb3pkrfnbfhmoqtb3bc6dgvxszpqklf3qcc7qzcage4ewzxsca"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacechwwxdqvggkdylm37zldjsra2ivkdzwp7fee56bzxbzs544wv6u6"),
|
||||
@ -223,6 +246,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacecioupndtcnyw6iq2hbrxag3aufvczlv5nobnfbkbywqzcyfaa376"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceavldupmf7bimeeacs67z5xdfdlfca6p7sn6bev3mt5ggepfqvhqo"),
|
||||
},
|
||||
}, {
|
||||
Network: "calibrationnet",
|
||||
Version: 13,
|
||||
BundleGitTag: "v13.0.0-rc.3",
|
||||
ManifestCid: MustParseCid("bafy2bzacea4firkyvt2zzdwqjrws5pyeluaesh6uaid246tommayr4337xpmi"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaceb3j36ri5y5mfklgp5emlvrms6g4733ss2j3l7jismrxq6ng3tcc6"),
|
||||
"cron": MustParseCid("bafk2bzaceaz6rocamdxehgpwcbku6wlapwpgzyyvkrploj66mlqptsulf52bs"),
|
||||
"datacap": MustParseCid("bafk2bzacea22nv5g3yngpxvonqfj4r2nkfk64y6yw2malicm7odk77x7zuads"),
|
||||
"eam": MustParseCid("bafk2bzaceatqtjzj7623i426noaslouvluhz6e3md3vvquqzku5qj3532uaxg"),
|
||||
"ethaccount": MustParseCid("bafk2bzacean3hs7ga5csw6g3uu7watxfnqv5uvxviebn3ba6vg4sagwdur5pu"),
|
||||
"evm": MustParseCid("bafk2bzacec5ibmbtzuzjgwjmksm2n6zfq3gkicxqywwu7tsscqgdzajpfctxk"),
|
||||
"init": MustParseCid("bafk2bzaced5sq72oemz6qwi6yssxwlos2g54zfprslrx5qfhhx2vlgsbvdpcs"),
|
||||
"multisig": MustParseCid("bafk2bzacedbgei6jkx36fwdgvoohce4aghvpohqdhoco7p4thszgssms7olv2"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceasmgmfsi4mjanxlowsub65fmevhzky4toeqbtw4kp6tmu4kxjpgq"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacedjyp6ll5ez27dfgldjj4tntxfvyp4pa5zkk7s5uhipzqjyx2gmuc"),
|
||||
"storagemarket": MustParseCid("bafk2bzaceabolct6qdnefwcrtati2us3sxtxfghyqk6aamfhl6byyefmtssqi"),
|
||||
"storageminer": MustParseCid("bafk2bzaceckzw3v7wqliyggvjvihz4wywchnnsie4frfvkm3fm5znb64mofri"),
|
||||
"storagepower": MustParseCid("bafk2bzacea7t4wynzjajl442mpdqbnh3wusjusqtnzgpvefvweh4n2tgzgqhu"),
|
||||
"system": MustParseCid("bafk2bzacedjnrb5glewazsxpcx6rwiuhl4kwrfcqolyprn6rrjtlzmthlhdq6"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacednskl3bykz5qpo54z2j2p4q44t5of4ktd6vs6ymmg2zebsbxazkm"),
|
||||
},
|
||||
}, {
|
||||
Network: "caterpillarnet",
|
||||
Version: 8,
|
||||
@ -318,7 +364,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "caterpillarnet",
|
||||
Version: 12,
|
||||
BundleGitTag: "v12.0.0",
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzacebxiub6qsy67asvl5cx33x5vjbuqinalmf3xtnbmokxmmklzdkvei"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacecereuhejfvodut5357cai4lmhsyr7uenhcxvmw6jpmhe6auuly32"),
|
||||
@ -338,6 +384,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacedye5j5uxox7knb6zlnhseaadztyav76mjbyk5qslhhbpiy5cdtt2"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacecduww5pirr7dvaijjijw4gf6ygf7vipgxh4scvv6vseo46gueb46"),
|
||||
},
|
||||
}, {
|
||||
Network: "caterpillarnet",
|
||||
Version: 13,
|
||||
BundleGitTag: "v13.0.0-rc.3",
|
||||
ManifestCid: MustParseCid("bafy2bzacecozgyaqlzq4qebq52uogmrk6ahk7z2i4qfkh5iv235bpqqv7w24m"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacecro3uo6ypqhfzwdhnamzcole5qmhrbkx7qny6t2qsrcpqxelt6s2"),
|
||||
"cron": MustParseCid("bafk2bzaceam3kci46y4siltbw7f4itoap34kp7b7pvn2fco5s2bvnotomwdbe"),
|
||||
"datacap": MustParseCid("bafk2bzacecmtdspcbqmmjtsaz4vucuqoqjqfsgxjonns7tom7eblkngbcm7bw"),
|
||||
"eam": MustParseCid("bafk2bzaceaudqhrt7djewopqdnryvwxagfufyt7ja4gdvovrxbh6edh6evgrw"),
|
||||
"ethaccount": MustParseCid("bafk2bzaced676ds3z6xe333wr7frwq3f2iq5kjwp4okl3te6rne3xf7kuqrwm"),
|
||||
"evm": MustParseCid("bafk2bzacebeih4jt2s6mel6x4hje7xmnugh6twul2a5axx4iczu7fu4wcdi6k"),
|
||||
"init": MustParseCid("bafk2bzaceba7vvuzzwj5wqnq2bvpbgtxup53mhr3qybezbllftnxvpqbfymxo"),
|
||||
"multisig": MustParseCid("bafk2bzaceapkajhnqoczrgry5javqbl7uebgmsbpqqfemzc4yb5q2dqia2qog"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacebg7xq4ca22gafmdbkcq357x7v6slflib4h3fnj4amsovg6ulqg3o"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzaceajt4idf26ffnyipybcib55fykjxnek7oszkqzi7lu7mbgijmkgos"),
|
||||
"storagemarket": MustParseCid("bafk2bzaceadfmay7pyl7osjsdmrireafasnjnoziacljy5ewrcsxpp56kzqbw"),
|
||||
"storageminer": MustParseCid("bafk2bzaceardbn5a7aq5jxl7efr4btmsbl7txnxm4hrrd3llyhujuc2cr5vcs"),
|
||||
"storagepower": MustParseCid("bafk2bzacear4563jznjqyseoy42xl6kenyqk6umv6xl3bp5bsjb3hbs6sp6bm"),
|
||||
"system": MustParseCid("bafk2bzacecc5oavxivfnvirx2g7megpdf6lugooyoc2wijloju247xzjcdezy"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacecpqldvrs6i7xzbyizkpdvrick3cahrbdptmimdsrpnxu6k4xs4pm"),
|
||||
},
|
||||
}, {
|
||||
Network: "devnet",
|
||||
Version: 8,
|
||||
@ -424,7 +493,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "devnet",
|
||||
Version: 12,
|
||||
BundleGitTag: "v12.0.0",
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzaceasjdukhhyjbegpli247vbf5h64f7uvxhhebdihuqsj2mwisdwa6o"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacedki4apynvdxxuoigmqkgaktgy2erjftoxqxqaklnelgveyaqknfu"),
|
||||
@ -444,6 +513,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacecnau5wddulbsvwn75tc3w75jrlvkybgrlxs4ngonqab6xq3eowvg"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacec37mddea65nvh4htsagtryfa3sq6i67utcupslyhzbhjhoy6hopa"),
|
||||
},
|
||||
}, {
|
||||
Network: "devnet",
|
||||
Version: 13,
|
||||
BundleGitTag: "v13.0.0-rc.3",
|
||||
ManifestCid: MustParseCid("bafy2bzaceap34qfq4emg4fp3xd7bxtzt7pvkaj37kunqm2ccvttchtlljw7d4"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacebev3fu5geeehpx577b3kvza4xsmmggmepjj7rlsnr27hpoq27q2i"),
|
||||
"cron": MustParseCid("bafk2bzacedalzqahtuz2bmnf7uawbcujfhhe5xzv5ys5ufadu6ggs3tcu6lsy"),
|
||||
"datacap": MustParseCid("bafk2bzaceb7ou2vn7ac4xidespoowq2q5w7ognr7s4ujy3xzzgiishajpe7le"),
|
||||
"eam": MustParseCid("bafk2bzacedqic2qskattorj4svf6mbto2k76ej3ll3ugsyorqramrg7rpq3by"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceaoad7iknpywijigv2h3jyvkijff2oxvohzue533v5hby3iix5vdu"),
|
||||
"evm": MustParseCid("bafk2bzacecjgiw26gagsn6a7tffkrgoor4zfgzfokp76u6cwervtmvjbopmwg"),
|
||||
"init": MustParseCid("bafk2bzaced2obubqojxggeddr246cpwtyzi6knnq52jsvsc2fs3tuk2kh6dtg"),
|
||||
"multisig": MustParseCid("bafk2bzacebquruzb6zho45orbdkku624t6w6jt4tudaqzraz4yh3li3jfstpg"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceaydrilyxvflsuzr24hmw32qwz6sy4hgls73bhpveydcsqskdgpca"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzaceb74owpuzdddqoj2tson6ymbyuguqrnqefyiaxqvwm4ygitpabjrq"),
|
||||
"storagemarket": MustParseCid("bafk2bzaceaw6dslv6pfqha4ynghq2imij5khnnjrie22kmfgtpie3bvxho6jq"),
|
||||
"storageminer": MustParseCid("bafk2bzacecsputz6xygjfyrvx2d7bxkpp7b5v4icrmpckec7gnbabx2w377qs"),
|
||||
"storagepower": MustParseCid("bafk2bzaceceyaa5yjwhxvvcqouob4l746zp5nesivr6enhtpimakdtby6kafi"),
|
||||
"system": MustParseCid("bafk2bzaceaxg6k5vuozxlemfi5hv663m6jcawzu5puboo4znj73i36e3tsovs"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebjwc4fp4n556agi5i4pccuzn4bhn2tl24l4cskgvmwgadycff3oo"),
|
||||
},
|
||||
}, {
|
||||
Network: "hyperspace",
|
||||
Version: 8,
|
||||
@ -553,7 +645,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "mainnet",
|
||||
Version: 12,
|
||||
BundleGitTag: "v12.0.0",
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzaceapkgfggvxyllnmuogtwasmsv5qi2qzhc2aybockd6kag2g5lzaio"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaceboftg75mdiba7xbo2i3uvgtca4brhnr3u5ptihonixgpnrvhpxoa"),
|
||||
@ -573,6 +665,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacebfqrja2hip7esf4eafxjmu6xcogoqu5xxtgdg7xa5szgvvdguchu"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacedudgflxc75c77c6zkmfyq4u2xuk7k6xw6dfdccarjrvxx453b77q"),
|
||||
},
|
||||
}, {
|
||||
Network: "mainnet",
|
||||
Version: 13,
|
||||
BundleGitTag: "v13.0.0-rc.3",
|
||||
ManifestCid: MustParseCid("bafy2bzacecoplaet2m4kzueqgutjxpl76bhmuiq5hmo3ueighbnxas3rj4dvy"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacedxnbtlsqdk76fsfmnhyvsblwyfducerwwtp3mqtx2wbrvs5idl52"),
|
||||
"cron": MustParseCid("bafk2bzacebbopddyn5csb3fsuhh2an4ttd23x6qnwixgohlirj5ahtcudphyc"),
|
||||
"datacap": MustParseCid("bafk2bzaceah42tfnhd7xnztawgf46gbvc3m2gudoxshlba2ucmmo2vy67t7ci"),
|
||||
"eam": MustParseCid("bafk2bzaceb23bhvvcjsth7cn7vp3gbaphrutsaz7v6hkls3ogotzs4bnhm4mk"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceautge6zhuy6jbj3uldwoxwhpywuon6z3xfvmdbzpbdribc6zzmei"),
|
||||
"evm": MustParseCid("bafk2bzacedq6v2lyuhgywhlllwmudfj2zufzcauxcsvvd34m2ek5xr55mvh2q"),
|
||||
"init": MustParseCid("bafk2bzacedr4xacm3fts4vilyeiacjr2hpmwzclyzulbdo24lrfxbtau2wbai"),
|
||||
"multisig": MustParseCid("bafk2bzacecr5zqarfqak42xqcfeulsxlavcltawsx2fvc7zsjtby6ti4b3wqc"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacebntdhfmyc24e7tm52ggx5tnw4i3hrr3jmllsepv3mibez4hywsa2"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacedq4q2kwkruu4xm7rkyygumlbw2yt4nimna2ivea4qarvtkohnuwu"),
|
||||
"storagemarket": MustParseCid("bafk2bzacebjtoltdviyznpj34hh5qp6u257jnnbjole5rhqfixm7ug3epvrfu"),
|
||||
"storageminer": MustParseCid("bafk2bzacebf4rrqyk7gcfggggul6nfpzay7f2ordnkwm7z2wcf4mq6r7i77t2"),
|
||||
"storagepower": MustParseCid("bafk2bzacecjy4dkulvxppg3ocbmeixe2wgg6yxoyjxrm4ko2fm3uhpvfvam6e"),
|
||||
"system": MustParseCid("bafk2bzacecyf523quuq2kdjfdvyty446z2ounmamtgtgeqnr3ynlu5cqrlt6e"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceblqlrece7lezbp42lfba5ojlyxuv3vcbkldw45wpdadqwqslev3g"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing",
|
||||
Version: 8,
|
||||
@ -659,7 +774,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "testing",
|
||||
Version: 12,
|
||||
BundleGitTag: "v12.0.0",
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzaceaaxd6ytavsek5bi5soqo7qamezuqfyfjy42es2clpbzu3pwzcmye"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacea74qqkfvacykmq5emzqblh4f4nmxdkiyixxpzs7kkcfnbfa7cb6m"),
|
||||
@ -679,6 +794,29 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacecp4roanbxq3bflftlkipsoqqxio5etjjnzxus5pcu7lq43fnxb34"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceandytrgcnuvizfi47sijbqh6c243vjtzlzumexm6kjv7s7hye45g"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing",
|
||||
Version: 13,
|
||||
BundleGitTag: "v13.0.0-rc.3",
|
||||
ManifestCid: MustParseCid("bafy2bzacedcrzpgb4jac75auzcjkh55bxipdiospgvjsivumnqlvg2rp2ahmg"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaceb3tncntgeqvzzr5fzhvpsc5ntv3tpqrsh4jst4irfyzpkdyigibc"),
|
||||
"cron": MustParseCid("bafk2bzacecwwasmhixpgtshczm5cfspwciyawc25mrefknqhlxfrd6m57tqmc"),
|
||||
"datacap": MustParseCid("bafk2bzaceckj66by6eohjrybazh5cymmovgl5bmikpvzki2q7huwk2fweoef2"),
|
||||
"eam": MustParseCid("bafk2bzaceafzm65wvnaam3775homn4vzsv7odftn5tkifmn44wd2t6gupy63y"),
|
||||
"ethaccount": MustParseCid("bafk2bzaced4q7m4mha2dsezhwub3ru64rgimkg52t25ul4gnekax6uq7hbkqu"),
|
||||
"evm": MustParseCid("bafk2bzaceakpknw5cuizil3552jr5z35rs6ijaignjigciswtok67drhzdss6"),
|
||||
"init": MustParseCid("bafk2bzacec7mbkemwugyg2p4oy2xgnovykk4dnsu5ym4wkreooujvxfsxbo3i"),
|
||||
"multisig": MustParseCid("bafk2bzacebmftoql6dcyqf54xznwjg2bfgdsi67spqquwslpvvtvcx6qenhz2"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceau57wpiiikea6pu5om4ryyqjrxjzfksfl4reqosnohydzv3pf4qq"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacecvlcdgbqlk3dyfzkcjrywg2th5bmn7ilijifikulpxr4ffcrw23o"),
|
||||
"storagemarket": MustParseCid("bafk2bzacecgj53dwqla7eiubs2uiza7cgxkxtefxkfpjontj5jxefl3a4i2nq"),
|
||||
"storageminer": MustParseCid("bafk2bzaceailclue4dba2edjethfjw6ycufcwsx4qjjmgsh77xcyprmogdjvu"),
|
||||
"storagepower": MustParseCid("bafk2bzaceaqw6dhdjlqovhk3p4lb4sb25i5d6mhln2ir5m7tj6m4fegkgkinw"),
|
||||
"system": MustParseCid("bafk2bzaceby6aiiosnrtb5kzlmrvd4k3o27oo3idmbd6llydz2uqibbp23pzq"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebqwmxch4np2nwzi2yt6vkciy2mp75otwoipulkmfxly3ifhj5g6i"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing-fake-proofs",
|
||||
Version: 8,
|
||||
@ -765,7 +903,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "testing-fake-proofs",
|
||||
Version: 12,
|
||||
BundleGitTag: "v12.0.0",
|
||||
|
||||
ManifestCid: MustParseCid("bafy2bzacecver4l5d6jiuzubhrtcxjjfdx6jnxbmyp4bselol2atgkhz3e3um"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacea74qqkfvacykmq5emzqblh4f4nmxdkiyixxpzs7kkcfnbfa7cb6m"),
|
||||
@ -785,4 +923,27 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
"system": MustParseCid("bafk2bzacecp4roanbxq3bflftlkipsoqqxio5etjjnzxus5pcu7lq43fnxb34"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceandytrgcnuvizfi47sijbqh6c243vjtzlzumexm6kjv7s7hye45g"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing-fake-proofs",
|
||||
Version: 13,
|
||||
BundleGitTag: "v13.0.0-rc.3",
|
||||
ManifestCid: MustParseCid("bafy2bzaceaeepylii2u3lvuvrbdureocn6cuizhaq6o6ivmtzldweqf675w5s"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaceb3tncntgeqvzzr5fzhvpsc5ntv3tpqrsh4jst4irfyzpkdyigibc"),
|
||||
"cron": MustParseCid("bafk2bzacecwwasmhixpgtshczm5cfspwciyawc25mrefknqhlxfrd6m57tqmc"),
|
||||
"datacap": MustParseCid("bafk2bzaceckj66by6eohjrybazh5cymmovgl5bmikpvzki2q7huwk2fweoef2"),
|
||||
"eam": MustParseCid("bafk2bzaceafzm65wvnaam3775homn4vzsv7odftn5tkifmn44wd2t6gupy63y"),
|
||||
"ethaccount": MustParseCid("bafk2bzaced4q7m4mha2dsezhwub3ru64rgimkg52t25ul4gnekax6uq7hbkqu"),
|
||||
"evm": MustParseCid("bafk2bzaceakpknw5cuizil3552jr5z35rs6ijaignjigciswtok67drhzdss6"),
|
||||
"init": MustParseCid("bafk2bzacec7mbkemwugyg2p4oy2xgnovykk4dnsu5ym4wkreooujvxfsxbo3i"),
|
||||
"multisig": MustParseCid("bafk2bzacedy4vldq4viv6bzzh4fueip3by3axsbgbh655lashddgumknc6pvs"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceau57wpiiikea6pu5om4ryyqjrxjzfksfl4reqosnohydzv3pf4qq"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacecvlcdgbqlk3dyfzkcjrywg2th5bmn7ilijifikulpxr4ffcrw23o"),
|
||||
"storagemarket": MustParseCid("bafk2bzacecgj53dwqla7eiubs2uiza7cgxkxtefxkfpjontj5jxefl3a4i2nq"),
|
||||
"storageminer": MustParseCid("bafk2bzaceb6atn3k6yhmskgmc3lgfiwpzpfmaxzacohtnb2hivme2oroycqr6"),
|
||||
"storagepower": MustParseCid("bafk2bzacedameh56mp2g4y7nprhax5sddbzcmpk5p7l523l45rtn2wjc6ah4e"),
|
||||
"system": MustParseCid("bafk2bzaceby6aiiosnrtb5kzlmrvd4k3o27oo3idmbd6llydz2uqibbp23pzq"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebqwmxch4np2nwzi2yt6vkciy2mp75otwoipulkmfxly3ifhj5g6i"),
|
||||
},
|
||||
}}
|
||||
|
@ -10,8 +10,8 @@ type DrandEnum int
|
||||
|
||||
func DrandConfigSchedule() dtypes.DrandSchedule {
|
||||
out := dtypes.DrandSchedule{}
|
||||
for start, config := range DrandSchedule {
|
||||
out = append(out, dtypes.DrandPoint{Start: start, Config: DrandConfigs[config]})
|
||||
for start, network := range DrandSchedule {
|
||||
out = append(out, dtypes.DrandPoint{Start: start, Config: DrandConfigs[network]})
|
||||
}
|
||||
|
||||
sort.Slice(out, func(i, j int) bool {
|
||||
@ -27,6 +27,7 @@ const (
|
||||
DrandDevnet
|
||||
DrandLocalnet
|
||||
DrandIncentinet
|
||||
DrandQuicknet
|
||||
)
|
||||
|
||||
var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{
|
||||
@ -36,14 +37,32 @@ var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{
|
||||
"https://api2.drand.sh",
|
||||
"https://api3.drand.sh",
|
||||
"https://drand.cloudflare.com",
|
||||
"https://api.drand.secureweb3.com:6875", // Storswift
|
||||
},
|
||||
Relays: []string{
|
||||
"/dnsaddr/api.drand.sh/",
|
||||
"/dnsaddr/api2.drand.sh/",
|
||||
"/dnsaddr/api3.drand.sh/",
|
||||
},
|
||||
IsChained: true,
|
||||
ChainInfoJSON: `{"public_key":"868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31","period":30,"genesis_time":1595431050,"hash":"8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce","groupHash":"176f93498eac9ca337150b46d21dd58673ea4e3581185f869672e59fa4cb390a"}`,
|
||||
},
|
||||
DrandQuicknet: {
|
||||
Servers: []string{
|
||||
"https://api.drand.sh",
|
||||
"https://api2.drand.sh",
|
||||
"https://api3.drand.sh",
|
||||
"https://drand.cloudflare.com",
|
||||
"https://api.drand.secureweb3.com:6875", // Storswift
|
||||
},
|
||||
Relays: []string{
|
||||
"/dnsaddr/api.drand.sh/",
|
||||
"/dnsaddr/api2.drand.sh/",
|
||||
"/dnsaddr/api3.drand.sh/",
|
||||
},
|
||||
IsChained: false,
|
||||
ChainInfoJSON: `{"public_key":"83cf0f2896adee7eb8b5f01fcad3912212c437e0073e911fb90022d3e760183c8c4b450b6a0a6c3ac6a5776a2d1064510d1fec758c921cc22b0e17e63aaf4bcb5ed66304de9cf809bd274ca73bab4af5a6e9c76a4bc09e76eae8991ef5ece45a","period":3,"genesis_time":1692803367,"hash":"52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971","groupHash":"f477d5c89f21a17c863a7f937c6a6d15859414d2be09cd448d4279af331c5d3e","schemeID":"bls-unchained-g1-rfc9380","metadata":{"beaconID":"quicknet"}}`,
|
||||
},
|
||||
DrandTestnet: {
|
||||
Servers: []string{
|
||||
"https://pl-eu.testnet.drand.sh",
|
||||
@ -53,6 +72,7 @@ var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{
|
||||
"/dnsaddr/pl-eu.testnet.drand.sh/",
|
||||
"/dnsaddr/pl-us.testnet.drand.sh/",
|
||||
},
|
||||
IsChained: true,
|
||||
ChainInfoJSON: `{"public_key":"922a2e93828ff83345bae533f5172669a26c02dc76d6bf59c80892e12ab1455c229211886f35bb56af6d5bea981024df","period":25,"genesis_time":1590445175,"hash":"84b2234fb34e835dccd048255d7ad3194b81af7d978c3bf157e3469592ae4e02","groupHash":"4dd408e5fdff9323c76a9b6f087ba8fdc5a6da907bd9217d9d10f2287d081957"}`,
|
||||
},
|
||||
DrandDevnet: {
|
||||
@ -64,9 +84,11 @@ var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{
|
||||
"/dnsaddr/dev1.drand.sh/",
|
||||
"/dnsaddr/dev2.drand.sh/",
|
||||
},
|
||||
IsChained: true,
|
||||
ChainInfoJSON: `{"public_key":"8cda589f88914aa728fd183f383980b35789ce81b274e5daee1f338b77d02566ef4d3fb0098af1f844f10f9c803c1827","period":25,"genesis_time":1595348225,"hash":"e73b7dc3c4f6a236378220c0dd6aa110eb16eed26c11259606e07ee122838d4f","groupHash":"567d4785122a5a3e75a9bc9911d7ea807dd85ff76b78dc4ff06b075712898607"}`,
|
||||
},
|
||||
DrandIncentinet: {
|
||||
IsChained: true,
|
||||
ChainInfoJSON: `{"public_key":"8cad0c72c606ab27d36ee06de1d5b2db1faf92e447025ca37575ab3a8aac2eaae83192f846fc9e158bc738423753d000","period":30,"genesis_time":1595873820,"hash":"80c8b872c714f4c00fdd3daa465d5514049f457f01f85a4caf68cdcd394ba039","groupHash":"d9406aaed487f7af71851b4399448e311f2328923d454e971536c05398ce2d9b"}`,
|
||||
},
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
"openrpc": "1.2.6",
|
||||
"info": {
|
||||
"title": "Lotus RPC API",
|
||||
"version": "1.25.3-dev"
|
||||
"version": "1.27.0-dev"
|
||||
},
|
||||
"methods": [
|
||||
{
|
||||
@ -242,7 +242,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4188"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4259"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -473,7 +473,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4199"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4270"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -505,7 +505,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4210"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4281"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -611,7 +611,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4221"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4292"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -704,7 +704,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4232"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4303"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -788,7 +788,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4243"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4314"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -888,7 +888,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4254"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4325"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -944,7 +944,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4265"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4336"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1017,7 +1017,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4276"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4347"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1090,7 +1090,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4287"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4358"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1137,7 +1137,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4298"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4369"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1169,7 +1169,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4309"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4380"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1206,7 +1206,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4331"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4402"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1253,7 +1253,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4342"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4413"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1293,7 +1293,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4353"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4424"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1340,7 +1340,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4364"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4435"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1369,7 +1369,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4375"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4446"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1506,7 +1506,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4386"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4457"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1535,7 +1535,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4397"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4468"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1589,7 +1589,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4408"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4479"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1680,7 +1680,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4419"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4490"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1708,7 +1708,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4430"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4501"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1798,7 +1798,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4441"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4512"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -2054,7 +2054,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4452"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4523"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -2299,7 +2299,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4463"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4534"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -2355,7 +2355,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4474"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4545"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -2402,7 +2402,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4485"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4556"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -2500,7 +2500,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4496"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4567"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -2566,7 +2566,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4507"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4578"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -2632,7 +2632,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4518"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4589"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -2741,7 +2741,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4529"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4600"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -2799,7 +2799,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4540"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4611"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -2921,7 +2921,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4551"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4622"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3108,7 +3108,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4562"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4633"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3312,7 +3312,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4573"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4644"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3403,7 +3403,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4584"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4655"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3461,7 +3461,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4595"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4666"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3719,7 +3719,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4606"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4677"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3994,7 +3994,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4617"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4688"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4022,7 +4022,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4628"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4699"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4060,7 +4060,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4639"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4710"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4168,7 +4168,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4650"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4721"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4206,7 +4206,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4661"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4732"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4235,7 +4235,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4672"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4743"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4298,7 +4298,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4683"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4754"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4361,7 +4361,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4694"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4765"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4406,7 +4406,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4705"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4776"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4528,7 +4528,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4716"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4787"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4683,7 +4683,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4727"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4798"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4737,7 +4737,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4738"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4809"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4791,7 +4791,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4749"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4820"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4893,7 +4893,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4760"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4831"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5116,7 +5116,190 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4771"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4842"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Filecoin.GetActorEvents",
|
||||
"description": "```go\nfunc (s *GatewayStruct) GetActorEvents(p0 context.Context, p1 *types.ActorEventFilter) ([]*types.ActorEvent, error) {\n\tif s.Internal.GetActorEvents == nil {\n\t\treturn *new([]*types.ActorEvent), ErrNotSupported\n\t}\n\treturn s.Internal.GetActorEvents(p0, p1)\n}\n```",
|
||||
"summary": "There are not yet any comments for this method.",
|
||||
"paramStructure": "by-position",
|
||||
"params": [
|
||||
{
|
||||
"name": "p1",
|
||||
"description": "*types.ActorEventFilter",
|
||||
"summary": "",
|
||||
"schema": {
|
||||
"examples": [
|
||||
{
|
||||
"addresses": [
|
||||
"f01234"
|
||||
],
|
||||
"fields": {
|
||||
"abc": [
|
||||
{
|
||||
"codec": 81,
|
||||
"value": "ZGRhdGE="
|
||||
}
|
||||
]
|
||||
},
|
||||
"fromHeight": 1010,
|
||||
"toHeight": 1020
|
||||
}
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"addresses": {
|
||||
"items": {
|
||||
"additionalProperties": false,
|
||||
"type": "object"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"fields": {
|
||||
"patternProperties": {
|
||||
".*": {
|
||||
"items": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"codec": {
|
||||
"title": "number",
|
||||
"type": "number"
|
||||
},
|
||||
"value": {
|
||||
"media": {
|
||||
"binaryEncoding": "base64"
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"fromHeight": {
|
||||
"title": "number",
|
||||
"type": "number"
|
||||
},
|
||||
"tipsetKey": {
|
||||
"additionalProperties": false,
|
||||
"type": "object"
|
||||
},
|
||||
"toHeight": {
|
||||
"title": "number",
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"type": [
|
||||
"object"
|
||||
]
|
||||
},
|
||||
"required": true,
|
||||
"deprecated": false
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"name": "[]*types.ActorEvent",
|
||||
"description": "[]*types.ActorEvent",
|
||||
"summary": "",
|
||||
"schema": {
|
||||
"examples": [
|
||||
[
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"Flags": 7,
|
||||
"Key": "string value",
|
||||
"Codec": 42,
|
||||
"Value": "Ynl0ZSBhcnJheQ=="
|
||||
}
|
||||
],
|
||||
"emitter": "f01234",
|
||||
"reverted": true,
|
||||
"height": 10101,
|
||||
"tipsetKey": [
|
||||
{
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
},
|
||||
{
|
||||
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
|
||||
}
|
||||
],
|
||||
"msgCid": {
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"items": [
|
||||
{
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"emitter": {
|
||||
"additionalProperties": false,
|
||||
"type": "object"
|
||||
},
|
||||
"entries": {
|
||||
"items": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"Codec": {
|
||||
"title": "number",
|
||||
"type": "number"
|
||||
},
|
||||
"Flags": {
|
||||
"title": "number",
|
||||
"type": "number"
|
||||
},
|
||||
"Key": {
|
||||
"type": "string"
|
||||
},
|
||||
"Value": {
|
||||
"media": {
|
||||
"binaryEncoding": "base64"
|
||||
},
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"height": {
|
||||
"title": "number",
|
||||
"type": "number"
|
||||
},
|
||||
"msgCid": {
|
||||
"title": "Content Identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"reverted": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"tipsetKey": {
|
||||
"additionalProperties": false,
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": [
|
||||
"object"
|
||||
]
|
||||
}
|
||||
],
|
||||
"type": [
|
||||
"array"
|
||||
]
|
||||
},
|
||||
"required": true,
|
||||
"deprecated": false
|
||||
},
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4853"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5310,7 +5493,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4782"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4864"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5356,7 +5539,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4793"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4875"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5506,7 +5689,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4804"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4886"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5643,7 +5826,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4815"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4897"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5711,7 +5894,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4826"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4908"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5828,7 +6011,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4837"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4919"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5919,7 +6102,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4848"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4930"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -6005,7 +6188,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4859"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4941"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -6032,7 +6215,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4870"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4952"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -6059,7 +6242,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4881"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4963"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -6127,7 +6310,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4892"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4974"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -6633,7 +6816,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4903"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4985"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -6730,7 +6913,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4914"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4996"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -6830,7 +7013,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4925"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5007"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -6930,7 +7113,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4936"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5018"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -7055,7 +7238,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4947"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5029"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -7164,7 +7347,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4958"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5040"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -7267,7 +7450,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4969"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5051"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -7397,7 +7580,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4980"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5062"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -7504,7 +7687,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4991"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5073"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -7565,7 +7748,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5002"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5084"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -7633,7 +7816,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5013"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5095"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -7714,7 +7897,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5024"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5106"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -7789,8 +7972,7 @@
|
||||
"State": {
|
||||
"SectorStartEpoch": 10101,
|
||||
"LastUpdatedEpoch": 10101,
|
||||
"SlashEpoch": 10101,
|
||||
"VerifiedClaim": 0
|
||||
"SlashEpoch": 10101
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -7859,10 +8041,6 @@
|
||||
"SlashEpoch": {
|
||||
"title": "number",
|
||||
"type": "number"
|
||||
},
|
||||
"VerifiedClaim": {
|
||||
"title": "number",
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
@ -7878,7 +8056,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5035"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5117"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -8079,7 +8257,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5046"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5128"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -8190,7 +8368,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5057"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5139"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -8321,7 +8499,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5068"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5150"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -8407,7 +8585,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5079"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5161"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -8434,7 +8612,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5090"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5172"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -8475,7 +8653,7 @@
|
||||
"title": "number",
|
||||
"description": "Number is a number",
|
||||
"examples": [
|
||||
21
|
||||
22
|
||||
],
|
||||
"type": [
|
||||
"number"
|
||||
@ -8487,7 +8665,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5101"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5183"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -8575,7 +8753,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5112"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5194"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -9026,7 +9204,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5123"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5205"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -9193,7 +9371,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5134"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5216"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -9366,7 +9544,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5145"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5227"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -9434,7 +9612,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5156"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5238"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -9502,7 +9680,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5167"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5249"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -9663,7 +9841,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5178"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5260"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -9708,7 +9886,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5189"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5282"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -9753,7 +9931,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5200"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5293"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -9780,7 +9958,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5211"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5304"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
"openrpc": "1.2.6",
|
||||
"info": {
|
||||
"title": "Lotus RPC API",
|
||||
"version": "1.25.3-dev"
|
||||
"version": "1.27.0-dev"
|
||||
},
|
||||
"methods": [
|
||||
{
|
||||
@ -161,7 +161,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7147"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7240"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -252,7 +252,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7158"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7251"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -420,7 +420,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7169"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7262"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -447,7 +447,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7180"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7273"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -597,7 +597,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7191"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7284"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -700,7 +700,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7202"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7295"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -803,7 +803,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7213"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7306"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -925,7 +925,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7224"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7317"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1135,7 +1135,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7235"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7328"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1306,7 +1306,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7246"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7339"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3350,7 +3350,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7257"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7350"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3470,7 +3470,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7268"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7361"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3531,7 +3531,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7279"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7372"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3569,7 +3569,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7290"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7383"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3729,7 +3729,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7301"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7394"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3913,7 +3913,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7312"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7405"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4054,7 +4054,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7323"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7416"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4107,7 +4107,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7334"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7427"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4250,7 +4250,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7345"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7438"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4474,7 +4474,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7356"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7449"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4601,7 +4601,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7367"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7460"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4768,7 +4768,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7378"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7471"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4895,7 +4895,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7389"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7482"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4933,7 +4933,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7400"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7493"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4972,7 +4972,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7411"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7504"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4995,7 +4995,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7422"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7515"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5034,7 +5034,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7433"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7526"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5057,7 +5057,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7444"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7537"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5096,7 +5096,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7455"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7548"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5130,7 +5130,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7466"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7559"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5184,7 +5184,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7477"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7570"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5223,7 +5223,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7488"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7581"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5262,7 +5262,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7499"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7592"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5297,7 +5297,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7510"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7603"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5477,7 +5477,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7521"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7614"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5506,7 +5506,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7532"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7625"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -5529,7 +5529,7 @@
|
||||
"deprecated": false,
|
||||
"externalDocs": {
|
||||
"description": "Github remote link",
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7543"
|
||||
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7636"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -23,7 +23,7 @@ var NetworkBundle = "devnet"
|
||||
var BundleOverrides map[actorstypes.Version]string
|
||||
var ActorDebugging = true
|
||||
|
||||
const GenesisNetworkVersion = network.Version20
|
||||
var GenesisNetworkVersion = network.Version21
|
||||
|
||||
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
|
||||
|
||||
@ -65,7 +65,11 @@ var UpgradeLightningHeight = abi.ChainEpoch(-22)
|
||||
|
||||
var UpgradeThunderHeight = abi.ChainEpoch(-23)
|
||||
|
||||
var UpgradeWatermelonHeight = abi.ChainEpoch(200)
|
||||
var UpgradeWatermelonHeight = abi.ChainEpoch(-24)
|
||||
|
||||
var UpgradeDragonHeight = abi.ChainEpoch(20)
|
||||
|
||||
var UpgradePhoenixHeight = UpgradeDragonHeight + 120
|
||||
|
||||
// This fix upgrade only ran on calibrationnet
|
||||
const UpgradeWatermelonFixHeight = -100
|
||||
@ -75,6 +79,7 @@ const UpgradeWatermelonFix2Height = -101
|
||||
|
||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
UpgradePhoenixHeight: DrandQuicknet,
|
||||
}
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
@ -91,6 +96,22 @@ func init() {
|
||||
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
|
||||
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
|
||||
|
||||
getGenesisNetworkVersion := func(ev string, def network.Version) network.Version {
|
||||
hs, found := os.LookupEnv(ev)
|
||||
if found {
|
||||
h, err := strconv.Atoi(hs)
|
||||
if err != nil {
|
||||
log.Panicf("failed to parse %s env var", ev)
|
||||
}
|
||||
|
||||
return network.Version(h)
|
||||
}
|
||||
|
||||
return def
|
||||
}
|
||||
|
||||
GenesisNetworkVersion = getGenesisNetworkVersion("LOTUS_GENESIS_NETWORK_VERSION", GenesisNetworkVersion)
|
||||
|
||||
getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
|
||||
hs, found := os.LookupEnv(ev)
|
||||
if found {
|
||||
@ -129,6 +150,13 @@ func init() {
|
||||
UpgradeLightningHeight = getUpgradeHeight("LOTUS_LIGHTNING_HEIGHT", UpgradeLightningHeight)
|
||||
UpgradeThunderHeight = getUpgradeHeight("LOTUS_THUNDER_HEIGHT", UpgradeThunderHeight)
|
||||
UpgradeWatermelonHeight = getUpgradeHeight("LOTUS_WATERMELON_HEIGHT", UpgradeWatermelonHeight)
|
||||
UpgradeDragonHeight = getUpgradeHeight("LOTUS_DRAGON_HEIGHT", UpgradeDragonHeight)
|
||||
|
||||
UpgradePhoenixHeight = getUpgradeHeight("LOTUS_PHOENIX_HEIGHT", UpgradePhoenixHeight)
|
||||
DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
UpgradePhoenixHeight: DrandQuicknet,
|
||||
}
|
||||
|
||||
BuildType |= Build2k
|
||||
|
||||
|
@ -17,9 +17,10 @@ import (
|
||||
|
||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
UpgradePhoenixHeight: DrandQuicknet,
|
||||
}
|
||||
|
||||
const GenesisNetworkVersion = network.Version20
|
||||
const GenesisNetworkVersion = network.Version21
|
||||
|
||||
var NetworkBundle = "butterflynet"
|
||||
var BundleOverrides map[actorstypes.Version]string
|
||||
@ -54,8 +55,11 @@ const UpgradeSharkHeight = -20
|
||||
const UpgradeHyggeHeight = -21
|
||||
const UpgradeLightningHeight = -22
|
||||
const UpgradeThunderHeight = -23
|
||||
const UpgradeWatermelonHeight = -24
|
||||
|
||||
const UpgradeWatermelonHeight = 400
|
||||
const UpgradeDragonHeight = 5760
|
||||
|
||||
const UpgradePhoenixHeight = UpgradeDragonHeight + 120
|
||||
|
||||
// This fix upgrade only ran on calibrationnet
|
||||
const UpgradeWatermelonFixHeight = -100
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
|
||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
UpgradePhoenixHeight: DrandQuicknet,
|
||||
}
|
||||
|
||||
const GenesisNetworkVersion = network.Version0
|
||||
@ -88,6 +89,12 @@ const UpgradeWatermelonFixHeight = 1070494
|
||||
// 2023-11-21T13:00:00Z
|
||||
const UpgradeWatermelonFix2Height = 1108174
|
||||
|
||||
// 2024-03-11T14:00:00Z
|
||||
const UpgradeDragonHeight = 1427974
|
||||
|
||||
// This epoch, 120 epochs after the "rest" of the nv22 upgrade, is when we switch to Drand quicknet
|
||||
const UpgradePhoenixHeight = UpgradeDragonHeight + 120
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
|
@ -53,8 +53,11 @@ var UpgradeSharkHeight = abi.ChainEpoch(-20)
|
||||
var UpgradeHyggeHeight = abi.ChainEpoch(-21)
|
||||
var UpgradeLightningHeight = abi.ChainEpoch(-22)
|
||||
var UpgradeThunderHeight = abi.ChainEpoch(-23)
|
||||
var UpgradeWatermelonHeight = abi.ChainEpoch(-24)
|
||||
|
||||
const UpgradeWatermelonHeight = 50
|
||||
const UpgradeDragonHeight = 50
|
||||
|
||||
const UpgradePhoenixHeight = UpgradeDragonHeight + 100
|
||||
|
||||
// This fix upgrade only ran on calibrationnet
|
||||
const UpgradeWatermelonFixHeight = -1
|
||||
@ -64,6 +67,7 @@ const UpgradeWatermelonFix2Height = -2
|
||||
|
||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
UpgradePhoenixHeight: DrandQuicknet,
|
||||
}
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
|
@ -18,6 +18,7 @@ import (
|
||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandIncentinet,
|
||||
UpgradeSmokeHeight: DrandMainnet,
|
||||
UpgradePhoenixHeight: DrandQuicknet,
|
||||
}
|
||||
|
||||
var NetworkBundle = "mainnet"
|
||||
@ -96,7 +97,14 @@ const UpgradeLightningHeight = 2809800
|
||||
const UpgradeThunderHeight = UpgradeLightningHeight + 2880*21
|
||||
|
||||
// 2023-12-12T13:30:00Z
|
||||
var UpgradeWatermelonHeight = abi.ChainEpoch(3469380)
|
||||
const UpgradeWatermelonHeight = 3469380
|
||||
|
||||
// 2024-04-02T14:00:00Z - Epoch will be updated in final release
|
||||
var UpgradeDragonHeight = abi.ChainEpoch(999999999999999)
|
||||
|
||||
// This epoch, 120 epochs after the "rest" of the nv22 upgrade, is when we switch to Drand quicknet
|
||||
// 2024-04-02T15:00:00Z
|
||||
var UpgradePhoenixHeight = UpgradeDragonHeight + 120
|
||||
|
||||
// This fix upgrade only ran on calibrationnet
|
||||
const UpgradeWatermelonFixHeight = -1
|
||||
@ -119,8 +127,9 @@ func init() {
|
||||
SetAddressNetwork(address.Mainnet)
|
||||
}
|
||||
|
||||
if os.Getenv("LOTUS_DISABLE_WATERMELON") == "1" {
|
||||
UpgradeWatermelonHeight = math.MaxInt64
|
||||
if os.Getenv("LOTUS_DISABLE_DRAGON") == "1" {
|
||||
UpgradeDragonHeight = math.MaxInt64 - 1
|
||||
UpgradePhoenixHeight = math.MaxInt64
|
||||
}
|
||||
|
||||
// NOTE: DO NOT change this unless you REALLY know what you're doing. This is not consensus critical, however,
|
||||
|
@ -30,7 +30,7 @@ const AllowableClockDriftSecs = uint64(1)
|
||||
/* inline-gen template
|
||||
const TestNetworkVersion = network.Version{{.latestNetworkVersion}}
|
||||
/* inline-gen start */
|
||||
const TestNetworkVersion = network.Version21
|
||||
const TestNetworkVersion = network.Version22
|
||||
|
||||
/* inline-gen end */
|
||||
|
||||
|
@ -112,9 +112,12 @@ var (
|
||||
UpgradeWatermelonHeight abi.ChainEpoch = -23
|
||||
UpgradeWatermelonFixHeight abi.ChainEpoch = -24
|
||||
UpgradeWatermelonFix2Height abi.ChainEpoch = -25
|
||||
UpgradeDragonHeight abi.ChainEpoch = -26
|
||||
UpgradePhoenixHeight abi.ChainEpoch = -27
|
||||
|
||||
DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
UpgradePhoenixHeight: DrandQuicknet,
|
||||
}
|
||||
|
||||
GenesisNetworkVersion = network.Version0
|
||||
|
@ -37,7 +37,7 @@ func BuildTypeString() string {
|
||||
}
|
||||
|
||||
// BuildVersion is the local build version
|
||||
const BuildVersion = "1.25.3-dev"
|
||||
const BuildVersion = "1.27.0-dev"
|
||||
|
||||
func UserVersion() string {
|
||||
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin12 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
@ -22,7 +22,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
var Methods = builtin12.MethodsAccount
|
||||
var Methods = builtin13.MethodsAccount
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
@ -47,6 +47,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,6 +120,9 @@ func MakeState(store adt.Store, av actorstypes.Version, addr address.Address) (S
|
||||
case actorstypes.Version12:
|
||||
return make12(store, addr)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return make13(store, addr)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -146,5 +152,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
62
chain/actors/builtin/account/v13.go
generated
Normal file
62
chain/actors/builtin/account/v13.go
generated
Normal file
@ -0,0 +1,62 @@
|
||||
package account
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
account13 "github.com/filecoin-project/go-state-types/builtin/v13/account"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store, addr address.Address) (State, error) {
|
||||
out := state13{store: store}
|
||||
out.State = account13.State{Address: addr}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
account13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) PubkeyAddress() (address.Address, error) {
|
||||
return s.Address, nil
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.AccountKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -5,7 +5,7 @@ import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin12 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
@ -43,6 +43,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,13 +116,16 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return make12(store)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return make13(store)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
var (
|
||||
Address = builtin12.CronActorAddr
|
||||
Methods = builtin12.MethodsCron
|
||||
Address = builtin13.CronActorAddr
|
||||
Methods = builtin13.MethodsCron
|
||||
)
|
||||
|
||||
type State interface {
|
||||
@ -144,5 +150,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
57
chain/actors/builtin/cron/v13.go
generated
Normal file
57
chain/actors/builtin/cron/v13.go
generated
Normal file
@ -0,0 +1,57 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
cron13 "github.com/filecoin-project/go-state-types/builtin/v13/cron"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store) (State, error) {
|
||||
out := state13{store: store}
|
||||
out.State = *cron13.ConstructState(cron13.BuiltInEntries())
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
cron13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.CronKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -7,7 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin12 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
@ -17,8 +17,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin12.DatacapActorAddr
|
||||
Methods = builtin12.MethodsDatacap
|
||||
Address = builtin13.DatacapActorAddr
|
||||
Methods = builtin13.MethodsDatacap
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -41,6 +41,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,6 +65,9 @@ func MakeState(store adt.Store, av actorstypes.Version, governor address.Address
|
||||
case actorstypes.Version12:
|
||||
return make12(store, governor, bitwidth)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return make13(store, governor, bitwidth)
|
||||
|
||||
default:
|
||||
return nil, xerrors.Errorf("datacap actor only valid for actors v9 and above, got %d", av)
|
||||
}
|
||||
@ -86,5 +92,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
82
chain/actors/builtin/datacap/v13.go
generated
Normal file
82
chain/actors/builtin/datacap/v13.go
generated
Normal file
@ -0,0 +1,82 @@
|
||||
package datacap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
datacap13 "github.com/filecoin-project/go-state-types/builtin/v13/datacap"
|
||||
adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store, governor address.Address, bitwidth uint64) (State, error) {
|
||||
out := state13{store: store}
|
||||
s, err := datacap13.ConstructState(store, governor, bitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
datacap13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) Governor() (address.Address, error) {
|
||||
return s.State.Governor, nil
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state13) ForEachClient(cb func(addr address.Address, dcap abi.StoragePower) error) error {
|
||||
return forEachClient(s.store, actors.Version13, s.verifiedClients, cb)
|
||||
}
|
||||
|
||||
func (s *state13) verifiedClients() (adt.Map, error) {
|
||||
return adt13.AsMap(s.store, s.Token.Balances, int(s.Token.HamtBitWidth))
|
||||
}
|
||||
|
||||
func (s *state13) VerifiedClientDataCap(addr address.Address) (bool, abi.StoragePower, error) {
|
||||
return getDataCap(s.store, actors.Version13, s.verifiedClients, addr)
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.DatacapKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -5,7 +5,7 @@ import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin12 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/exitcode"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
@ -15,7 +15,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
var Methods = builtin12.MethodsEVM
|
||||
var Methods = builtin13.MethodsEVM
|
||||
|
||||
// See https://github.com/filecoin-project/builtin-actors/blob/6e781444cee5965278c46ef4ffe1fb1970f18d7d/actors/evm/src/lib.rs#L35-L42
|
||||
const (
|
||||
@ -46,6 +46,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,6 +67,9 @@ func MakeState(store adt.Store, av actorstypes.Version, bytecode cid.Cid) (State
|
||||
case actorstypes.Version12:
|
||||
return make12(store, bytecode)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return make13(store, bytecode)
|
||||
|
||||
default:
|
||||
return nil, xerrors.Errorf("evm actor only valid for actors v10 and above, got %d", av)
|
||||
}
|
||||
|
72
chain/actors/builtin/evm/v13.go
generated
Normal file
72
chain/actors/builtin/evm/v13.go
generated
Normal file
@ -0,0 +1,72 @@
|
||||
package evm
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
evm13 "github.com/filecoin-project/go-state-types/builtin/v13/evm"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store, bytecode cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
s, err := evm13.ConstructState(store, bytecode)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
evm13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) Nonce() (uint64, error) {
|
||||
return s.State.Nonce, nil
|
||||
}
|
||||
|
||||
func (s *state13) IsAlive() (bool, error) {
|
||||
return s.State.Tombstone == nil, nil
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state13) GetBytecodeCID() (cid.Cid, error) {
|
||||
return s.State.Bytecode, nil
|
||||
}
|
||||
|
||||
func (s *state13) GetBytecodeHash() ([32]byte, error) {
|
||||
return s.State.BytecodeHash, nil
|
||||
}
|
||||
|
||||
func (s *state13) GetBytecode() ([]byte, error) {
|
||||
bc, err := s.GetBytecodeCID()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var byteCode abi.CborBytesTransparent
|
||||
if err := s.store.Get(s.store.Context(), bc, &byteCode); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return byteCode, nil
|
||||
}
|
@ -7,7 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin12 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
@ -25,8 +25,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin12.InitActorAddr
|
||||
Methods = builtin12.MethodsInit
|
||||
Address = builtin13.InitActorAddr
|
||||
Methods = builtin13.MethodsInit
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -52,6 +52,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,6 +125,9 @@ func MakeState(store adt.Store, av actorstypes.Version, networkName string) (Sta
|
||||
case actorstypes.Version12:
|
||||
return make12(store, networkName)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return make13(store, networkName)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -174,5 +180,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
147
chain/actors/builtin/init/v13.go
generated
Normal file
147
chain/actors/builtin/init/v13.go
generated
Normal file
@ -0,0 +1,147 @@
|
||||
package init
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
|
||||
adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store, networkName string) (State, error) {
|
||||
out := state13{store: store}
|
||||
|
||||
s, err := init13.ConstructState(store, networkName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
init13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) ResolveAddress(address address.Address) (address.Address, bool, error) {
|
||||
return s.State.ResolveAddress(s.store, address)
|
||||
}
|
||||
|
||||
func (s *state13) MapAddressToNewID(address address.Address) (address.Address, error) {
|
||||
return s.State.MapAddressToNewID(s.store, address)
|
||||
}
|
||||
|
||||
func (s *state13) ForEachActor(cb func(id abi.ActorID, address address.Address) error) error {
|
||||
addrs, err := adt13.AsMap(s.store, s.State.AddressMap, builtin13.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var actorID cbg.CborInt
|
||||
return addrs.ForEach(&actorID, func(key string) error {
|
||||
addr, err := address.NewFromBytes([]byte(key))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return cb(abi.ActorID(actorID), addr)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *state13) NetworkName() (dtypes.NetworkName, error) {
|
||||
return dtypes.NetworkName(s.State.NetworkName), nil
|
||||
}
|
||||
|
||||
func (s *state13) SetNetworkName(name string) error {
|
||||
s.State.NetworkName = name
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state13) SetNextID(id abi.ActorID) error {
|
||||
s.State.NextID = id
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state13) Remove(addrs ...address.Address) (err error) {
|
||||
m, err := adt13.AsMap(s.store, s.State.AddressMap, builtin13.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, addr := range addrs {
|
||||
if err = m.Delete(abi.AddrKey(addr)); err != nil {
|
||||
return xerrors.Errorf("failed to delete entry for address: %s; err: %w", addr, err)
|
||||
}
|
||||
}
|
||||
amr, err := m.Root()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to get address map root: %w", err)
|
||||
}
|
||||
s.State.AddressMap = amr
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state13) SetAddressMap(mcid cid.Cid) error {
|
||||
s.State.AddressMap = mcid
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state13) AddressMap() (adt.Map, error) {
|
||||
return adt13.AsMap(s.store, s.State.AddressMap, builtin13.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state13) AddressMapBitWidth() int {
|
||||
return builtin13.DefaultHamtBitwidth
|
||||
}
|
||||
|
||||
func (s *state13) AddressMapHashFunction() func(input []byte) []byte {
|
||||
return func(input []byte) []byte {
|
||||
res := sha256.Sum256(input)
|
||||
return res[:]
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.InitKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) 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
|
||||
}
|
@ -103,10 +103,10 @@ type BalanceTable interface {
|
||||
|
||||
type DealStates interface {
|
||||
ForEach(cb func(id abi.DealID, ds DealState) error) error
|
||||
Get(id abi.DealID) (*DealState, bool, error)
|
||||
Get(id abi.DealID) (DealState, bool, error)
|
||||
|
||||
array() adt.Array
|
||||
decode(*cbg.Deferred) (*DealState, error)
|
||||
decode(*cbg.Deferred) (DealState, error)
|
||||
}
|
||||
|
||||
type DealProposals interface {
|
||||
@ -142,7 +142,17 @@ func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStora
|
||||
type DealProposal = markettypes.DealProposal
|
||||
type DealLabel = markettypes.DealLabel
|
||||
|
||||
type DealState = markettypes.DealState
|
||||
type DealState interface {
|
||||
SectorStartEpoch() abi.ChainEpoch // -1 if not yet included in proven sector
|
||||
LastUpdatedEpoch() abi.ChainEpoch // -1 if deal state never updated
|
||||
SlashEpoch() abi.ChainEpoch // -1 if deal never slashed
|
||||
|
||||
Equals(other DealState) bool
|
||||
}
|
||||
|
||||
func DealStatesEqual(a, b DealState) bool {
|
||||
return DealStatesEqual(a, b)
|
||||
}
|
||||
|
||||
type DealStateChanges struct {
|
||||
Added []DealIDState
|
||||
@ -158,8 +168,8 @@ type DealIDState struct {
|
||||
// DealStateChange is a change in deal state from -> to
|
||||
type DealStateChange struct {
|
||||
ID abi.DealID
|
||||
From *DealState
|
||||
To *DealState
|
||||
From DealState
|
||||
To DealState
|
||||
}
|
||||
|
||||
type DealProposalChanges struct {
|
||||
@ -172,12 +182,36 @@ type ProposalIDState struct {
|
||||
Proposal markettypes.DealProposal
|
||||
}
|
||||
|
||||
func EmptyDealState() *DealState {
|
||||
return &DealState{
|
||||
SectorStartEpoch: -1,
|
||||
SlashEpoch: -1,
|
||||
LastUpdatedEpoch: -1,
|
||||
|
||||
type emptyDealState struct{}
|
||||
|
||||
func (e *emptyDealState) SectorStartEpoch() abi.ChainEpoch {
|
||||
return -1
|
||||
}
|
||||
|
||||
func (e *emptyDealState) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return -1
|
||||
}
|
||||
|
||||
func (e *emptyDealState) SlashEpoch() abi.ChainEpoch {
|
||||
return -1
|
||||
}
|
||||
|
||||
func (e *emptyDealState) Equals(other DealState) bool {
|
||||
if e.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if e.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if e.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func EmptyDealState() DealState {
|
||||
return &emptyDealState{}
|
||||
}
|
||||
|
||||
// returns the earned fees and pending fees for a given deal
|
||||
@ -196,8 +230,8 @@ func GetDealFees(deal markettypes.DealProposal, height abi.ChainEpoch) (abi.Toke
|
||||
return ef, big.Sub(tf, ef)
|
||||
}
|
||||
|
||||
func IsDealActive(state markettypes.DealState) bool {
|
||||
return state.SectorStartEpoch > -1 && state.SlashEpoch == -1
|
||||
func IsDealActive(state DealState) bool {
|
||||
return state.SectorStartEpoch() > -1 && state.SlashEpoch() == -1
|
||||
}
|
||||
|
||||
func labelFromGoString(s string) (markettypes.DealLabel, error) {
|
||||
|
@ -64,7 +64,7 @@ func (d *marketStatesDiffer) Add(key uint64, val *cbg.Deferred) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
d.Results.Added = append(d.Results.Added, DealIDState{abi.DealID(key), *ds})
|
||||
d.Results.Added = append(d.Results.Added, DealIDState{abi.DealID(key), ds})
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ func (d *marketStatesDiffer) Modify(key uint64, from, to *cbg.Deferred) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if *dsFrom != *dsTo {
|
||||
if !dsFrom.Equals(dsTo) {
|
||||
d.Results.Modified = append(d.Results.Modified, DealStateChange{abi.DealID(key), dsFrom, dsTo})
|
||||
}
|
||||
return nil
|
||||
@ -88,6 +88,6 @@ func (d *marketStatesDiffer) Remove(key uint64, val *cbg.Deferred) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
d.Results.Removed = append(d.Results.Removed, DealIDState{abi.DealID(key), *ds})
|
||||
d.Results.Removed = append(d.Results.Removed, DealIDState{abi.DealID(key), ds})
|
||||
return nil
|
||||
}
|
||||
|
@ -58,6 +58,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,6 +131,9 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return make12(store)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return make13(store)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -162,10 +168,10 @@ type BalanceTable interface {
|
||||
|
||||
type DealStates interface {
|
||||
ForEach(cb func(id abi.DealID, ds DealState) error) error
|
||||
Get(id abi.DealID) (*DealState, bool, error)
|
||||
Get(id abi.DealID) (DealState, bool, error)
|
||||
|
||||
array() adt.Array
|
||||
decode(*cbg.Deferred) (*DealState, error)
|
||||
decode(*cbg.Deferred) (DealState, error)
|
||||
}
|
||||
|
||||
type DealProposals interface {
|
||||
@ -226,6 +232,9 @@ func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStora
|
||||
case actorstypes.Version12:
|
||||
return decodePublishStorageDealsReturn12(b)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return decodePublishStorageDealsReturn13(b)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -233,7 +242,17 @@ func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStora
|
||||
type DealProposal = markettypes.DealProposal
|
||||
type DealLabel = markettypes.DealLabel
|
||||
|
||||
type DealState = markettypes.DealState
|
||||
type DealState interface {
|
||||
SectorStartEpoch() abi.ChainEpoch // -1 if not yet included in proven sector
|
||||
LastUpdatedEpoch() abi.ChainEpoch // -1 if deal state never updated
|
||||
SlashEpoch() abi.ChainEpoch // -1 if deal never slashed
|
||||
|
||||
Equals(other DealState) bool
|
||||
}
|
||||
|
||||
func DealStatesEqual(a, b DealState) bool {
|
||||
return DealStatesEqual(a, b)
|
||||
}
|
||||
|
||||
type DealStateChanges struct {
|
||||
Added []DealIDState
|
||||
@ -249,8 +268,8 @@ type DealIDState struct {
|
||||
// DealStateChange is a change in deal state from -> to
|
||||
type DealStateChange struct {
|
||||
ID abi.DealID
|
||||
From *DealState
|
||||
To *DealState
|
||||
From DealState
|
||||
To DealState
|
||||
}
|
||||
|
||||
type DealProposalChanges struct {
|
||||
@ -263,12 +282,35 @@ type ProposalIDState struct {
|
||||
Proposal markettypes.DealProposal
|
||||
}
|
||||
|
||||
func EmptyDealState() *DealState {
|
||||
return &DealState{
|
||||
SectorStartEpoch: -1,
|
||||
SlashEpoch: -1,
|
||||
LastUpdatedEpoch: -1,
|
||||
type emptyDealState struct{}
|
||||
|
||||
func (e *emptyDealState) SectorStartEpoch() abi.ChainEpoch {
|
||||
return -1
|
||||
}
|
||||
|
||||
func (e *emptyDealState) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return -1
|
||||
}
|
||||
|
||||
func (e *emptyDealState) SlashEpoch() abi.ChainEpoch {
|
||||
return -1
|
||||
}
|
||||
|
||||
func (e *emptyDealState) Equals(other DealState) bool {
|
||||
if e.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if e.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if e.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func EmptyDealState() DealState {
|
||||
return &emptyDealState{}
|
||||
}
|
||||
|
||||
// returns the earned fees and pending fees for a given deal
|
||||
@ -287,8 +329,8 @@ func GetDealFees(deal markettypes.DealProposal, height abi.ChainEpoch) (abi.Toke
|
||||
return ef, big.Sub(tf, ef)
|
||||
}
|
||||
|
||||
func IsDealActive(state markettypes.DealState) bool {
|
||||
return state.SectorStartEpoch > -1 && state.SlashEpoch == -1
|
||||
func IsDealActive(state DealState) bool {
|
||||
return state.SectorStartEpoch() > -1 && state.SlashEpoch() == -1
|
||||
}
|
||||
|
||||
func labelFromGoString(s string) (markettypes.DealLabel, error) {
|
||||
@ -313,5 +355,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ type dealStates{{.v}} struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates{{.v}}) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates{{.v}}) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal{{.v}} market{{.v}}.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal{{.v}})
|
||||
if err != nil {
|
||||
@ -185,7 +185,7 @@ func (s *dealStates{{.v}}) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV{{.v}}DealState(deal{{.v}})
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates{{.v}}) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -195,31 +195,57 @@ func (s *dealStates{{.v}}) ForEach(cb func(dealID abi.DealID, ds DealState) erro
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates{{.v}}) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates{{.v}}) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds{{.v}} market{{.v}}.DealState
|
||||
if err := ds{{.v}}.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV{{.v}}DealState(ds{{.v}})
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates{{.v}}) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV{{.v}}DealState(v{{.v}} market{{.v}}.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v{{.v}}.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v{{.v}}.LastUpdatedEpoch,
|
||||
SlashEpoch: v{{.v}}.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV{{.v}} struct {
|
||||
ds{{.v}} market{{.v}}.DealState
|
||||
}
|
||||
{{if (ge .v 9)}}
|
||||
ret.VerifiedClaim = verifregtypes.AllocationId(v{{.v}}.VerifiedClaim)
|
||||
{{end}}
|
||||
|
||||
return ret
|
||||
func (d dealStateV{{.v}}) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds{{.v}}.SectorStartEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV{{.v}}) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds{{.v}}.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV{{.v}}) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds{{.v}}.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV{{.v}}) Equals(other DealState) bool {
|
||||
if ov{{.v}}, ok := other.(dealStateV{{.v}}); ok {
|
||||
return d.ds{{.v}} == ov{{.v}}.ds{{.v}}
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV{{.v}})(nil)
|
||||
|
||||
func fromV{{.v}}DealState(v{{.v}} market{{.v}}.DealState) DealState {
|
||||
return dealStateV{{.v}}{v{{.v}}}
|
||||
}
|
||||
|
||||
type dealProposals{{.v}} struct {
|
||||
|
51
chain/actors/builtin/market/v0.go
generated
51
chain/actors/builtin/market/v0.go
generated
@ -154,7 +154,7 @@ type dealStates0 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates0) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates0) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal0 market0.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal0)
|
||||
if err != nil {
|
||||
@ -164,7 +164,7 @@ func (s *dealStates0) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV0DealState(deal0)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates0) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -174,28 +174,57 @@ func (s *dealStates0) ForEach(cb func(dealID abi.DealID, ds DealState) error) er
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates0) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates0) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds0 market0.DealState
|
||||
if err := ds0.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV0DealState(ds0)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates0) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV0DealState(v0 market0.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v0.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v0.LastUpdatedEpoch,
|
||||
SlashEpoch: v0.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV0 struct {
|
||||
ds0 market0.DealState
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV0) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds0.SectorStartEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV0) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds0.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV0) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds0.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV0) Equals(other DealState) bool {
|
||||
if ov0, ok := other.(dealStateV0); ok {
|
||||
return d.ds0 == ov0.ds0
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV0)(nil)
|
||||
|
||||
func fromV0DealState(v0 market0.DealState) DealState {
|
||||
return dealStateV0{v0}
|
||||
}
|
||||
|
||||
type dealProposals0 struct {
|
||||
|
51
chain/actors/builtin/market/v10.go
generated
51
chain/actors/builtin/market/v10.go
generated
@ -153,7 +153,7 @@ type dealStates10 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates10) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates10) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal10 market10.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal10)
|
||||
if err != nil {
|
||||
@ -163,7 +163,7 @@ func (s *dealStates10) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV10DealState(deal10)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates10) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -173,30 +173,57 @@ func (s *dealStates10) ForEach(cb func(dealID abi.DealID, ds DealState) error) e
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates10) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates10) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds10 market10.DealState
|
||||
if err := ds10.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV10DealState(ds10)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates10) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV10DealState(v10 market10.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v10.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v10.LastUpdatedEpoch,
|
||||
SlashEpoch: v10.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV10 struct {
|
||||
ds10 market10.DealState
|
||||
}
|
||||
|
||||
ret.VerifiedClaim = verifregtypes.AllocationId(v10.VerifiedClaim)
|
||||
func (d dealStateV10) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds10.SectorStartEpoch
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV10) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds10.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV10) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds10.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV10) Equals(other DealState) bool {
|
||||
if ov10, ok := other.(dealStateV10); ok {
|
||||
return d.ds10 == ov10.ds10
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV10)(nil)
|
||||
|
||||
func fromV10DealState(v10 market10.DealState) DealState {
|
||||
return dealStateV10{v10}
|
||||
}
|
||||
|
||||
type dealProposals10 struct {
|
||||
|
51
chain/actors/builtin/market/v11.go
generated
51
chain/actors/builtin/market/v11.go
generated
@ -153,7 +153,7 @@ type dealStates11 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates11) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates11) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal11 market11.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal11)
|
||||
if err != nil {
|
||||
@ -163,7 +163,7 @@ func (s *dealStates11) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV11DealState(deal11)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates11) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -173,30 +173,57 @@ func (s *dealStates11) ForEach(cb func(dealID abi.DealID, ds DealState) error) e
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates11) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates11) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds11 market11.DealState
|
||||
if err := ds11.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV11DealState(ds11)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates11) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV11DealState(v11 market11.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v11.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v11.LastUpdatedEpoch,
|
||||
SlashEpoch: v11.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV11 struct {
|
||||
ds11 market11.DealState
|
||||
}
|
||||
|
||||
ret.VerifiedClaim = verifregtypes.AllocationId(v11.VerifiedClaim)
|
||||
func (d dealStateV11) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds11.SectorStartEpoch
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV11) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds11.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV11) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds11.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV11) Equals(other DealState) bool {
|
||||
if ov11, ok := other.(dealStateV11); ok {
|
||||
return d.ds11 == ov11.ds11
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV11)(nil)
|
||||
|
||||
func fromV11DealState(v11 market11.DealState) DealState {
|
||||
return dealStateV11{v11}
|
||||
}
|
||||
|
||||
type dealProposals11 struct {
|
||||
|
51
chain/actors/builtin/market/v12.go
generated
51
chain/actors/builtin/market/v12.go
generated
@ -153,7 +153,7 @@ type dealStates12 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates12) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates12) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal12 market12.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal12)
|
||||
if err != nil {
|
||||
@ -163,7 +163,7 @@ func (s *dealStates12) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV12DealState(deal12)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates12) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -173,30 +173,57 @@ func (s *dealStates12) ForEach(cb func(dealID abi.DealID, ds DealState) error) e
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates12) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates12) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds12 market12.DealState
|
||||
if err := ds12.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV12DealState(ds12)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates12) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV12DealState(v12 market12.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v12.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v12.LastUpdatedEpoch,
|
||||
SlashEpoch: v12.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV12 struct {
|
||||
ds12 market12.DealState
|
||||
}
|
||||
|
||||
ret.VerifiedClaim = verifregtypes.AllocationId(v12.VerifiedClaim)
|
||||
func (d dealStateV12) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds12.SectorStartEpoch
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV12) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds12.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV12) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds12.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV12) Equals(other DealState) bool {
|
||||
if ov12, ok := other.(dealStateV12); ok {
|
||||
return d.ds12 == ov12.ds12
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV12)(nil)
|
||||
|
||||
func fromV12DealState(v12 market12.DealState) DealState {
|
||||
return dealStateV12{v12}
|
||||
}
|
||||
|
||||
type dealProposals12 struct {
|
||||
|
404
chain/actors/builtin/market/v13.go
generated
Normal file
404
chain/actors/builtin/market/v13.go
generated
Normal file
@ -0,0 +1,404 @@
|
||||
package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
market13 "github.com/filecoin-project/go-state-types/builtin/v13/market"
|
||||
adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt"
|
||||
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
verifregtypes "github.com/filecoin-project/lotus/chain/actors/builtin/verifreg"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store) (State, error) {
|
||||
out := state13{store: store}
|
||||
|
||||
s, err := market13.ConstructState(store)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
market13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) TotalLocked() (abi.TokenAmount, error) {
|
||||
fml := types.BigAdd(s.TotalClientLockedCollateral, s.TotalProviderLockedCollateral)
|
||||
fml = types.BigAdd(fml, s.TotalClientStorageFee)
|
||||
return fml, nil
|
||||
}
|
||||
|
||||
func (s *state13) BalancesChanged(otherState State) (bool, error) {
|
||||
otherState13, ok := otherState.(*state13)
|
||||
if !ok {
|
||||
// there's no way to compare different versions of the state, so let's
|
||||
// just say that means the state of balances has changed
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.EscrowTable.Equals(otherState13.State.EscrowTable) || !s.State.LockedTable.Equals(otherState13.State.LockedTable), nil
|
||||
}
|
||||
|
||||
func (s *state13) StatesChanged(otherState State) (bool, error) {
|
||||
otherState13, ok := otherState.(*state13)
|
||||
if !ok {
|
||||
// there's no way to compare different versions of the state, so let's
|
||||
// just say that means the state of balances has changed
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.States.Equals(otherState13.State.States), nil
|
||||
}
|
||||
|
||||
func (s *state13) States() (DealStates, error) {
|
||||
stateArray, err := adt13.AsArray(s.store, s.State.States, market13.StatesAmtBitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &dealStates13{stateArray}, nil
|
||||
}
|
||||
|
||||
func (s *state13) ProposalsChanged(otherState State) (bool, error) {
|
||||
otherState13, ok := otherState.(*state13)
|
||||
if !ok {
|
||||
// there's no way to compare different versions of the state, so let's
|
||||
// just say that means the state of balances has changed
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.Proposals.Equals(otherState13.State.Proposals), nil
|
||||
}
|
||||
|
||||
func (s *state13) Proposals() (DealProposals, error) {
|
||||
proposalArray, err := adt13.AsArray(s.store, s.State.Proposals, market13.ProposalsAmtBitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &dealProposals13{proposalArray}, nil
|
||||
}
|
||||
|
||||
func (s *state13) EscrowTable() (BalanceTable, error) {
|
||||
bt, err := adt13.AsBalanceTable(s.store, s.State.EscrowTable)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &balanceTable13{bt}, nil
|
||||
}
|
||||
|
||||
func (s *state13) LockedTable() (BalanceTable, error) {
|
||||
bt, err := adt13.AsBalanceTable(s.store, s.State.LockedTable)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &balanceTable13{bt}, nil
|
||||
}
|
||||
|
||||
func (s *state13) VerifyDealsForActivation(
|
||||
minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
|
||||
) (weight, verifiedWeight abi.DealWeight, err error) {
|
||||
w, vw, _, err := market13.ValidateDealsForActivation(&s.State, s.store, deals, minerAddr, sectorExpiry, currEpoch)
|
||||
return w, vw, err
|
||||
}
|
||||
|
||||
func (s *state13) NextID() (abi.DealID, error) {
|
||||
return s.State.NextID, nil
|
||||
}
|
||||
|
||||
type balanceTable13 struct {
|
||||
*adt13.BalanceTable
|
||||
}
|
||||
|
||||
func (bt *balanceTable13) ForEach(cb func(address.Address, abi.TokenAmount) error) error {
|
||||
asMap := (*adt13.Map)(bt.BalanceTable)
|
||||
var ta abi.TokenAmount
|
||||
return asMap.ForEach(&ta, func(key string) error {
|
||||
a, err := address.NewFromBytes([]byte(key))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return cb(a, ta)
|
||||
})
|
||||
}
|
||||
|
||||
type dealStates13 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates13) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal13 market13.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal13)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV13DealState(deal13)
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates13) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
var ds13 market13.DealState
|
||||
return s.Array.ForEach(&ds13, func(idx int64) error {
|
||||
return cb(abi.DealID(idx), fromV13DealState(ds13))
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates13) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds13 market13.DealState
|
||||
if err := ds13.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV13DealState(ds13)
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates13) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
type dealStateV13 struct {
|
||||
ds13 market13.DealState
|
||||
}
|
||||
|
||||
func (d dealStateV13) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds13.SectorStartEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV13) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds13.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV13) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds13.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV13) Equals(other DealState) bool {
|
||||
if ov13, ok := other.(dealStateV13); ok {
|
||||
return d.ds13 == ov13.ds13
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV13)(nil)
|
||||
|
||||
func fromV13DealState(v13 market13.DealState) DealState {
|
||||
return dealStateV13{v13}
|
||||
}
|
||||
|
||||
type dealProposals13 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealProposals13) Get(dealID abi.DealID) (*DealProposal, bool, error) {
|
||||
var proposal13 market13.DealProposal
|
||||
found, err := s.Array.Get(uint64(dealID), &proposal13)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
|
||||
proposal, err := fromV13DealProposal(proposal13)
|
||||
if err != nil {
|
||||
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return &proposal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals13) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
|
||||
var dp13 market13.DealProposal
|
||||
return s.Array.ForEach(&dp13, func(idx int64) error {
|
||||
dp, err := fromV13DealProposal(dp13)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return cb(abi.DealID(idx), dp)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealProposals13) decode(val *cbg.Deferred) (*DealProposal, error) {
|
||||
var dp13 market13.DealProposal
|
||||
if err := dp13.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
dp, err := fromV13DealProposal(dp13)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &dp, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals13) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV13DealProposal(v13 market13.DealProposal) (DealProposal, error) {
|
||||
|
||||
label, err := fromV13Label(v13.Label)
|
||||
|
||||
if err != nil {
|
||||
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
|
||||
}
|
||||
|
||||
return DealProposal{
|
||||
PieceCID: v13.PieceCID,
|
||||
PieceSize: v13.PieceSize,
|
||||
VerifiedDeal: v13.VerifiedDeal,
|
||||
Client: v13.Client,
|
||||
Provider: v13.Provider,
|
||||
|
||||
Label: label,
|
||||
|
||||
StartEpoch: v13.StartEpoch,
|
||||
EndEpoch: v13.EndEpoch,
|
||||
StoragePricePerEpoch: v13.StoragePricePerEpoch,
|
||||
|
||||
ProviderCollateral: v13.ProviderCollateral,
|
||||
ClientCollateral: v13.ClientCollateral,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func fromV13Label(v13 market13.DealLabel) (DealLabel, error) {
|
||||
if v13.IsString() {
|
||||
str, err := v13.ToString()
|
||||
if err != nil {
|
||||
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert string label to string: %w", err)
|
||||
}
|
||||
return markettypes.NewLabelFromString(str)
|
||||
}
|
||||
|
||||
bs, err := v13.ToBytes()
|
||||
if err != nil {
|
||||
return markettypes.EmptyDealLabel, xerrors.Errorf("failed to convert bytes label to bytes: %w", err)
|
||||
}
|
||||
return markettypes.NewLabelFromBytes(bs)
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
var _ PublishStorageDealsReturn = (*publishStorageDealsReturn13)(nil)
|
||||
|
||||
func decodePublishStorageDealsReturn13(b []byte) (PublishStorageDealsReturn, error) {
|
||||
var retval market13.PublishStorageDealsReturn
|
||||
if err := retval.UnmarshalCBOR(bytes.NewReader(b)); err != nil {
|
||||
return nil, xerrors.Errorf("failed to unmarshal PublishStorageDealsReturn: %w", err)
|
||||
}
|
||||
|
||||
return &publishStorageDealsReturn13{retval}, nil
|
||||
}
|
||||
|
||||
type publishStorageDealsReturn13 struct {
|
||||
market13.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn13) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
set, err := r.ValidDeals.IsSet(index)
|
||||
if err != nil || !set {
|
||||
return false, -1, err
|
||||
}
|
||||
maskBf, err := bitfield.NewFromIter(&rlepluslazy.RunSliceIterator{
|
||||
Runs: []rlepluslazy.Run{rlepluslazy.Run{Val: true, Len: index}}})
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
before, err := bitfield.IntersectBitField(maskBf, r.ValidDeals)
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
outIdx, err := before.Count()
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
return set, int(outIdx), nil
|
||||
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn13) DealIDs() ([]abi.DealID, error) {
|
||||
return r.IDs, nil
|
||||
}
|
||||
|
||||
func (s *state13) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error) {
|
||||
|
||||
allocations, err := adt13.AsMap(s.store, s.PendingDealAllocationIds, builtin.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("failed to load allocation id for %d: %w", dealId, err)
|
||||
}
|
||||
|
||||
var allocationId cbg.CborInt
|
||||
found, err := allocations.Get(abi.UIntKey(uint64(dealId)), &allocationId)
|
||||
if err != nil {
|
||||
return verifregtypes.NoAllocationID, xerrors.Errorf("failed to load allocation id for %d: %w", dealId, err)
|
||||
}
|
||||
if !found {
|
||||
return verifregtypes.NoAllocationID, nil
|
||||
}
|
||||
|
||||
return verifregtypes.AllocationId(allocationId), nil
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.MarketKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) 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
|
||||
}
|
51
chain/actors/builtin/market/v2.go
generated
51
chain/actors/builtin/market/v2.go
generated
@ -154,7 +154,7 @@ type dealStates2 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates2) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates2) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal2 market2.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal2)
|
||||
if err != nil {
|
||||
@ -164,7 +164,7 @@ func (s *dealStates2) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV2DealState(deal2)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates2) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -174,28 +174,57 @@ func (s *dealStates2) ForEach(cb func(dealID abi.DealID, ds DealState) error) er
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates2) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates2) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds2 market2.DealState
|
||||
if err := ds2.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV2DealState(ds2)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates2) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV2DealState(v2 market2.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v2.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v2.LastUpdatedEpoch,
|
||||
SlashEpoch: v2.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV2 struct {
|
||||
ds2 market2.DealState
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV2) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds2.SectorStartEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV2) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds2.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV2) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds2.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV2) Equals(other DealState) bool {
|
||||
if ov2, ok := other.(dealStateV2); ok {
|
||||
return d.ds2 == ov2.ds2
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV2)(nil)
|
||||
|
||||
func fromV2DealState(v2 market2.DealState) DealState {
|
||||
return dealStateV2{v2}
|
||||
}
|
||||
|
||||
type dealProposals2 struct {
|
||||
|
51
chain/actors/builtin/market/v3.go
generated
51
chain/actors/builtin/market/v3.go
generated
@ -149,7 +149,7 @@ type dealStates3 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates3) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates3) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal3 market3.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal3)
|
||||
if err != nil {
|
||||
@ -159,7 +159,7 @@ func (s *dealStates3) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV3DealState(deal3)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates3) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -169,28 +169,57 @@ func (s *dealStates3) ForEach(cb func(dealID abi.DealID, ds DealState) error) er
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates3) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates3) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds3 market3.DealState
|
||||
if err := ds3.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV3DealState(ds3)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates3) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV3DealState(v3 market3.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v3.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v3.LastUpdatedEpoch,
|
||||
SlashEpoch: v3.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV3 struct {
|
||||
ds3 market3.DealState
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV3) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds3.SectorStartEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV3) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds3.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV3) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds3.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV3) Equals(other DealState) bool {
|
||||
if ov3, ok := other.(dealStateV3); ok {
|
||||
return d.ds3 == ov3.ds3
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV3)(nil)
|
||||
|
||||
func fromV3DealState(v3 market3.DealState) DealState {
|
||||
return dealStateV3{v3}
|
||||
}
|
||||
|
||||
type dealProposals3 struct {
|
||||
|
51
chain/actors/builtin/market/v4.go
generated
51
chain/actors/builtin/market/v4.go
generated
@ -149,7 +149,7 @@ type dealStates4 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates4) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates4) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal4 market4.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal4)
|
||||
if err != nil {
|
||||
@ -159,7 +159,7 @@ func (s *dealStates4) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV4DealState(deal4)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates4) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -169,28 +169,57 @@ func (s *dealStates4) ForEach(cb func(dealID abi.DealID, ds DealState) error) er
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates4) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates4) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds4 market4.DealState
|
||||
if err := ds4.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV4DealState(ds4)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates4) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV4DealState(v4 market4.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v4.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v4.LastUpdatedEpoch,
|
||||
SlashEpoch: v4.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV4 struct {
|
||||
ds4 market4.DealState
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV4) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds4.SectorStartEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV4) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds4.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV4) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds4.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV4) Equals(other DealState) bool {
|
||||
if ov4, ok := other.(dealStateV4); ok {
|
||||
return d.ds4 == ov4.ds4
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV4)(nil)
|
||||
|
||||
func fromV4DealState(v4 market4.DealState) DealState {
|
||||
return dealStateV4{v4}
|
||||
}
|
||||
|
||||
type dealProposals4 struct {
|
||||
|
51
chain/actors/builtin/market/v5.go
generated
51
chain/actors/builtin/market/v5.go
generated
@ -149,7 +149,7 @@ type dealStates5 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates5) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates5) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal5 market5.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal5)
|
||||
if err != nil {
|
||||
@ -159,7 +159,7 @@ func (s *dealStates5) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV5DealState(deal5)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates5) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -169,28 +169,57 @@ func (s *dealStates5) ForEach(cb func(dealID abi.DealID, ds DealState) error) er
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates5) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates5) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds5 market5.DealState
|
||||
if err := ds5.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV5DealState(ds5)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates5) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV5DealState(v5 market5.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v5.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v5.LastUpdatedEpoch,
|
||||
SlashEpoch: v5.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV5 struct {
|
||||
ds5 market5.DealState
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV5) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds5.SectorStartEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV5) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds5.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV5) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds5.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV5) Equals(other DealState) bool {
|
||||
if ov5, ok := other.(dealStateV5); ok {
|
||||
return d.ds5 == ov5.ds5
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV5)(nil)
|
||||
|
||||
func fromV5DealState(v5 market5.DealState) DealState {
|
||||
return dealStateV5{v5}
|
||||
}
|
||||
|
||||
type dealProposals5 struct {
|
||||
|
51
chain/actors/builtin/market/v6.go
generated
51
chain/actors/builtin/market/v6.go
generated
@ -151,7 +151,7 @@ type dealStates6 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates6) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates6) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal6 market6.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal6)
|
||||
if err != nil {
|
||||
@ -161,7 +161,7 @@ func (s *dealStates6) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV6DealState(deal6)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates6) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -171,28 +171,57 @@ func (s *dealStates6) ForEach(cb func(dealID abi.DealID, ds DealState) error) er
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates6) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates6) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds6 market6.DealState
|
||||
if err := ds6.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV6DealState(ds6)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates6) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV6DealState(v6 market6.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v6.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v6.LastUpdatedEpoch,
|
||||
SlashEpoch: v6.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV6 struct {
|
||||
ds6 market6.DealState
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV6) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds6.SectorStartEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV6) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds6.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV6) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds6.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV6) Equals(other DealState) bool {
|
||||
if ov6, ok := other.(dealStateV6); ok {
|
||||
return d.ds6 == ov6.ds6
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV6)(nil)
|
||||
|
||||
func fromV6DealState(v6 market6.DealState) DealState {
|
||||
return dealStateV6{v6}
|
||||
}
|
||||
|
||||
type dealProposals6 struct {
|
||||
|
51
chain/actors/builtin/market/v7.go
generated
51
chain/actors/builtin/market/v7.go
generated
@ -151,7 +151,7 @@ type dealStates7 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates7) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates7) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal7 market7.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal7)
|
||||
if err != nil {
|
||||
@ -161,7 +161,7 @@ func (s *dealStates7) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV7DealState(deal7)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates7) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -171,28 +171,57 @@ func (s *dealStates7) ForEach(cb func(dealID abi.DealID, ds DealState) error) er
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates7) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates7) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds7 market7.DealState
|
||||
if err := ds7.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV7DealState(ds7)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates7) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV7DealState(v7 market7.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v7.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v7.LastUpdatedEpoch,
|
||||
SlashEpoch: v7.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV7 struct {
|
||||
ds7 market7.DealState
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV7) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds7.SectorStartEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV7) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds7.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV7) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds7.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV7) Equals(other DealState) bool {
|
||||
if ov7, ok := other.(dealStateV7); ok {
|
||||
return d.ds7 == ov7.ds7
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV7)(nil)
|
||||
|
||||
func fromV7DealState(v7 market7.DealState) DealState {
|
||||
return dealStateV7{v7}
|
||||
}
|
||||
|
||||
type dealProposals7 struct {
|
||||
|
51
chain/actors/builtin/market/v8.go
generated
51
chain/actors/builtin/market/v8.go
generated
@ -152,7 +152,7 @@ type dealStates8 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates8) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates8) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal8 market8.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal8)
|
||||
if err != nil {
|
||||
@ -162,7 +162,7 @@ func (s *dealStates8) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV8DealState(deal8)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates8) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -172,28 +172,57 @@ func (s *dealStates8) ForEach(cb func(dealID abi.DealID, ds DealState) error) er
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates8) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates8) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds8 market8.DealState
|
||||
if err := ds8.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV8DealState(ds8)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates8) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV8DealState(v8 market8.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v8.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v8.LastUpdatedEpoch,
|
||||
SlashEpoch: v8.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV8 struct {
|
||||
ds8 market8.DealState
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV8) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds8.SectorStartEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV8) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds8.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV8) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds8.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV8) Equals(other DealState) bool {
|
||||
if ov8, ok := other.(dealStateV8); ok {
|
||||
return d.ds8 == ov8.ds8
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV8)(nil)
|
||||
|
||||
func fromV8DealState(v8 market8.DealState) DealState {
|
||||
return dealStateV8{v8}
|
||||
}
|
||||
|
||||
type dealProposals8 struct {
|
||||
|
51
chain/actors/builtin/market/v9.go
generated
51
chain/actors/builtin/market/v9.go
generated
@ -153,7 +153,7 @@ type dealStates9 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates9) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
func (s *dealStates9) Get(dealID abi.DealID) (DealState, bool, error) {
|
||||
var deal9 market9.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal9)
|
||||
if err != nil {
|
||||
@ -163,7 +163,7 @@ func (s *dealStates9) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV9DealState(deal9)
|
||||
return &deal, true, nil
|
||||
return deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates9) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
@ -173,30 +173,57 @@ func (s *dealStates9) ForEach(cb func(dealID abi.DealID, ds DealState) error) er
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates9) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
func (s *dealStates9) decode(val *cbg.Deferred) (DealState, error) {
|
||||
var ds9 market9.DealState
|
||||
if err := ds9.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV9DealState(ds9)
|
||||
return &ds, nil
|
||||
return ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates9) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV9DealState(v9 market9.DealState) DealState {
|
||||
ret := DealState{
|
||||
SectorStartEpoch: v9.SectorStartEpoch,
|
||||
LastUpdatedEpoch: v9.LastUpdatedEpoch,
|
||||
SlashEpoch: v9.SlashEpoch,
|
||||
VerifiedClaim: 0,
|
||||
type dealStateV9 struct {
|
||||
ds9 market9.DealState
|
||||
}
|
||||
|
||||
ret.VerifiedClaim = verifregtypes.AllocationId(v9.VerifiedClaim)
|
||||
func (d dealStateV9) SectorStartEpoch() abi.ChainEpoch {
|
||||
return d.ds9.SectorStartEpoch
|
||||
}
|
||||
|
||||
return ret
|
||||
func (d dealStateV9) LastUpdatedEpoch() abi.ChainEpoch {
|
||||
return d.ds9.LastUpdatedEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV9) SlashEpoch() abi.ChainEpoch {
|
||||
return d.ds9.SlashEpoch
|
||||
}
|
||||
|
||||
func (d dealStateV9) Equals(other DealState) bool {
|
||||
if ov9, ok := other.(dealStateV9); ok {
|
||||
return d.ds9 == ov9.ds9
|
||||
}
|
||||
|
||||
if d.SectorStartEpoch() != other.SectorStartEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.LastUpdatedEpoch() != other.LastUpdatedEpoch() {
|
||||
return false
|
||||
}
|
||||
if d.SlashEpoch() != other.SlashEpoch() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var _ DealState = (*dealStateV9)(nil)
|
||||
|
||||
func fromV9DealState(v9 market9.DealState) DealState {
|
||||
return dealStateV9{v9}
|
||||
}
|
||||
|
||||
type dealProposals9 struct {
|
||||
|
@ -17,7 +17,8 @@ import (
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
miner12 "github.com/filecoin-project/go-state-types/builtin/v12/miner"
|
||||
|
||||
minertypes13 "github.com/filecoin-project/go-state-types/builtin/v13/miner"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
@ -153,7 +154,7 @@ type Partition interface {
|
||||
UnprovenSectors() (bitfield.BitField, error)
|
||||
}
|
||||
|
||||
type SectorOnChainInfo = miner12.SectorOnChainInfo
|
||||
type SectorOnChainInfo = minertypes13.SectorOnChainInfo
|
||||
|
||||
func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof, configWantSynthetic bool) (abi.RegisteredSealProof, error) {
|
||||
// We added support for the new proofs in network version 7, and removed support for the old
|
||||
@ -240,7 +241,9 @@ type DeclareFaultsParams = minertypes.DeclareFaultsParams
|
||||
type ProveCommitAggregateParams = minertypes.ProveCommitAggregateParams
|
||||
type ProveCommitSectorParams = minertypes.ProveCommitSectorParams
|
||||
type ProveReplicaUpdatesParams = minertypes.ProveReplicaUpdatesParams
|
||||
type ProveReplicaUpdatesParams2 = minertypes.ProveReplicaUpdatesParams2
|
||||
type ReplicaUpdate = minertypes.ReplicaUpdate
|
||||
type ReplicaUpdate2 = minertypes.ReplicaUpdate2
|
||||
type PreCommitSectorBatchParams = minertypes.PreCommitSectorBatchParams
|
||||
type PreCommitSectorBatchParams2 = minertypes.PreCommitSectorBatchParams2
|
||||
type ExtendSectorExpiration2Params = minertypes.ExtendSectorExpiration2Params
|
||||
@ -249,6 +252,13 @@ type ExpirationExtension2 = minertypes.ExpirationExtension2
|
||||
type CompactPartitionsParams = minertypes.CompactPartitionsParams
|
||||
type WithdrawBalanceParams = minertypes.WithdrawBalanceParams
|
||||
|
||||
type PieceActivationManifest = minertypes13.PieceActivationManifest
|
||||
type ProveCommitSectors3Params = minertypes13.ProveCommitSectors3Params
|
||||
type SectorActivationManifest = minertypes13.SectorActivationManifest
|
||||
type ProveReplicaUpdates3Params = minertypes13.ProveReplicaUpdates3Params
|
||||
type SectorUpdateManifest = minertypes13.SectorUpdateManifest
|
||||
type SectorOnChainInfoFlags = minertypes13.SectorOnChainInfoFlags
|
||||
|
||||
var QAPowerMax = minertypes.QAPowerMax
|
||||
|
||||
type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
miner12 "github.com/filecoin-project/go-state-types/builtin/v12/miner"
|
||||
minertypes13 "github.com/filecoin-project/go-state-types/builtin/v13/miner"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
@ -52,6 +52,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,6 +125,9 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
case actors.Version12:
|
||||
return make12(store)
|
||||
|
||||
case actors.Version13:
|
||||
return make13(store)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -213,7 +219,7 @@ type Partition interface {
|
||||
UnprovenSectors() (bitfield.BitField, error)
|
||||
}
|
||||
|
||||
type SectorOnChainInfo = miner12.SectorOnChainInfo
|
||||
type SectorOnChainInfo = minertypes13.SectorOnChainInfo
|
||||
|
||||
func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof, configWantSynthetic bool) (abi.RegisteredSealProof, error) {
|
||||
// We added support for the new proofs in network version 7, and removed support for the old
|
||||
@ -300,7 +306,9 @@ type DeclareFaultsParams = minertypes.DeclareFaultsParams
|
||||
type ProveCommitAggregateParams = minertypes.ProveCommitAggregateParams
|
||||
type ProveCommitSectorParams = minertypes.ProveCommitSectorParams
|
||||
type ProveReplicaUpdatesParams = minertypes.ProveReplicaUpdatesParams
|
||||
type ProveReplicaUpdatesParams2 = minertypes.ProveReplicaUpdatesParams2
|
||||
type ReplicaUpdate = minertypes.ReplicaUpdate
|
||||
type ReplicaUpdate2 = minertypes.ReplicaUpdate2
|
||||
type PreCommitSectorBatchParams = minertypes.PreCommitSectorBatchParams
|
||||
type PreCommitSectorBatchParams2 = minertypes.PreCommitSectorBatchParams2
|
||||
type ExtendSectorExpiration2Params = minertypes.ExtendSectorExpiration2Params
|
||||
@ -309,6 +317,13 @@ type ExpirationExtension2 = minertypes.ExpirationExtension2
|
||||
type CompactPartitionsParams = minertypes.CompactPartitionsParams
|
||||
type WithdrawBalanceParams = minertypes.WithdrawBalanceParams
|
||||
|
||||
type PieceActivationManifest = minertypes13.PieceActivationManifest
|
||||
type ProveCommitSectors3Params = minertypes13.ProveCommitSectors3Params
|
||||
type SectorActivationManifest = minertypes13.SectorActivationManifest
|
||||
type ProveReplicaUpdates3Params = minertypes13.ProveReplicaUpdates3Params
|
||||
type SectorUpdateManifest = minertypes13.SectorUpdateManifest
|
||||
type SectorOnChainInfoFlags = minertypes13.SectorOnChainInfoFlags
|
||||
|
||||
var QAPowerMax = minertypes.QAPowerMax
|
||||
|
||||
type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo
|
||||
@ -375,5 +390,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
594
chain/actors/builtin/miner/v13.go
generated
Normal file
594
chain/actors/builtin/miner/v13.go
generated
Normal file
@ -0,0 +1,594 @@
|
||||
package miner
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
miner13 "github.com/filecoin-project/go-state-types/builtin/v13/miner"
|
||||
adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store) (State, error) {
|
||||
out := state13{store: store}
|
||||
out.State = miner13.State{}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
miner13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
type deadline13 struct {
|
||||
miner13.Deadline
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
type partition13 struct {
|
||||
miner13.Partition
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmount, err error) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = xerrors.Errorf("failed to get available balance: %w", r)
|
||||
available = abi.NewTokenAmount(0)
|
||||
}
|
||||
}()
|
||||
// this panics if the miner doesn't have enough funds to cover their locked pledge
|
||||
available, err = s.GetAvailableBalance(bal)
|
||||
return available, err
|
||||
}
|
||||
|
||||
func (s *state13) VestedFunds(epoch abi.ChainEpoch) (abi.TokenAmount, error) {
|
||||
return s.CheckVestedFunds(s.store, epoch)
|
||||
}
|
||||
|
||||
func (s *state13) LockedFunds() (LockedFunds, error) {
|
||||
return LockedFunds{
|
||||
VestingFunds: s.State.LockedFunds,
|
||||
InitialPledgeRequirement: s.State.InitialPledge,
|
||||
PreCommitDeposits: s.State.PreCommitDeposits,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state13) FeeDebt() (abi.TokenAmount, error) {
|
||||
return s.State.FeeDebt, nil
|
||||
}
|
||||
|
||||
func (s *state13) InitialPledge() (abi.TokenAmount, error) {
|
||||
return s.State.InitialPledge, nil
|
||||
}
|
||||
|
||||
func (s *state13) PreCommitDeposits() (abi.TokenAmount, error) {
|
||||
return s.State.PreCommitDeposits, nil
|
||||
}
|
||||
|
||||
// Returns nil, nil if sector is not found
|
||||
func (s *state13) GetSector(num abi.SectorNumber) (*SectorOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ret := fromV13SectorOnChainInfo(*info)
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state13) FindSector(num abi.SectorNumber) (*SectorLocation, error) {
|
||||
dlIdx, partIdx, err := s.State.FindSector(s.store, num)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &SectorLocation{
|
||||
Deadline: dlIdx,
|
||||
Partition: partIdx,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state13) NumLiveSectors() (uint64, error) {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
var total uint64
|
||||
if err := dls.ForEach(s.store, func(dlIdx uint64, dl *miner13.Deadline) error {
|
||||
total += dl.LiveSectors
|
||||
return nil
|
||||
}); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return total, nil
|
||||
}
|
||||
|
||||
// GetSectorExpiration returns the effective expiration of the given sector.
|
||||
//
|
||||
// If the sector does not expire early, the Early expiration field is 0.
|
||||
func (s *state13) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, error) {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// NOTE: this can be optimized significantly.
|
||||
// 1. If the sector is non-faulty, it will expire on-time (can be
|
||||
// learned from the sector info).
|
||||
// 2. If it's faulty, it will expire early within the first 42 entries
|
||||
// of the expiration queue.
|
||||
|
||||
stopErr := errors.New("stop")
|
||||
out := SectorExpiration{}
|
||||
err = dls.ForEach(s.store, func(dlIdx uint64, dl *miner13.Deadline) error {
|
||||
partitions, err := dl.PartitionsArray(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
quant := s.State.QuantSpecForDeadline(dlIdx)
|
||||
var part miner13.Partition
|
||||
return partitions.ForEach(&part, func(partIdx int64) error {
|
||||
if found, err := part.Sectors.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if !found {
|
||||
return nil
|
||||
}
|
||||
if found, err := part.Terminated.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if found {
|
||||
// already terminated
|
||||
return stopErr
|
||||
}
|
||||
|
||||
q, err := miner13.LoadExpirationQueue(s.store, part.ExpirationsEpochs, quant, miner13.PartitionExpirationAmtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var exp miner13.ExpirationSet
|
||||
return q.ForEach(&exp, func(epoch int64) error {
|
||||
if early, err := exp.EarlySectors.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if early {
|
||||
out.Early = abi.ChainEpoch(epoch)
|
||||
return nil
|
||||
}
|
||||
if onTime, err := exp.OnTimeSectors.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if onTime {
|
||||
out.OnTime = abi.ChainEpoch(epoch)
|
||||
return stopErr
|
||||
}
|
||||
return nil
|
||||
})
|
||||
})
|
||||
})
|
||||
if err == stopErr {
|
||||
err = nil
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if out.Early == 0 && out.OnTime == 0 {
|
||||
return nil, xerrors.Errorf("failed to find sector %d", num)
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (s *state13) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ret := fromV13SectorPreCommitOnChainInfo(*info)
|
||||
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state13) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
|
||||
precommitted, err := adt13.AsMap(s.store, s.State.PreCommittedSectors, builtin13.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var info miner13.SectorPreCommitOnChainInfo
|
||||
if err := precommitted.ForEach(&info, func(_ string) error {
|
||||
return cb(fromV13SectorPreCommitOnChainInfo(info))
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state13) LoadSectors(snos *bitfield.BitField) ([]*SectorOnChainInfo, error) {
|
||||
sectors, err := miner13.LoadSectors(s.store, s.State.Sectors)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// If no sector numbers are specified, load all.
|
||||
if snos == nil {
|
||||
infos := make([]*SectorOnChainInfo, 0, sectors.Length())
|
||||
var info13 miner13.SectorOnChainInfo
|
||||
if err := sectors.ForEach(&info13, func(_ int64) error {
|
||||
info := fromV13SectorOnChainInfo(info13)
|
||||
infos = append(infos, &info)
|
||||
return nil
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return infos, nil
|
||||
}
|
||||
|
||||
// Otherwise, load selected.
|
||||
infos13, err := sectors.Load(*snos)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
infos := make([]*SectorOnChainInfo, len(infos13))
|
||||
for i, info13 := range infos13 {
|
||||
info := fromV13SectorOnChainInfo(*info13)
|
||||
infos[i] = &info
|
||||
}
|
||||
return infos, nil
|
||||
}
|
||||
|
||||
func (s *state13) loadAllocatedSectorNumbers() (bitfield.BitField, error) {
|
||||
var allocatedSectors bitfield.BitField
|
||||
err := s.store.Get(s.store.Context(), s.State.AllocatedSectors, &allocatedSectors)
|
||||
return allocatedSectors, err
|
||||
}
|
||||
|
||||
func (s *state13) IsAllocated(num abi.SectorNumber) (bool, error) {
|
||||
allocatedSectors, err := s.loadAllocatedSectorNumbers()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return allocatedSectors.IsSet(uint64(num))
|
||||
}
|
||||
|
||||
func (s *state13) GetProvingPeriodStart() (abi.ChainEpoch, error) {
|
||||
return s.State.ProvingPeriodStart, nil
|
||||
}
|
||||
|
||||
func (s *state13) UnallocatedSectorNumbers(count int) ([]abi.SectorNumber, error) {
|
||||
allocatedSectors, err := s.loadAllocatedSectorNumbers()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
allocatedRuns, err := allocatedSectors.RunIterator()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
unallocatedRuns, err := rle.Subtract(
|
||||
&rle.RunSliceIterator{Runs: []rle.Run{{Val: true, Len: abi.MaxSectorNumber}}},
|
||||
allocatedRuns,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
iter, err := rle.BitsFromRuns(unallocatedRuns)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
sectors := make([]abi.SectorNumber, 0, count)
|
||||
for iter.HasNext() && len(sectors) < count {
|
||||
nextNo, err := iter.Next()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sectors = append(sectors, abi.SectorNumber(nextNo))
|
||||
}
|
||||
|
||||
return sectors, nil
|
||||
}
|
||||
|
||||
func (s *state13) GetAllocatedSectors() (*bitfield.BitField, error) {
|
||||
var allocatedSectors bitfield.BitField
|
||||
if err := s.store.Get(s.store.Context(), s.State.AllocatedSectors, &allocatedSectors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &allocatedSectors, nil
|
||||
}
|
||||
|
||||
func (s *state13) LoadDeadline(idx uint64) (Deadline, error) {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dl, err := dls.LoadDeadline(s.store, idx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &deadline13{*dl, s.store}, nil
|
||||
}
|
||||
|
||||
func (s *state13) ForEachDeadline(cb func(uint64, Deadline) error) error {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return dls.ForEach(s.store, func(i uint64, dl *miner13.Deadline) error {
|
||||
return cb(i, &deadline13{*dl, s.store})
|
||||
})
|
||||
}
|
||||
|
||||
func (s *state13) NumDeadlines() (uint64, error) {
|
||||
return miner13.WPoStPeriodDeadlines, nil
|
||||
}
|
||||
|
||||
func (s *state13) DeadlinesChanged(other State) (bool, error) {
|
||||
other13, ok := other.(*state13)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return !s.State.Deadlines.Equals(other13.Deadlines), nil
|
||||
}
|
||||
|
||||
func (s *state13) MinerInfoChanged(other State) (bool, error) {
|
||||
other0, ok := other.(*state13)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.Info.Equals(other0.State.Info), nil
|
||||
}
|
||||
|
||||
func (s *state13) Info() (MinerInfo, error) {
|
||||
info, err := s.State.GetInfo(s.store)
|
||||
if err != nil {
|
||||
return MinerInfo{}, err
|
||||
}
|
||||
|
||||
mi := MinerInfo{
|
||||
Owner: info.Owner,
|
||||
Worker: info.Worker,
|
||||
ControlAddresses: info.ControlAddresses,
|
||||
|
||||
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
|
||||
|
||||
PeerId: info.PeerId,
|
||||
Multiaddrs: info.Multiaddrs,
|
||||
WindowPoStProofType: info.WindowPoStProofType,
|
||||
SectorSize: info.SectorSize,
|
||||
WindowPoStPartitionSectors: info.WindowPoStPartitionSectors,
|
||||
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
|
||||
|
||||
Beneficiary: info.Beneficiary,
|
||||
BeneficiaryTerm: BeneficiaryTerm(info.BeneficiaryTerm),
|
||||
PendingBeneficiaryTerm: (*PendingBeneficiaryChange)(info.PendingBeneficiaryTerm),
|
||||
}
|
||||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
func (s *state13) DeadlineInfo(epoch abi.ChainEpoch) (*dline.Info, error) {
|
||||
return s.State.RecordedDeadlineInfo(epoch), nil
|
||||
}
|
||||
|
||||
func (s *state13) DeadlineCronActive() (bool, error) {
|
||||
return s.State.DeadlineCronActive, nil
|
||||
}
|
||||
|
||||
func (s *state13) sectors() (adt.Array, error) {
|
||||
return adt13.AsArray(s.store, s.Sectors, miner13.SectorsAmtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state13) decodeSectorOnChainInfo(val *cbg.Deferred) (SectorOnChainInfo, error) {
|
||||
var si miner13.SectorOnChainInfo
|
||||
err := si.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV13SectorOnChainInfo(si), nil
|
||||
}
|
||||
|
||||
func (s *state13) precommits() (adt.Map, error) {
|
||||
return adt13.AsMap(s.store, s.PreCommittedSectors, builtin13.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state13) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
|
||||
var sp miner13.SectorPreCommitOnChainInfo
|
||||
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorPreCommitOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV13SectorPreCommitOnChainInfo(sp), nil
|
||||
}
|
||||
|
||||
func (s *state13) EraseAllUnproven() error {
|
||||
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = dls.ForEach(s.store, func(dindx uint64, dl *miner13.Deadline) error {
|
||||
ps, err := dl.PartitionsArray(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var part miner13.Partition
|
||||
err = ps.ForEach(&part, func(pindx int64) error {
|
||||
_ = part.ActivateUnproven()
|
||||
err = ps.Set(uint64(pindx), &part)
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dl.Partitions, err = ps.Root()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return dls.UpdateDeadline(s.store, dindx, dl)
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return s.State.SaveDeadlines(s.store, dls)
|
||||
|
||||
}
|
||||
|
||||
func (d *deadline13) LoadPartition(idx uint64) (Partition, error) {
|
||||
p, err := d.Deadline.LoadPartition(d.store, idx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &partition13{*p, d.store}, nil
|
||||
}
|
||||
|
||||
func (d *deadline13) ForEachPartition(cb func(uint64, Partition) error) error {
|
||||
ps, err := d.Deadline.PartitionsArray(d.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var part miner13.Partition
|
||||
return ps.ForEach(&part, func(i int64) error {
|
||||
return cb(uint64(i), &partition13{part, d.store})
|
||||
})
|
||||
}
|
||||
|
||||
func (d *deadline13) PartitionsChanged(other Deadline) (bool, error) {
|
||||
other13, ok := other.(*deadline13)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return !d.Deadline.Partitions.Equals(other13.Deadline.Partitions), nil
|
||||
}
|
||||
|
||||
func (d *deadline13) PartitionsPoSted() (bitfield.BitField, error) {
|
||||
return d.Deadline.PartitionsPoSted, nil
|
||||
}
|
||||
|
||||
func (d *deadline13) DisputableProofCount() (uint64, error) {
|
||||
|
||||
ops, err := d.OptimisticProofsSnapshotArray(d.store)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return ops.Length(), nil
|
||||
|
||||
}
|
||||
|
||||
func (p *partition13) AllSectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Sectors, nil
|
||||
}
|
||||
|
||||
func (p *partition13) FaultySectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Faults, nil
|
||||
}
|
||||
|
||||
func (p *partition13) RecoveringSectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Recoveries, nil
|
||||
}
|
||||
|
||||
func (p *partition13) UnprovenSectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Unproven, nil
|
||||
}
|
||||
|
||||
func fromV13SectorOnChainInfo(v13 miner13.SectorOnChainInfo) SectorOnChainInfo {
|
||||
info := SectorOnChainInfo{
|
||||
SectorNumber: v13.SectorNumber,
|
||||
SealProof: v13.SealProof,
|
||||
SealedCID: v13.SealedCID,
|
||||
DealIDs: v13.DealIDs,
|
||||
Activation: v13.Activation,
|
||||
Expiration: v13.Expiration,
|
||||
DealWeight: v13.DealWeight,
|
||||
VerifiedDealWeight: v13.VerifiedDealWeight,
|
||||
InitialPledge: v13.InitialPledge,
|
||||
ExpectedDayReward: v13.ExpectedDayReward,
|
||||
ExpectedStoragePledge: v13.ExpectedStoragePledge,
|
||||
|
||||
SectorKeyCID: v13.SectorKeyCID,
|
||||
|
||||
PowerBaseEpoch: v13.PowerBaseEpoch,
|
||||
ReplacedDayReward: v13.ReplacedDayReward,
|
||||
}
|
||||
return info
|
||||
}
|
||||
|
||||
func fromV13SectorPreCommitOnChainInfo(v13 miner13.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
|
||||
ret := SectorPreCommitOnChainInfo{
|
||||
Info: SectorPreCommitInfo{
|
||||
SealProof: v13.Info.SealProof,
|
||||
SectorNumber: v13.Info.SectorNumber,
|
||||
SealedCID: v13.Info.SealedCID,
|
||||
SealRandEpoch: v13.Info.SealRandEpoch,
|
||||
DealIDs: v13.Info.DealIDs,
|
||||
Expiration: v13.Info.Expiration,
|
||||
UnsealedCid: nil,
|
||||
},
|
||||
PreCommitDeposit: v13.PreCommitDeposit,
|
||||
PreCommitEpoch: v13.PreCommitEpoch,
|
||||
}
|
||||
|
||||
ret.Info.UnsealedCid = v13.Info.UnsealedCid
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.MinerKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
4
chain/actors/builtin/multisig/message10.go
generated
4
chain/actors/builtin/multisig/message10.go
generated
@ -8,7 +8,7 @@ import (
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
multisig10 "github.com/filecoin-project/go-state-types/builtin/v10/multisig"
|
||||
init12 "github.com/filecoin-project/go-state-types/builtin/v12/init"
|
||||
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
@ -57,7 +57,7 @@ func (m message10) Create(
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init12.ExecParams{
|
||||
execParams := &init13.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
|
4
chain/actors/builtin/multisig/message11.go
generated
4
chain/actors/builtin/multisig/message11.go
generated
@ -8,7 +8,7 @@ import (
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
multisig11 "github.com/filecoin-project/go-state-types/builtin/v11/multisig"
|
||||
init12 "github.com/filecoin-project/go-state-types/builtin/v12/init"
|
||||
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
@ -57,7 +57,7 @@ func (m message11) Create(
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init12.ExecParams{
|
||||
execParams := &init13.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
|
4
chain/actors/builtin/multisig/message12.go
generated
4
chain/actors/builtin/multisig/message12.go
generated
@ -7,8 +7,8 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
init12 "github.com/filecoin-project/go-state-types/builtin/v12/init"
|
||||
multisig12 "github.com/filecoin-project/go-state-types/builtin/v12/multisig"
|
||||
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
@ -57,7 +57,7 @@ func (m message12) Create(
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init12.ExecParams{
|
||||
execParams := &init13.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
|
77
chain/actors/builtin/multisig/message13.go
generated
Normal file
77
chain/actors/builtin/multisig/message13.go
generated
Normal file
@ -0,0 +1,77 @@
|
||||
package multisig
|
||||
|
||||
import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
|
||||
multisig13 "github.com/filecoin-project/go-state-types/builtin/v13/multisig"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
type message13 struct{ message0 }
|
||||
|
||||
func (m message13) Create(
|
||||
signers []address.Address, threshold uint64,
|
||||
unlockStart, unlockDuration abi.ChainEpoch,
|
||||
initialAmount abi.TokenAmount,
|
||||
) (*types.Message, error) {
|
||||
|
||||
lenAddrs := uint64(len(signers))
|
||||
|
||||
if lenAddrs < threshold {
|
||||
return nil, xerrors.Errorf("cannot require signing of more addresses than provided for multisig")
|
||||
}
|
||||
|
||||
if threshold == 0 {
|
||||
threshold = lenAddrs
|
||||
}
|
||||
|
||||
if m.from == address.Undef {
|
||||
return nil, xerrors.Errorf("must provide source address")
|
||||
}
|
||||
|
||||
// Set up constructor parameters for multisig
|
||||
msigParams := &multisig13.ConstructorParams{
|
||||
Signers: signers,
|
||||
NumApprovalsThreshold: threshold,
|
||||
UnlockDuration: unlockDuration,
|
||||
StartEpoch: unlockStart,
|
||||
}
|
||||
|
||||
enc, actErr := actors.SerializeParams(msigParams)
|
||||
if actErr != nil {
|
||||
return nil, actErr
|
||||
}
|
||||
|
||||
code, ok := actors.GetActorCodeID(actorstypes.Version13, manifest.MultisigKey)
|
||||
if !ok {
|
||||
return nil, xerrors.Errorf("failed to get multisig code ID")
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init13.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
|
||||
enc, actErr = actors.SerializeParams(execParams)
|
||||
if actErr != nil {
|
||||
return nil, actErr
|
||||
}
|
||||
|
||||
return &types.Message{
|
||||
To: init_.Address,
|
||||
From: m.from,
|
||||
Method: builtintypes.MethodsInit.Exec,
|
||||
Params: enc,
|
||||
Value: initialAmount,
|
||||
}, nil
|
||||
}
|
4
chain/actors/builtin/multisig/message8.go
generated
4
chain/actors/builtin/multisig/message8.go
generated
@ -7,7 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
init12 "github.com/filecoin-project/go-state-types/builtin/v12/init"
|
||||
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
|
||||
multisig8 "github.com/filecoin-project/go-state-types/builtin/v8/multisig"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
@ -57,7 +57,7 @@ func (m message8) Create(
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init12.ExecParams{
|
||||
execParams := &init13.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
|
4
chain/actors/builtin/multisig/message9.go
generated
4
chain/actors/builtin/multisig/message9.go
generated
@ -7,7 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
init12 "github.com/filecoin-project/go-state-types/builtin/v12/init"
|
||||
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
|
||||
multisig9 "github.com/filecoin-project/go-state-types/builtin/v9/multisig"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
@ -57,7 +57,7 @@ func (m message9) Create(
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init12.ExecParams{
|
||||
execParams := &init13.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
msig12 "github.com/filecoin-project/go-state-types/builtin/v12/multisig"
|
||||
msig13 "github.com/filecoin-project/go-state-types/builtin/v13/multisig"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
@ -51,6 +51,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,6 +124,9 @@ func MakeState(store adt.Store, av actorstypes.Version, signers []address.Addres
|
||||
case actorstypes.Version12:
|
||||
return make12(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return make13(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -147,7 +153,7 @@ type State interface {
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
type Transaction = msig12.Transaction
|
||||
type Transaction = msig13.Transaction
|
||||
|
||||
var Methods = builtintypes.MethodsMultisig
|
||||
|
||||
@ -189,6 +195,9 @@ func Message(version actorstypes.Version, from address.Address) MessageBuilder {
|
||||
|
||||
case actorstypes.Version12:
|
||||
return message12{message0{from}}
|
||||
|
||||
case actorstypes.Version13:
|
||||
return message13{message0{from}}
|
||||
default:
|
||||
panic(fmt.Sprintf("unsupported actors version: %d", version))
|
||||
}
|
||||
@ -212,13 +221,13 @@ type MessageBuilder interface {
|
||||
}
|
||||
|
||||
// this type is the same between v0 and v2
|
||||
type ProposalHashData = msig12.ProposalHashData
|
||||
type ProposeReturn = msig12.ProposeReturn
|
||||
type ProposeParams = msig12.ProposeParams
|
||||
type ApproveReturn = msig12.ApproveReturn
|
||||
type ProposalHashData = msig13.ProposalHashData
|
||||
type ProposeReturn = msig13.ProposeReturn
|
||||
type ProposeParams = msig13.ProposeParams
|
||||
type ApproveReturn = msig13.ApproveReturn
|
||||
|
||||
func txnParams(id uint64, data *ProposalHashData) ([]byte, error) {
|
||||
params := msig12.TxnIDParams{ID: msig12.TxnID(id)}
|
||||
params := msig13.TxnIDParams{ID: msig13.TxnID(id)}
|
||||
if data != nil {
|
||||
if data.Requester.Protocol() != address.ID {
|
||||
return nil, xerrors.Errorf("proposer address must be an ID address, was %s", data.Requester)
|
||||
@ -254,5 +263,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
138
chain/actors/builtin/multisig/v13.go
generated
Normal file
138
chain/actors/builtin/multisig/v13.go
generated
Normal file
@ -0,0 +1,138 @@
|
||||
package multisig
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
msig13 "github.com/filecoin-project/go-state-types/builtin/v13/multisig"
|
||||
adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
|
||||
out := state13{store: store}
|
||||
out.State = msig13.State{}
|
||||
out.State.Signers = signers
|
||||
out.State.NumApprovalsThreshold = threshold
|
||||
out.State.StartEpoch = startEpoch
|
||||
out.State.UnlockDuration = unlockDuration
|
||||
out.State.InitialBalance = initialBalance
|
||||
|
||||
em, err := adt13.StoreEmptyMap(store, builtin13.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State.PendingTxns = em
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
msig13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) LockedBalance(currEpoch abi.ChainEpoch) (abi.TokenAmount, error) {
|
||||
return s.State.AmountLocked(currEpoch - s.State.StartEpoch), nil
|
||||
}
|
||||
|
||||
func (s *state13) StartEpoch() (abi.ChainEpoch, error) {
|
||||
return s.State.StartEpoch, nil
|
||||
}
|
||||
|
||||
func (s *state13) UnlockDuration() (abi.ChainEpoch, error) {
|
||||
return s.State.UnlockDuration, nil
|
||||
}
|
||||
|
||||
func (s *state13) InitialBalance() (abi.TokenAmount, error) {
|
||||
return s.State.InitialBalance, nil
|
||||
}
|
||||
|
||||
func (s *state13) Threshold() (uint64, error) {
|
||||
return s.State.NumApprovalsThreshold, nil
|
||||
}
|
||||
|
||||
func (s *state13) Signers() ([]address.Address, error) {
|
||||
return s.State.Signers, nil
|
||||
}
|
||||
|
||||
func (s *state13) ForEachPendingTxn(cb func(id int64, txn Transaction) error) error {
|
||||
arr, err := adt13.AsMap(s.store, s.State.PendingTxns, builtin13.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var out msig13.Transaction
|
||||
return arr.ForEach(&out, func(key string) error {
|
||||
txid, n := binary.Varint([]byte(key))
|
||||
if n <= 0 {
|
||||
return xerrors.Errorf("invalid pending transaction key: %v", key)
|
||||
}
|
||||
return cb(txid, (Transaction)(out)) //nolint:unconvert
|
||||
})
|
||||
}
|
||||
|
||||
func (s *state13) PendingTxnChanged(other State) (bool, error) {
|
||||
other13, ok := other.(*state13)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.PendingTxns.Equals(other13.PendingTxns), nil
|
||||
}
|
||||
|
||||
func (s *state13) transactions() (adt.Map, error) {
|
||||
return adt13.AsMap(s.store, s.PendingTxns, builtin13.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state13) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
var tx msig13.Transaction
|
||||
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Transaction{}, err
|
||||
}
|
||||
return Transaction(tx), nil
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.MultisigKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
109
chain/actors/builtin/paych/message13.go
generated
Normal file
109
chain/actors/builtin/paych/message13.go
generated
Normal file
@ -0,0 +1,109 @@
|
||||
package paych
|
||||
|
||||
import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
|
||||
paych13 "github.com/filecoin-project/go-state-types/builtin/v13/paych"
|
||||
paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
type message13 struct{ from address.Address }
|
||||
|
||||
func (m message13) Create(to address.Address, initialAmount abi.TokenAmount) (*types.Message, error) {
|
||||
|
||||
actorCodeID, ok := actors.GetActorCodeID(actorstypes.Version13, "paymentchannel")
|
||||
if !ok {
|
||||
return nil, xerrors.Errorf("error getting actor paymentchannel code id for actor version %d", 13)
|
||||
}
|
||||
|
||||
params, aerr := actors.SerializeParams(&paych13.ConstructorParams{From: m.from, To: to})
|
||||
if aerr != nil {
|
||||
return nil, aerr
|
||||
}
|
||||
enc, aerr := actors.SerializeParams(&init13.ExecParams{
|
||||
CodeCID: actorCodeID,
|
||||
ConstructorParams: params,
|
||||
})
|
||||
if aerr != nil {
|
||||
return nil, aerr
|
||||
}
|
||||
|
||||
return &types.Message{
|
||||
To: init_.Address,
|
||||
From: m.from,
|
||||
Value: initialAmount,
|
||||
Method: builtin13.MethodsInit.Exec,
|
||||
Params: enc,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (m message13) Update(paych address.Address, sv *paychtypes.SignedVoucher, secret []byte) (*types.Message, error) {
|
||||
params, aerr := actors.SerializeParams(&paych13.UpdateChannelStateParams{
|
||||
|
||||
Sv: toV13SignedVoucher(*sv),
|
||||
|
||||
Secret: secret,
|
||||
})
|
||||
if aerr != nil {
|
||||
return nil, aerr
|
||||
}
|
||||
|
||||
return &types.Message{
|
||||
To: paych,
|
||||
From: m.from,
|
||||
Value: abi.NewTokenAmount(0),
|
||||
Method: builtin13.MethodsPaych.UpdateChannelState,
|
||||
Params: params,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func toV13SignedVoucher(sv paychtypes.SignedVoucher) paych13.SignedVoucher {
|
||||
merges := make([]paych13.Merge, len(sv.Merges))
|
||||
for i := range sv.Merges {
|
||||
merges[i] = paych13.Merge{
|
||||
Lane: sv.Merges[i].Lane,
|
||||
Nonce: sv.Merges[i].Nonce,
|
||||
}
|
||||
}
|
||||
|
||||
return paych13.SignedVoucher{
|
||||
ChannelAddr: sv.ChannelAddr,
|
||||
TimeLockMin: sv.TimeLockMin,
|
||||
TimeLockMax: sv.TimeLockMax,
|
||||
SecretHash: sv.SecretHash,
|
||||
Extra: (*paych13.ModVerifyParams)(sv.Extra),
|
||||
Lane: sv.Lane,
|
||||
Nonce: sv.Nonce,
|
||||
Amount: sv.Amount,
|
||||
MinSettleHeight: sv.MinSettleHeight,
|
||||
Merges: merges,
|
||||
Signature: sv.Signature,
|
||||
}
|
||||
}
|
||||
|
||||
func (m message13) Settle(paych address.Address) (*types.Message, error) {
|
||||
return &types.Message{
|
||||
To: paych,
|
||||
From: m.from,
|
||||
Value: abi.NewTokenAmount(0),
|
||||
Method: builtin13.MethodsPaych.Settle,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (m message13) Collect(paych address.Address) (*types.Message, error) {
|
||||
return &types.Message{
|
||||
To: paych,
|
||||
From: m.from,
|
||||
Value: abi.NewTokenAmount(0),
|
||||
Method: builtin13.MethodsPaych.Collect,
|
||||
}, nil
|
||||
}
|
@ -53,6 +53,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,6 +176,9 @@ func Message(version actorstypes.Version, from address.Address) MessageBuilder {
|
||||
case actorstypes.Version12:
|
||||
return message12{from}
|
||||
|
||||
case actorstypes.Version13:
|
||||
return message13{from}
|
||||
|
||||
default:
|
||||
panic(fmt.Sprintf("unsupported actors version: %d", version))
|
||||
}
|
||||
@ -215,5 +221,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
135
chain/actors/builtin/paych/v13.go
generated
Normal file
135
chain/actors/builtin/paych/v13.go
generated
Normal file
@ -0,0 +1,135 @@
|
||||
package paych
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
paych13 "github.com/filecoin-project/go-state-types/builtin/v13/paych"
|
||||
adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store) (State, error) {
|
||||
out := state13{store: store}
|
||||
out.State = paych13.State{}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
paych13.State
|
||||
store adt.Store
|
||||
lsAmt *adt13.Array
|
||||
}
|
||||
|
||||
// Channel owner, who has funded the actor
|
||||
func (s *state13) From() (address.Address, error) {
|
||||
return s.State.From, nil
|
||||
}
|
||||
|
||||
// Recipient of payouts from channel
|
||||
func (s *state13) To() (address.Address, error) {
|
||||
return s.State.To, nil
|
||||
}
|
||||
|
||||
// Height at which the channel can be `Collected`
|
||||
func (s *state13) SettlingAt() (abi.ChainEpoch, error) {
|
||||
return s.State.SettlingAt, nil
|
||||
}
|
||||
|
||||
// Amount successfully redeemed through the payment channel, paid out on `Collect()`
|
||||
func (s *state13) ToSend() (abi.TokenAmount, error) {
|
||||
return s.State.ToSend, nil
|
||||
}
|
||||
|
||||
func (s *state13) getOrLoadLsAmt() (*adt13.Array, error) {
|
||||
if s.lsAmt != nil {
|
||||
return s.lsAmt, nil
|
||||
}
|
||||
|
||||
// Get the lane state from the chain
|
||||
lsamt, err := adt13.AsArray(s.store, s.State.LaneStates, paych13.LaneStatesAmtBitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s.lsAmt = lsamt
|
||||
return lsamt, nil
|
||||
}
|
||||
|
||||
// Get total number of lanes
|
||||
func (s *state13) LaneCount() (uint64, error) {
|
||||
lsamt, err := s.getOrLoadLsAmt()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return lsamt.Length(), nil
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
// Iterate lane states
|
||||
func (s *state13) ForEachLaneState(cb func(idx uint64, dl LaneState) error) error {
|
||||
// Get the lane state from the chain
|
||||
lsamt, err := s.getOrLoadLsAmt()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Note: we use a map instead of an array to store laneStates because the
|
||||
// client sets the lane ID (the index) and potentially they could use a
|
||||
// very large index.
|
||||
var ls paych13.LaneState
|
||||
return lsamt.ForEach(&ls, func(i int64) error {
|
||||
return cb(uint64(i), &laneState13{ls})
|
||||
})
|
||||
}
|
||||
|
||||
type laneState13 struct {
|
||||
paych13.LaneState
|
||||
}
|
||||
|
||||
func (ls *laneState13) Redeemed() (big.Int, error) {
|
||||
return ls.LaneState.Redeemed, nil
|
||||
}
|
||||
|
||||
func (ls *laneState13) Nonce() (uint64, error) {
|
||||
return ls.LaneState.Nonce, nil
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.PaychKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -9,7 +9,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
builtin12 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
@ -27,8 +27,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin12.StoragePowerActorAddr
|
||||
Methods = builtin12.MethodsPower
|
||||
Address = builtin13.StoragePowerActorAddr
|
||||
Methods = builtin13.MethodsPower
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -54,6 +54,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,6 +127,9 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return make12(store)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return make13(store)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -190,5 +196,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
207
chain/actors/builtin/power/v13.go
generated
Normal file
207
chain/actors/builtin/power/v13.go
generated
Normal file
@ -0,0 +1,207 @@
|
||||
package power
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
power13 "github.com/filecoin-project/go-state-types/builtin/v13/power"
|
||||
adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store) (State, error) {
|
||||
out := state13{store: store}
|
||||
|
||||
s, err := power13.ConstructState(store)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
power13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) TotalLocked() (abi.TokenAmount, error) {
|
||||
return s.TotalPledgeCollateral, nil
|
||||
}
|
||||
|
||||
func (s *state13) TotalPower() (Claim, error) {
|
||||
return Claim{
|
||||
RawBytePower: s.TotalRawBytePower,
|
||||
QualityAdjPower: s.TotalQualityAdjPower,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Committed power to the network. Includes miners below the minimum threshold.
|
||||
func (s *state13) TotalCommitted() (Claim, error) {
|
||||
return Claim{
|
||||
RawBytePower: s.TotalBytesCommitted,
|
||||
QualityAdjPower: s.TotalQABytesCommitted,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state13) MinerPower(addr address.Address) (Claim, bool, error) {
|
||||
claims, err := s.claims()
|
||||
if err != nil {
|
||||
return Claim{}, false, err
|
||||
}
|
||||
var claim power13.Claim
|
||||
ok, err := claims.Get(abi.AddrKey(addr), &claim)
|
||||
if err != nil {
|
||||
return Claim{}, false, err
|
||||
}
|
||||
return Claim{
|
||||
RawBytePower: claim.RawBytePower,
|
||||
QualityAdjPower: claim.QualityAdjPower,
|
||||
}, ok, nil
|
||||
}
|
||||
|
||||
func (s *state13) MinerNominalPowerMeetsConsensusMinimum(a address.Address) (bool, error) {
|
||||
return s.State.MinerNominalPowerMeetsConsensusMinimum(s.store, a)
|
||||
}
|
||||
|
||||
func (s *state13) TotalPowerSmoothed() (builtin.FilterEstimate, error) {
|
||||
return builtin.FilterEstimate(s.State.ThisEpochQAPowerSmoothed), nil
|
||||
}
|
||||
|
||||
func (s *state13) MinerCounts() (uint64, uint64, error) {
|
||||
return uint64(s.State.MinerAboveMinPowerCount), uint64(s.State.MinerCount), nil
|
||||
}
|
||||
|
||||
func (s *state13) ListAllMiners() ([]address.Address, error) {
|
||||
claims, err := s.claims()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var miners []address.Address
|
||||
err = claims.ForEach(nil, func(k string) error {
|
||||
a, err := address.NewFromBytes([]byte(k))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
miners = append(miners, a)
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return miners, nil
|
||||
}
|
||||
|
||||
func (s *state13) ForEachClaim(cb func(miner address.Address, claim Claim) error) error {
|
||||
claims, err := s.claims()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var claim power13.Claim
|
||||
return claims.ForEach(&claim, func(k string) error {
|
||||
a, err := address.NewFromBytes([]byte(k))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return cb(a, Claim{
|
||||
RawBytePower: claim.RawBytePower,
|
||||
QualityAdjPower: claim.QualityAdjPower,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func (s *state13) ClaimsChanged(other State) (bool, error) {
|
||||
other13, ok := other.(*state13)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.Claims.Equals(other13.State.Claims), nil
|
||||
}
|
||||
|
||||
func (s *state13) SetTotalQualityAdjPower(p abi.StoragePower) error {
|
||||
s.State.TotalQualityAdjPower = p
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state13) SetTotalRawBytePower(p abi.StoragePower) error {
|
||||
s.State.TotalRawBytePower = p
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state13) SetThisEpochQualityAdjPower(p abi.StoragePower) error {
|
||||
s.State.ThisEpochQualityAdjPower = p
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state13) SetThisEpochRawBytePower(p abi.StoragePower) error {
|
||||
s.State.ThisEpochRawBytePower = p
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state13) claims() (adt.Map, error) {
|
||||
return adt13.AsMap(s.store, s.Claims, builtin13.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state13) decodeClaim(val *cbg.Deferred) (Claim, error) {
|
||||
var ci power13.Claim
|
||||
if err := ci.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Claim{}, err
|
||||
}
|
||||
return fromV13Claim(ci), nil
|
||||
}
|
||||
|
||||
func fromV13Claim(v13 power13.Claim) Claim {
|
||||
return Claim{
|
||||
RawBytePower: v13.RawBytePower,
|
||||
QualityAdjPower: v13.QualityAdjPower,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.PowerKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) 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
|
||||
}
|
@ -58,6 +58,22 @@ import (
|
||||
reward12 "github.com/filecoin-project/go-state-types/builtin/v12/reward"
|
||||
system12 "github.com/filecoin-project/go-state-types/builtin/v12/system"
|
||||
verifreg12 "github.com/filecoin-project/go-state-types/builtin/v12/verifreg"
|
||||
account13 "github.com/filecoin-project/go-state-types/builtin/v13/account"
|
||||
cron13 "github.com/filecoin-project/go-state-types/builtin/v13/cron"
|
||||
datacap13 "github.com/filecoin-project/go-state-types/builtin/v13/datacap"
|
||||
eam13 "github.com/filecoin-project/go-state-types/builtin/v13/eam"
|
||||
ethaccount13 "github.com/filecoin-project/go-state-types/builtin/v13/ethaccount"
|
||||
evm13 "github.com/filecoin-project/go-state-types/builtin/v13/evm"
|
||||
_init13 "github.com/filecoin-project/go-state-types/builtin/v13/init"
|
||||
market13 "github.com/filecoin-project/go-state-types/builtin/v13/market"
|
||||
miner13 "github.com/filecoin-project/go-state-types/builtin/v13/miner"
|
||||
multisig13 "github.com/filecoin-project/go-state-types/builtin/v13/multisig"
|
||||
paych13 "github.com/filecoin-project/go-state-types/builtin/v13/paych"
|
||||
placeholder13 "github.com/filecoin-project/go-state-types/builtin/v13/placeholder"
|
||||
power13 "github.com/filecoin-project/go-state-types/builtin/v13/power"
|
||||
reward13 "github.com/filecoin-project/go-state-types/builtin/v13/reward"
|
||||
system13 "github.com/filecoin-project/go-state-types/builtin/v13/system"
|
||||
verifreg13 "github.com/filecoin-project/go-state-types/builtin/v13/verifreg"
|
||||
account8 "github.com/filecoin-project/go-state-types/builtin/v8/account"
|
||||
cron8 "github.com/filecoin-project/go-state-types/builtin/v8/cron"
|
||||
_init8 "github.com/filecoin-project/go-state-types/builtin/v8/init"
|
||||
@ -617,6 +633,110 @@ func MakeRegistry(av actorstypes.Version) []RegistryEntry {
|
||||
}
|
||||
}
|
||||
|
||||
case actorstypes.Version13:
|
||||
for key, codeID := range codeIDs {
|
||||
switch key {
|
||||
case manifest.AccountKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: account13.Methods,
|
||||
state: new(account13.State),
|
||||
})
|
||||
case manifest.CronKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: cron13.Methods,
|
||||
state: new(cron13.State),
|
||||
})
|
||||
case manifest.InitKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: _init13.Methods,
|
||||
state: new(_init13.State),
|
||||
})
|
||||
case manifest.MarketKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: market13.Methods,
|
||||
state: new(market13.State),
|
||||
})
|
||||
case manifest.MinerKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: miner13.Methods,
|
||||
state: new(miner13.State),
|
||||
})
|
||||
case manifest.MultisigKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: multisig13.Methods,
|
||||
state: new(multisig13.State),
|
||||
})
|
||||
case manifest.PaychKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: paych13.Methods,
|
||||
state: new(paych13.State),
|
||||
})
|
||||
case manifest.PowerKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: power13.Methods,
|
||||
state: new(power13.State),
|
||||
})
|
||||
case manifest.RewardKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: reward13.Methods,
|
||||
state: new(reward13.State),
|
||||
})
|
||||
case manifest.SystemKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: system13.Methods,
|
||||
state: new(system13.State),
|
||||
})
|
||||
case manifest.VerifregKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: verifreg13.Methods,
|
||||
state: new(verifreg13.State),
|
||||
})
|
||||
case manifest.DatacapKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: datacap13.Methods,
|
||||
state: new(datacap13.State),
|
||||
})
|
||||
|
||||
case manifest.EvmKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: evm13.Methods,
|
||||
state: new(evm13.State),
|
||||
})
|
||||
case manifest.EamKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: eam13.Methods,
|
||||
state: nil,
|
||||
})
|
||||
case manifest.PlaceholderKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: placeholder13.Methods,
|
||||
state: nil,
|
||||
})
|
||||
case manifest.EthAccountKey:
|
||||
registry = append(registry, RegistryEntry{
|
||||
code: codeID,
|
||||
methods: ethaccount13.Methods,
|
||||
state: nil,
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
panic("expected version v8 and up only, use specs-actors for v0-7")
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin12 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
@ -25,8 +25,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin12.RewardActorAddr
|
||||
Methods = builtin12.MethodsReward
|
||||
Address = builtin13.RewardActorAddr
|
||||
Methods = builtin13.MethodsReward
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -52,6 +52,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,6 +125,9 @@ func MakeState(store adt.Store, av actorstypes.Version, currRealizedPower abi.St
|
||||
case actorstypes.Version12:
|
||||
return make12(store, currRealizedPower)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return make13(store, currRealizedPower)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -166,5 +172,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
120
chain/actors/builtin/reward/v13.go
generated
Normal file
120
chain/actors/builtin/reward/v13.go
generated
Normal file
@ -0,0 +1,120 @@
|
||||
package reward
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
miner13 "github.com/filecoin-project/go-state-types/builtin/v13/miner"
|
||||
reward13 "github.com/filecoin-project/go-state-types/builtin/v13/reward"
|
||||
smoothing13 "github.com/filecoin-project/go-state-types/builtin/v13/util/smoothing"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store, currRealizedPower abi.StoragePower) (State, error) {
|
||||
out := state13{store: store}
|
||||
out.State = *reward13.ConstructState(currRealizedPower)
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
reward13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) ThisEpochReward() (abi.TokenAmount, error) {
|
||||
return s.State.ThisEpochReward, nil
|
||||
}
|
||||
|
||||
func (s *state13) ThisEpochRewardSmoothed() (builtin.FilterEstimate, error) {
|
||||
|
||||
return builtin.FilterEstimate{
|
||||
PositionEstimate: s.State.ThisEpochRewardSmoothed.PositionEstimate,
|
||||
VelocityEstimate: s.State.ThisEpochRewardSmoothed.VelocityEstimate,
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) ThisEpochBaselinePower() (abi.StoragePower, error) {
|
||||
return s.State.ThisEpochBaselinePower, nil
|
||||
}
|
||||
|
||||
func (s *state13) TotalStoragePowerReward() (abi.TokenAmount, error) {
|
||||
return s.State.TotalStoragePowerReward, nil
|
||||
}
|
||||
|
||||
func (s *state13) EffectiveBaselinePower() (abi.StoragePower, error) {
|
||||
return s.State.EffectiveBaselinePower, nil
|
||||
}
|
||||
|
||||
func (s *state13) EffectiveNetworkTime() (abi.ChainEpoch, error) {
|
||||
return s.State.EffectiveNetworkTime, nil
|
||||
}
|
||||
|
||||
func (s *state13) CumsumBaseline() (reward13.Spacetime, error) {
|
||||
return s.State.CumsumBaseline, nil
|
||||
}
|
||||
|
||||
func (s *state13) CumsumRealized() (reward13.Spacetime, error) {
|
||||
return s.State.CumsumRealized, nil
|
||||
}
|
||||
|
||||
func (s *state13) InitialPledgeForPower(qaPower abi.StoragePower, networkTotalPledge abi.TokenAmount, networkQAPower *builtin.FilterEstimate, circSupply abi.TokenAmount) (abi.TokenAmount, error) {
|
||||
return miner13.InitialPledgeForPower(
|
||||
qaPower,
|
||||
s.State.ThisEpochBaselinePower,
|
||||
s.State.ThisEpochRewardSmoothed,
|
||||
smoothing13.FilterEstimate{
|
||||
PositionEstimate: networkQAPower.PositionEstimate,
|
||||
VelocityEstimate: networkQAPower.VelocityEstimate,
|
||||
},
|
||||
circSupply,
|
||||
), nil
|
||||
}
|
||||
|
||||
func (s *state13) PreCommitDepositForPower(networkQAPower builtin.FilterEstimate, sectorWeight abi.StoragePower) (abi.TokenAmount, error) {
|
||||
return miner13.PreCommitDepositForPower(s.State.ThisEpochRewardSmoothed,
|
||||
smoothing13.FilterEstimate{
|
||||
PositionEstimate: networkQAPower.PositionEstimate,
|
||||
VelocityEstimate: networkQAPower.VelocityEstimate,
|
||||
},
|
||||
sectorWeight), nil
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.RewardKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) Code() cid.Cid {
|
||||
code, ok := actors.GetActorCodeID(s.ActorVersion(), s.ActorKey())
|
||||
if !ok {
|
||||
panic(fmt.Errorf("didn't find actor %v code id for actor version %d", s.ActorKey(), s.ActorVersion()))
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
@ -5,7 +5,7 @@ import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin12 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
@ -21,7 +21,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin12.SystemActorAddr
|
||||
Address = builtin13.SystemActorAddr
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -47,6 +47,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,6 +120,9 @@ func MakeState(store adt.Store, av actorstypes.Version, builtinActors cid.Cid) (
|
||||
case actorstypes.Version12:
|
||||
return make12(store, builtinActors)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return make13(store, builtinActors)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -145,5 +151,6 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
72
chain/actors/builtin/system/v13.go
generated
Normal file
72
chain/actors/builtin/system/v13.go
generated
Normal file
@ -0,0 +1,72 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
system13 "github.com/filecoin-project/go-state-types/builtin/v13/system"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store, builtinActors cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
out.State = system13.State{
|
||||
BuiltinActors: builtinActors,
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
system13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state13) GetBuiltinActors() cid.Cid {
|
||||
|
||||
return s.State.BuiltinActors
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) SetBuiltinActors(c cid.Cid) error {
|
||||
|
||||
s.State.BuiltinActors = c
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.SystemKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) 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
|
||||
}
|
@ -81,8 +81,10 @@ type State interface {
|
||||
ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error
|
||||
GetAllocation(clientIdAddr address.Address, allocationId AllocationId) (*Allocation, bool, error)
|
||||
GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error)
|
||||
GetAllAllocations() (map[AllocationId]Allocation, error)
|
||||
GetClaim(providerIdAddr address.Address, claimId ClaimId) (*Claim, bool, error)
|
||||
GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error)
|
||||
GetAllClaims() (map[ClaimId]Claim, error)
|
||||
GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error)
|
||||
GetState() interface{}
|
||||
}
|
||||
|
@ -145,6 +145,21 @@ func (s *state{{.v}}) GetAllocations(clientIdAddr address.Address) (map[Allocati
|
||||
{{end}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
{{if (le .v 8)}}
|
||||
return nil, xerrors.Errorf("unsupported in actors v{{.v}}")
|
||||
{{else}}
|
||||
v{{.v}}Map, err := s.State.GetAllAllocations(s.store)
|
||||
|
||||
retMap := make(map[AllocationId]Allocation, len(v{{.v}}Map))
|
||||
for k, v := range v{{.v}}Map {
|
||||
retMap[AllocationId(k)] = Allocation(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
{{end}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
{{if (le .v 8)}}
|
||||
return nil, false, xerrors.Errorf("unsupported in actors v{{.v}}")
|
||||
@ -170,6 +185,22 @@ func (s *state{{.v}}) GetClaims(providerIdAddr address.Address) (map[ClaimId]Cla
|
||||
{{end}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
{{if (le .v 8)}}
|
||||
return nil, xerrors.Errorf("unsupported in actors v{{.v}}")
|
||||
{{else}}
|
||||
v{{.v}}Map, err := s.State.GetAllClaims(s.store)
|
||||
|
||||
retMap := make(map[ClaimId]Claim, len(v{{.v}}Map))
|
||||
for k, v := range v{{.v}}Map {
|
||||
retMap[ClaimId(k)] = Claim(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
{{end}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
{{if (le .v 8)}}
|
||||
return nil, xerrors.Errorf("unsupported in actors v{{.v}}")
|
||||
|
12
chain/actors/builtin/verifreg/v0.go
generated
12
chain/actors/builtin/verifreg/v0.go
generated
@ -106,6 +106,12 @@ func (s *state0) GetAllocations(clientIdAddr address.Address) (map[AllocationId]
|
||||
|
||||
}
|
||||
|
||||
func (s *state0) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v0")
|
||||
|
||||
}
|
||||
|
||||
func (s *state0) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
return nil, false, xerrors.Errorf("unsupported in actors v0")
|
||||
@ -118,6 +124,12 @@ func (s *state0) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e
|
||||
|
||||
}
|
||||
|
||||
func (s *state0) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v0")
|
||||
|
||||
}
|
||||
|
||||
func (s *state0) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v0")
|
||||
|
26
chain/actors/builtin/verifreg/v10.go
generated
26
chain/actors/builtin/verifreg/v10.go
generated
@ -114,6 +114,19 @@ func (s *state10) GetAllocations(clientIdAddr address.Address) (map[AllocationId
|
||||
|
||||
}
|
||||
|
||||
func (s *state10) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
v10Map, err := s.State.GetAllAllocations(s.store)
|
||||
|
||||
retMap := make(map[AllocationId]Allocation, len(v10Map))
|
||||
for k, v := range v10Map {
|
||||
retMap[AllocationId(k)] = Allocation(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state10) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
claim, ok, err := s.FindClaim(s.store, providerIdAddr, verifreg10.ClaimId(claimId))
|
||||
@ -134,6 +147,19 @@ func (s *state10) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim,
|
||||
|
||||
}
|
||||
|
||||
func (s *state10) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
v10Map, err := s.State.GetAllClaims(s.store)
|
||||
|
||||
retMap := make(map[ClaimId]Claim, len(v10Map))
|
||||
for k, v := range v10Map {
|
||||
retMap[ClaimId(k)] = Claim(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state10) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
v10Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
|
||||
|
26
chain/actors/builtin/verifreg/v11.go
generated
26
chain/actors/builtin/verifreg/v11.go
generated
@ -114,6 +114,19 @@ func (s *state11) GetAllocations(clientIdAddr address.Address) (map[AllocationId
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
v11Map, err := s.State.GetAllAllocations(s.store)
|
||||
|
||||
retMap := make(map[AllocationId]Allocation, len(v11Map))
|
||||
for k, v := range v11Map {
|
||||
retMap[AllocationId(k)] = Allocation(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
claim, ok, err := s.FindClaim(s.store, providerIdAddr, verifreg11.ClaimId(claimId))
|
||||
@ -134,6 +147,19 @@ func (s *state11) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim,
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
v11Map, err := s.State.GetAllClaims(s.store)
|
||||
|
||||
retMap := make(map[ClaimId]Claim, len(v11Map))
|
||||
for k, v := range v11Map {
|
||||
retMap[ClaimId(k)] = Claim(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state11) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
v11Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
|
||||
|
26
chain/actors/builtin/verifreg/v12.go
generated
26
chain/actors/builtin/verifreg/v12.go
generated
@ -114,6 +114,19 @@ func (s *state12) GetAllocations(clientIdAddr address.Address) (map[AllocationId
|
||||
|
||||
}
|
||||
|
||||
func (s *state12) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
v12Map, err := s.State.GetAllAllocations(s.store)
|
||||
|
||||
retMap := make(map[AllocationId]Allocation, len(v12Map))
|
||||
for k, v := range v12Map {
|
||||
retMap[AllocationId(k)] = Allocation(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state12) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
claim, ok, err := s.FindClaim(s.store, providerIdAddr, verifreg12.ClaimId(claimId))
|
||||
@ -134,6 +147,19 @@ func (s *state12) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim,
|
||||
|
||||
}
|
||||
|
||||
func (s *state12) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
v12Map, err := s.State.GetAllClaims(s.store)
|
||||
|
||||
retMap := make(map[ClaimId]Claim, len(v12Map))
|
||||
for k, v := range v12Map {
|
||||
retMap[ClaimId(k)] = Claim(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state12) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
v12Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
|
||||
|
196
chain/actors/builtin/verifreg/v13.go
generated
Normal file
196
chain/actors/builtin/verifreg/v13.go
generated
Normal file
@ -0,0 +1,196 @@
|
||||
package verifreg
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt"
|
||||
verifreg13 "github.com/filecoin-project/go-state-types/builtin/v13/verifreg"
|
||||
verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state13)(nil)
|
||||
|
||||
func load13(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state13{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make13(store adt.Store, rootKeyAddress address.Address) (State, error) {
|
||||
out := state13{store: store}
|
||||
|
||||
s, err := verifreg13.ConstructState(store, rootKeyAddress)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state13 struct {
|
||||
verifreg13.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state13) RootKey() (address.Address, error) {
|
||||
return s.State.RootKey, nil
|
||||
}
|
||||
|
||||
func (s *state13) VerifiedClientDataCap(addr address.Address) (bool, abi.StoragePower, error) {
|
||||
|
||||
return false, big.Zero(), xerrors.Errorf("unsupported in actors v13")
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) VerifierDataCap(addr address.Address) (bool, abi.StoragePower, error) {
|
||||
return getDataCap(s.store, actors.Version13, s.verifiers, addr)
|
||||
}
|
||||
|
||||
func (s *state13) RemoveDataCapProposalID(verifier address.Address, client address.Address) (bool, uint64, error) {
|
||||
return getRemoveDataCapProposalID(s.store, actors.Version13, s.removeDataCapProposalIDs, verifier, client)
|
||||
}
|
||||
|
||||
func (s *state13) ForEachVerifier(cb func(addr address.Address, dcap abi.StoragePower) error) error {
|
||||
return forEachCap(s.store, actors.Version13, s.verifiers, cb)
|
||||
}
|
||||
|
||||
func (s *state13) ForEachClient(cb func(addr address.Address, dcap abi.StoragePower) error) error {
|
||||
|
||||
return xerrors.Errorf("unsupported in actors v13")
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) verifiedClients() (adt.Map, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v13")
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) verifiers() (adt.Map, error) {
|
||||
return adt13.AsMap(s.store, s.Verifiers, builtin13.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state13) removeDataCapProposalIDs() (adt.Map, error) {
|
||||
return adt13.AsMap(s.store, s.RemoveDataCapProposalIDs, builtin13.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state13) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
func (s *state13) GetAllocation(clientIdAddr address.Address, allocationId verifreg9.AllocationId) (*Allocation, bool, error) {
|
||||
|
||||
alloc, ok, err := s.FindAllocation(s.store, clientIdAddr, verifreg13.AllocationId(allocationId))
|
||||
return (*Allocation)(alloc), ok, err
|
||||
}
|
||||
|
||||
func (s *state13) GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error) {
|
||||
|
||||
v13Map, err := s.LoadAllocationsToMap(s.store, clientIdAddr)
|
||||
|
||||
retMap := make(map[AllocationId]Allocation, len(v13Map))
|
||||
for k, v := range v13Map {
|
||||
retMap[AllocationId(k)] = Allocation(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
v13Map, err := s.State.GetAllAllocations(s.store)
|
||||
|
||||
retMap := make(map[AllocationId]Allocation, len(v13Map))
|
||||
for k, v := range v13Map {
|
||||
retMap[AllocationId(k)] = Allocation(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
claim, ok, err := s.FindClaim(s.store, providerIdAddr, verifreg13.ClaimId(claimId))
|
||||
return (*Claim)(claim), ok, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error) {
|
||||
|
||||
v13Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
|
||||
|
||||
retMap := make(map[ClaimId]Claim, len(v13Map))
|
||||
for k, v := range v13Map {
|
||||
retMap[ClaimId(k)] = Claim(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
v13Map, err := s.State.GetAllClaims(s.store)
|
||||
|
||||
retMap := make(map[ClaimId]Claim, len(v13Map))
|
||||
for k, v := range v13Map {
|
||||
retMap[ClaimId(k)] = Claim(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
v13Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
|
||||
|
||||
retMap := make(map[abi.SectorNumber][]ClaimId)
|
||||
for k, v := range v13Map {
|
||||
claims, ok := retMap[v.Sector]
|
||||
if !ok {
|
||||
retMap[v.Sector] = []ClaimId{ClaimId(k)}
|
||||
} else {
|
||||
retMap[v.Sector] = append(claims, ClaimId(k))
|
||||
}
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state13) ActorKey() string {
|
||||
return manifest.VerifregKey
|
||||
}
|
||||
|
||||
func (s *state13) ActorVersion() actorstypes.Version {
|
||||
return actorstypes.Version13
|
||||
}
|
||||
|
||||
func (s *state13) 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
|
||||
}
|
12
chain/actors/builtin/verifreg/v2.go
generated
12
chain/actors/builtin/verifreg/v2.go
generated
@ -106,6 +106,12 @@ func (s *state2) GetAllocations(clientIdAddr address.Address) (map[AllocationId]
|
||||
|
||||
}
|
||||
|
||||
func (s *state2) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v2")
|
||||
|
||||
}
|
||||
|
||||
func (s *state2) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
return nil, false, xerrors.Errorf("unsupported in actors v2")
|
||||
@ -118,6 +124,12 @@ func (s *state2) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e
|
||||
|
||||
}
|
||||
|
||||
func (s *state2) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v2")
|
||||
|
||||
}
|
||||
|
||||
func (s *state2) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v2")
|
||||
|
12
chain/actors/builtin/verifreg/v3.go
generated
12
chain/actors/builtin/verifreg/v3.go
generated
@ -107,6 +107,12 @@ func (s *state3) GetAllocations(clientIdAddr address.Address) (map[AllocationId]
|
||||
|
||||
}
|
||||
|
||||
func (s *state3) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v3")
|
||||
|
||||
}
|
||||
|
||||
func (s *state3) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
return nil, false, xerrors.Errorf("unsupported in actors v3")
|
||||
@ -119,6 +125,12 @@ func (s *state3) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e
|
||||
|
||||
}
|
||||
|
||||
func (s *state3) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v3")
|
||||
|
||||
}
|
||||
|
||||
func (s *state3) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v3")
|
||||
|
12
chain/actors/builtin/verifreg/v4.go
generated
12
chain/actors/builtin/verifreg/v4.go
generated
@ -107,6 +107,12 @@ func (s *state4) GetAllocations(clientIdAddr address.Address) (map[AllocationId]
|
||||
|
||||
}
|
||||
|
||||
func (s *state4) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v4")
|
||||
|
||||
}
|
||||
|
||||
func (s *state4) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
return nil, false, xerrors.Errorf("unsupported in actors v4")
|
||||
@ -119,6 +125,12 @@ func (s *state4) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e
|
||||
|
||||
}
|
||||
|
||||
func (s *state4) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v4")
|
||||
|
||||
}
|
||||
|
||||
func (s *state4) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v4")
|
||||
|
12
chain/actors/builtin/verifreg/v5.go
generated
12
chain/actors/builtin/verifreg/v5.go
generated
@ -107,6 +107,12 @@ func (s *state5) GetAllocations(clientIdAddr address.Address) (map[AllocationId]
|
||||
|
||||
}
|
||||
|
||||
func (s *state5) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v5")
|
||||
|
||||
}
|
||||
|
||||
func (s *state5) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
return nil, false, xerrors.Errorf("unsupported in actors v5")
|
||||
@ -119,6 +125,12 @@ func (s *state5) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e
|
||||
|
||||
}
|
||||
|
||||
func (s *state5) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v5")
|
||||
|
||||
}
|
||||
|
||||
func (s *state5) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v5")
|
||||
|
12
chain/actors/builtin/verifreg/v6.go
generated
12
chain/actors/builtin/verifreg/v6.go
generated
@ -107,6 +107,12 @@ func (s *state6) GetAllocations(clientIdAddr address.Address) (map[AllocationId]
|
||||
|
||||
}
|
||||
|
||||
func (s *state6) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v6")
|
||||
|
||||
}
|
||||
|
||||
func (s *state6) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
return nil, false, xerrors.Errorf("unsupported in actors v6")
|
||||
@ -119,6 +125,12 @@ func (s *state6) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e
|
||||
|
||||
}
|
||||
|
||||
func (s *state6) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v6")
|
||||
|
||||
}
|
||||
|
||||
func (s *state6) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v6")
|
||||
|
12
chain/actors/builtin/verifreg/v7.go
generated
12
chain/actors/builtin/verifreg/v7.go
generated
@ -106,6 +106,12 @@ func (s *state7) GetAllocations(clientIdAddr address.Address) (map[AllocationId]
|
||||
|
||||
}
|
||||
|
||||
func (s *state7) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v7")
|
||||
|
||||
}
|
||||
|
||||
func (s *state7) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
return nil, false, xerrors.Errorf("unsupported in actors v7")
|
||||
@ -118,6 +124,12 @@ func (s *state7) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e
|
||||
|
||||
}
|
||||
|
||||
func (s *state7) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v7")
|
||||
|
||||
}
|
||||
|
||||
func (s *state7) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v7")
|
||||
|
12
chain/actors/builtin/verifreg/v8.go
generated
12
chain/actors/builtin/verifreg/v8.go
generated
@ -106,6 +106,12 @@ func (s *state8) GetAllocations(clientIdAddr address.Address) (map[AllocationId]
|
||||
|
||||
}
|
||||
|
||||
func (s *state8) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v8")
|
||||
|
||||
}
|
||||
|
||||
func (s *state8) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
return nil, false, xerrors.Errorf("unsupported in actors v8")
|
||||
@ -118,6 +124,12 @@ func (s *state8) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e
|
||||
|
||||
}
|
||||
|
||||
func (s *state8) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v8")
|
||||
|
||||
}
|
||||
|
||||
func (s *state8) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
return nil, xerrors.Errorf("unsupported in actors v8")
|
||||
|
26
chain/actors/builtin/verifreg/v9.go
generated
26
chain/actors/builtin/verifreg/v9.go
generated
@ -113,6 +113,19 @@ func (s *state9) GetAllocations(clientIdAddr address.Address) (map[AllocationId]
|
||||
|
||||
}
|
||||
|
||||
func (s *state9) GetAllAllocations() (map[AllocationId]Allocation, error) {
|
||||
|
||||
v9Map, err := s.State.GetAllAllocations(s.store)
|
||||
|
||||
retMap := make(map[AllocationId]Allocation, len(v9Map))
|
||||
for k, v := range v9Map {
|
||||
retMap[AllocationId(k)] = Allocation(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state9) GetClaim(providerIdAddr address.Address, claimId verifreg9.ClaimId) (*Claim, bool, error) {
|
||||
|
||||
claim, ok, err := s.FindClaim(s.store, providerIdAddr, verifreg9.ClaimId(claimId))
|
||||
@ -133,6 +146,19 @@ func (s *state9) GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, e
|
||||
|
||||
}
|
||||
|
||||
func (s *state9) GetAllClaims() (map[ClaimId]Claim, error) {
|
||||
|
||||
v9Map, err := s.State.GetAllClaims(s.store)
|
||||
|
||||
retMap := make(map[ClaimId]Claim, len(v9Map))
|
||||
for k, v := range v9Map {
|
||||
retMap[ClaimId(k)] = Claim(v)
|
||||
}
|
||||
|
||||
return retMap, err
|
||||
|
||||
}
|
||||
|
||||
func (s *state9) GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error) {
|
||||
|
||||
v9Map, err := s.LoadClaimsToMap(s.store, providerIdAddr)
|
||||
|
15
chain/actors/builtin/verifreg/verifreg.go
generated
15
chain/actors/builtin/verifreg/verifreg.go
generated
@ -7,7 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
actorstypes "github.com/filecoin-project/go-state-types/actors"
|
||||
builtin12 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/manifest"
|
||||
@ -25,8 +25,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Address = builtin12.VerifiedRegistryActorAddr
|
||||
Methods = builtin12.MethodsVerifiedRegistry
|
||||
Address = builtin13.VerifiedRegistryActorAddr
|
||||
Methods = builtin13.MethodsVerifiedRegistry
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
@ -52,6 +52,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
case actorstypes.Version12:
|
||||
return load12(store, act.Head)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return load13(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,6 +125,9 @@ func MakeState(store adt.Store, av actorstypes.Version, rootKeyAddress address.A
|
||||
case actorstypes.Version12:
|
||||
return make12(store, rootKeyAddress)
|
||||
|
||||
case actorstypes.Version13:
|
||||
return make13(store, rootKeyAddress)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
@ -141,8 +147,10 @@ type State interface {
|
||||
ForEachClient(func(addr address.Address, dcap abi.StoragePower) error) error
|
||||
GetAllocation(clientIdAddr address.Address, allocationId AllocationId) (*Allocation, bool, error)
|
||||
GetAllocations(clientIdAddr address.Address) (map[AllocationId]Allocation, error)
|
||||
GetAllAllocations() (map[AllocationId]Allocation, error)
|
||||
GetClaim(providerIdAddr address.Address, claimId ClaimId) (*Claim, bool, error)
|
||||
GetClaims(providerIdAddr address.Address) (map[ClaimId]Claim, error)
|
||||
GetAllClaims() (map[ClaimId]Claim, error)
|
||||
GetClaimIdsBySector(providerIdAddr address.Address) (map[abi.SectorNumber][]ClaimId, error)
|
||||
GetState() interface{}
|
||||
}
|
||||
@ -161,6 +169,7 @@ func AllCodes() []cid.Cid {
|
||||
(&state10{}).Code(),
|
||||
(&state11{}).Code(),
|
||||
(&state12{}).Code(),
|
||||
(&state13{}).Code(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
builtin10 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin11 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin12 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin13 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
builtin9 "github.com/filecoin-project/go-state-types/builtin"
|
||||
market10 "github.com/filecoin-project/go-state-types/builtin/v10/market"
|
||||
@ -19,8 +20,11 @@ import (
|
||||
verifreg11 "github.com/filecoin-project/go-state-types/builtin/v11/verifreg"
|
||||
market12 "github.com/filecoin-project/go-state-types/builtin/v12/market"
|
||||
miner12 "github.com/filecoin-project/go-state-types/builtin/v12/miner"
|
||||
paych12 "github.com/filecoin-project/go-state-types/builtin/v12/paych"
|
||||
verifreg12 "github.com/filecoin-project/go-state-types/builtin/v12/verifreg"
|
||||
market13 "github.com/filecoin-project/go-state-types/builtin/v13/market"
|
||||
miner13 "github.com/filecoin-project/go-state-types/builtin/v13/miner"
|
||||
paych13 "github.com/filecoin-project/go-state-types/builtin/v13/paych"
|
||||
verifreg13 "github.com/filecoin-project/go-state-types/builtin/v13/verifreg"
|
||||
market8 "github.com/filecoin-project/go-state-types/builtin/v8/market"
|
||||
miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
verifreg8 "github.com/filecoin-project/go-state-types/builtin/v8/verifreg"
|
||||
@ -59,14 +63,14 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ChainFinality = miner12.ChainFinality
|
||||
ChainFinality = miner13.ChainFinality
|
||||
SealRandomnessLookback = ChainFinality
|
||||
PaychSettleDelay = paych12.SettleDelay
|
||||
MaxPreCommitRandomnessLookback = builtin12.EpochsInDay + SealRandomnessLookback
|
||||
PaychSettleDelay = paych13.SettleDelay
|
||||
MaxPreCommitRandomnessLookback = builtin13.EpochsInDay + SealRandomnessLookback
|
||||
)
|
||||
|
||||
var (
|
||||
MarketDefaultAllocationTermBuffer = market12.MarketDefaultAllocationTermBuffer
|
||||
MarketDefaultAllocationTermBuffer = market13.MarketDefaultAllocationTermBuffer
|
||||
)
|
||||
|
||||
// SetSupportedProofTypes sets supported proof types, across all actor versions.
|
||||
@ -181,11 +185,13 @@ func SetPreCommitChallengeDelay(delay abi.ChainEpoch) {
|
||||
|
||||
miner12.PreCommitChallengeDelay = delay
|
||||
|
||||
miner13.PreCommitChallengeDelay = delay
|
||||
|
||||
}
|
||||
|
||||
// TODO: this function shouldn't really exist. Instead, the API should expose the precommit delay.
|
||||
func GetPreCommitChallengeDelay() abi.ChainEpoch {
|
||||
return miner12.PreCommitChallengeDelay
|
||||
return miner13.PreCommitChallengeDelay
|
||||
}
|
||||
|
||||
// SetConsensusMinerMinPower sets the minimum power of an individual miner must
|
||||
@ -239,6 +245,10 @@ func SetConsensusMinerMinPower(p abi.StoragePower) {
|
||||
policy.ConsensusMinerMinPower = p
|
||||
}
|
||||
|
||||
for _, policy := range builtin13.PoStProofPolicies {
|
||||
policy.ConsensusMinerMinPower = p
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// SetMinVerifiedDealSize sets the minimum size of a verified deal. This should
|
||||
@ -269,6 +279,8 @@ func SetMinVerifiedDealSize(size abi.StoragePower) {
|
||||
|
||||
verifreg12.MinVerifiedDealSize = size
|
||||
|
||||
verifreg13.MinVerifiedDealSize = size
|
||||
|
||||
}
|
||||
|
||||
func GetMaxProveCommitDuration(ver actorstypes.Version, t abi.RegisteredSealProof) (abi.ChainEpoch, error) {
|
||||
@ -322,6 +334,10 @@ func GetMaxProveCommitDuration(ver actorstypes.Version, t abi.RegisteredSealProo
|
||||
|
||||
return miner12.MaxProveCommitDuration[t], nil
|
||||
|
||||
case actorstypes.Version13:
|
||||
|
||||
return miner13.MaxProveCommitDuration[t], nil
|
||||
|
||||
default:
|
||||
return 0, xerrors.Errorf("unsupported actors version")
|
||||
}
|
||||
@ -387,6 +403,11 @@ func SetProviderCollateralSupplyTarget(num, denom big.Int) {
|
||||
Denominator: denom,
|
||||
}
|
||||
|
||||
market13.ProviderCollateralSupplyTarget = builtin13.BigFrac{
|
||||
Numerator: num,
|
||||
Denominator: denom,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func DealProviderCollateralBounds(
|
||||
@ -460,13 +481,18 @@ func DealProviderCollateralBounds(
|
||||
min, max := market12.DealProviderCollateralBounds(size, verified, rawBytePower, qaPower, baselinePower, circulatingFil)
|
||||
return min, max, nil
|
||||
|
||||
case actorstypes.Version13:
|
||||
|
||||
min, max := market13.DealProviderCollateralBounds(size, verified, rawBytePower, qaPower, baselinePower, circulatingFil)
|
||||
return min, max, nil
|
||||
|
||||
default:
|
||||
return big.Zero(), big.Zero(), xerrors.Errorf("unsupported actors version")
|
||||
}
|
||||
}
|
||||
|
||||
func DealDurationBounds(pieceSize abi.PaddedPieceSize) (min, max abi.ChainEpoch) {
|
||||
return market12.DealDurationBounds(pieceSize)
|
||||
return market13.DealDurationBounds(pieceSize)
|
||||
}
|
||||
|
||||
// Sets the challenge window and scales the proving period to match (such that
|
||||
@ -549,6 +575,13 @@ func SetWPoStChallengeWindow(period abi.ChainEpoch) {
|
||||
// scale it if we're scaling the challenge period.
|
||||
miner12.WPoStDisputeWindow = period * 30
|
||||
|
||||
miner13.WPoStChallengeWindow = period
|
||||
miner13.WPoStProvingPeriod = period * abi.ChainEpoch(miner13.WPoStPeriodDeadlines)
|
||||
|
||||
// by default, this is 2x finality which is 30 periods.
|
||||
// scale it if we're scaling the challenge period.
|
||||
miner13.WPoStDisputeWindow = period * 30
|
||||
|
||||
}
|
||||
|
||||
func GetWinningPoStSectorSetLookback(nwVer network.Version) abi.ChainEpoch {
|
||||
@ -603,6 +636,9 @@ func GetMaxSectorExpirationExtension(nv network.Version) (abi.ChainEpoch, error)
|
||||
case actorstypes.Version12:
|
||||
return miner12.MaxSectorExpirationExtension, nil
|
||||
|
||||
case actorstypes.Version13:
|
||||
return miner13.MaxSectorExpirationExtension, nil
|
||||
|
||||
default:
|
||||
return 0, xerrors.Errorf("unsupported network version")
|
||||
}
|
||||
@ -610,11 +646,11 @@ func GetMaxSectorExpirationExtension(nv network.Version) (abi.ChainEpoch, error)
|
||||
}
|
||||
|
||||
func GetMinSectorExpiration() abi.ChainEpoch {
|
||||
return miner12.MinSectorExpiration
|
||||
return miner13.MinSectorExpiration
|
||||
}
|
||||
|
||||
func GetMaxPoStPartitions(nv network.Version, p abi.RegisteredPoStProof) (int, error) {
|
||||
sectorsPerPart, err := builtin12.PoStProofWindowPoStPartitionSectors(p)
|
||||
sectorsPerPart, err := builtin13.PoStProofWindowPoStPartitionSectors(p)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@ -623,7 +659,7 @@ func GetMaxPoStPartitions(nv network.Version, p abi.RegisteredPoStProof) (int, e
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return min(miner12.PoStedPartitionsMax, int(uint64(maxSectors)/sectorsPerPart)), nil
|
||||
return min(miner13.PoStedPartitionsMax, int(uint64(maxSectors)/sectorsPerPart)), nil
|
||||
}
|
||||
|
||||
func GetDefaultAggregationProof() abi.RegisteredAggregationProof {
|
||||
@ -635,7 +671,7 @@ func GetSectorMaxLifetime(proof abi.RegisteredSealProof, nwVer network.Version)
|
||||
return builtin4.SealProofPoliciesV0[proof].SectorMaxLifetime
|
||||
}
|
||||
|
||||
return builtin12.SealProofPoliciesV11[proof].SectorMaxLifetime
|
||||
return builtin13.SealProofPoliciesV11[proof].SectorMaxLifetime
|
||||
}
|
||||
|
||||
func GetAddressedSectorsMax(nwVer network.Version) (int, error) {
|
||||
@ -681,6 +717,9 @@ func GetAddressedSectorsMax(nwVer network.Version) (int, error) {
|
||||
case actorstypes.Version12:
|
||||
return miner12.AddressedSectorsMax, nil
|
||||
|
||||
case actorstypes.Version13:
|
||||
return miner13.AddressedSectorsMax, nil
|
||||
|
||||
default:
|
||||
return 0, xerrors.Errorf("unsupported network version")
|
||||
}
|
||||
@ -742,6 +781,10 @@ func GetDeclarationsMax(nwVer network.Version) (int, error) {
|
||||
|
||||
return miner12.DeclarationsMax, nil
|
||||
|
||||
case actorstypes.Version13:
|
||||
|
||||
return miner13.DeclarationsMax, nil
|
||||
|
||||
default:
|
||||
return 0, xerrors.Errorf("unsupported network version")
|
||||
}
|
||||
@ -802,6 +845,10 @@ func AggregateProveCommitNetworkFee(nwVer network.Version, aggregateSize int, ba
|
||||
|
||||
return miner12.AggregateProveCommitNetworkFee(aggregateSize, baseFee), nil
|
||||
|
||||
case actorstypes.Version13:
|
||||
|
||||
return miner13.AggregateProveCommitNetworkFee(aggregateSize, baseFee), nil
|
||||
|
||||
default:
|
||||
return big.Zero(), xerrors.Errorf("unsupported network version")
|
||||
}
|
||||
@ -862,6 +909,10 @@ func AggregatePreCommitNetworkFee(nwVer network.Version, aggregateSize int, base
|
||||
|
||||
return miner12.AggregatePreCommitNetworkFee(aggregateSize, baseFee), nil
|
||||
|
||||
case actorstypes.Version13:
|
||||
|
||||
return miner13.AggregatePreCommitNetworkFee(aggregateSize, baseFee), nil
|
||||
|
||||
default:
|
||||
return big.Zero(), xerrors.Errorf("unsupported network version")
|
||||
}
|
||||
|
@ -14,9 +14,9 @@ const ({{range .actorVersions}}
|
||||
|
||||
/* inline-gen start */
|
||||
|
||||
var LatestVersion = 12
|
||||
var LatestVersion = 13
|
||||
|
||||
var Versions = []int{0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}
|
||||
var Versions = []int{0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
|
||||
|
||||
const (
|
||||
Version0 Version = 0
|
||||
@ -31,6 +31,7 @@ const (
|
||||
Version10 Version = 10
|
||||
Version11 Version = 11
|
||||
Version12 Version = 12
|
||||
Version13 Version = 13
|
||||
)
|
||||
|
||||
/* inline-gen end */
|
||||
|
@ -43,31 +43,31 @@ type BeaconPoint struct {
|
||||
// been posted on chain.
|
||||
type RandomBeacon interface {
|
||||
Entry(context.Context, uint64) <-chan Response
|
||||
VerifyEntry(types.BeaconEntry, types.BeaconEntry) error
|
||||
VerifyEntry(entry types.BeaconEntry, prevEntrySig []byte) error
|
||||
MaxBeaconRoundForEpoch(network.Version, abi.ChainEpoch) uint64
|
||||
IsChained() bool
|
||||
}
|
||||
|
||||
func ValidateBlockValues(bSchedule Schedule, nv network.Version, h *types.BlockHeader, parentEpoch abi.ChainEpoch,
|
||||
prevEntry types.BeaconEntry) error {
|
||||
{
|
||||
|
||||
parentBeacon := bSchedule.BeaconForEpoch(parentEpoch)
|
||||
currBeacon := bSchedule.BeaconForEpoch(h.Height)
|
||||
if parentBeacon != currBeacon {
|
||||
// When we have "chained" beacons, two entries at a fork are required.
|
||||
if parentBeacon != currBeacon && currBeacon.IsChained() {
|
||||
if len(h.BeaconEntries) != 2 {
|
||||
return xerrors.Errorf("expected two beacon entries at beacon fork, got %d", len(h.BeaconEntries))
|
||||
}
|
||||
err := currBeacon.VerifyEntry(h.BeaconEntries[1], h.BeaconEntries[0])
|
||||
err := currBeacon.VerifyEntry(h.BeaconEntries[1], h.BeaconEntries[0].Data)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("beacon at fork point invalid: (%v, %v): %w",
|
||||
h.BeaconEntries[1], h.BeaconEntries[0], err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: fork logic
|
||||
b := bSchedule.BeaconForEpoch(h.Height)
|
||||
maxRound := b.MaxBeaconRoundForEpoch(nv, h.Height)
|
||||
maxRound := currBeacon.MaxBeaconRoundForEpoch(nv, h.Height)
|
||||
// We don't expect to ever actually meet this condition
|
||||
if maxRound == prevEntry.Round {
|
||||
if len(h.BeaconEntries) != 0 {
|
||||
return xerrors.Errorf("expected not to have any beacon entries in this block, got %d", len(h.BeaconEntries))
|
||||
@ -79,23 +79,31 @@ func ValidateBlockValues(bSchedule Schedule, nv network.Version, h *types.BlockH
|
||||
return xerrors.Errorf("expected to have beacon entries in this block, but didn't find any")
|
||||
}
|
||||
|
||||
// Verify that the last beacon entry's round corresponds to the round we expect
|
||||
// We skip verifying the genesis entry when randomness is "chained".
|
||||
if currBeacon.IsChained() && prevEntry.Round == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
last := h.BeaconEntries[len(h.BeaconEntries)-1]
|
||||
if last.Round != maxRound {
|
||||
return xerrors.Errorf("expected final beacon entry in block to be at round %d, got %d", maxRound, last.Round)
|
||||
}
|
||||
|
||||
// If the beacon is UNchained, verify that the block only includes the rounds we want for the epochs in between parentEpoch and h.Height
|
||||
// For chained beacons, you must have all the rounds forming a valid chain with prevEntry, so we can skip this step
|
||||
if !currBeacon.IsChained() {
|
||||
// Verify that all other entries' rounds are as expected for the epochs in between parentEpoch and h.Height
|
||||
for i, e := range h.BeaconEntries {
|
||||
correctRound := b.MaxBeaconRoundForEpoch(nv, parentEpoch+abi.ChainEpoch(i)+1)
|
||||
correctRound := currBeacon.MaxBeaconRoundForEpoch(nv, parentEpoch+abi.ChainEpoch(i)+1)
|
||||
if e.Round != correctRound {
|
||||
return xerrors.Errorf("unexpected beacon round %d, expected %d for epoch %d", e.Round, correctRound, parentEpoch+abi.ChainEpoch(i))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Verify the beacon entries themselves
|
||||
for i, e := range h.BeaconEntries {
|
||||
if err := b.VerifyEntry(e, prevEntry); err != nil {
|
||||
if err := currBeacon.VerifyEntry(e, prevEntry.Data); err != nil {
|
||||
return xerrors.Errorf("beacon entry %d (%d - %x (%d)) was invalid: %w", i, e.Round, e.Data, len(e.Data), err)
|
||||
}
|
||||
prevEntry = e
|
||||
@ -105,10 +113,10 @@ func ValidateBlockValues(bSchedule Schedule, nv network.Version, h *types.BlockH
|
||||
}
|
||||
|
||||
func BeaconEntriesForBlock(ctx context.Context, bSchedule Schedule, nv network.Version, epoch abi.ChainEpoch, parentEpoch abi.ChainEpoch, prev types.BeaconEntry) ([]types.BeaconEntry, error) {
|
||||
{
|
||||
// When we have "chained" beacons, two entries at a fork are required.
|
||||
parentBeacon := bSchedule.BeaconForEpoch(parentEpoch)
|
||||
currBeacon := bSchedule.BeaconForEpoch(epoch)
|
||||
if parentBeacon != currBeacon {
|
||||
if parentBeacon != currBeacon && currBeacon.IsChained() {
|
||||
// Fork logic
|
||||
round := currBeacon.MaxBeaconRoundForEpoch(nv, epoch)
|
||||
out := make([]types.BeaconEntry, 2)
|
||||
@ -126,13 +134,11 @@ func BeaconEntriesForBlock(ctx context.Context, bSchedule Schedule, nv network.V
|
||||
out[1] = res.Entry
|
||||
return out, nil
|
||||
}
|
||||
}
|
||||
|
||||
beacon := bSchedule.BeaconForEpoch(epoch)
|
||||
|
||||
start := build.Clock.Now()
|
||||
|
||||
maxRound := beacon.MaxBeaconRoundForEpoch(nv, epoch)
|
||||
maxRound := currBeacon.MaxBeaconRoundForEpoch(nv, epoch)
|
||||
// We don't expect this to ever be the case
|
||||
if maxRound == prev.Round {
|
||||
return nil, nil
|
||||
}
|
||||
@ -144,8 +150,8 @@ func BeaconEntriesForBlock(ctx context.Context, bSchedule Schedule, nv network.V
|
||||
|
||||
var out []types.BeaconEntry
|
||||
for currEpoch := epoch; currEpoch > parentEpoch; currEpoch-- {
|
||||
currRound := beacon.MaxBeaconRoundForEpoch(nv, currEpoch)
|
||||
rch := beacon.Entry(ctx, currRound)
|
||||
currRound := currBeacon.MaxBeaconRoundForEpoch(nv, currEpoch)
|
||||
rch := currBeacon.Entry(ctx, currRound)
|
||||
select {
|
||||
case resp := <-rch:
|
||||
if resp.Err != nil {
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
dchain "github.com/drand/drand/chain"
|
||||
dclient "github.com/drand/drand/client"
|
||||
hclient "github.com/drand/drand/client/http"
|
||||
"github.com/drand/drand/common/scheme"
|
||||
dcrypto "github.com/drand/drand/crypto"
|
||||
dlog "github.com/drand/drand/log"
|
||||
gclient "github.com/drand/drand/lp2p/client"
|
||||
"github.com/drand/kyber"
|
||||
@ -37,6 +37,7 @@ var log = logging.Logger("drand")
|
||||
//
|
||||
// The root trust for the Drand chain is configured from build.DrandChain.
|
||||
type DrandBeacon struct {
|
||||
isChained bool
|
||||
client dclient.Client
|
||||
|
||||
pubkey kyber.Point
|
||||
@ -47,10 +48,18 @@ type DrandBeacon struct {
|
||||
drandGenTime uint64
|
||||
filGenTime uint64
|
||||
filRoundTime uint64
|
||||
scheme *dcrypto.Scheme
|
||||
|
||||
localCache *lru.Cache[uint64, *types.BeaconEntry]
|
||||
}
|
||||
|
||||
// IsChained tells us whether this particular beacon operates in "chained mode". Prior to Drand
|
||||
// quicknet, beacons form a chain. After the introduction of quicknet, they do not, so we need to
|
||||
// change how we interact with beacon entries. (See FIP-0063)
|
||||
func (db *DrandBeacon) IsChained() bool {
|
||||
return db.isChained
|
||||
}
|
||||
|
||||
// DrandHTTPClient interface overrides the user agent used by drand
|
||||
type DrandHTTPClient interface {
|
||||
SetUserAgent(string)
|
||||
@ -68,6 +77,10 @@ func (l *logger) Named(s string) dlog.Logger {
|
||||
return &logger{l.SugaredLogger.Named(s)}
|
||||
}
|
||||
|
||||
func (l *logger) AddCallerSkip(skip int) dlog.Logger {
|
||||
return &logger{l.SugaredLogger.With(zap.AddCallerSkip(skip))}
|
||||
}
|
||||
|
||||
func NewDrandBeacon(genesisTs, interval uint64, ps *pubsub.PubSub, config dtypes.DrandConfig) (*DrandBeacon, error) {
|
||||
if genesisTs == 0 {
|
||||
panic("what are you doing this cant be zero")
|
||||
@ -112,10 +125,16 @@ func NewDrandBeacon(genesisTs, interval uint64, ps *pubsub.PubSub, config dtypes
|
||||
}
|
||||
|
||||
db := &DrandBeacon{
|
||||
isChained: config.IsChained,
|
||||
client: client,
|
||||
localCache: lc,
|
||||
}
|
||||
|
||||
sch, err := dcrypto.GetSchemeByIDWithDefault(drandChain.Scheme)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
db.scheme = sch
|
||||
db.pubkey = drandChain.PublicKey
|
||||
db.interval = drandChain.Period
|
||||
db.drandGenTime = uint64(drandChain.GenesisTime)
|
||||
@ -164,29 +183,26 @@ func (db *DrandBeacon) getCachedValue(round uint64) *types.BeaconEntry {
|
||||
return v
|
||||
}
|
||||
|
||||
func (db *DrandBeacon) VerifyEntry(curr types.BeaconEntry, prev types.BeaconEntry) error {
|
||||
if prev.Round == 0 {
|
||||
// TODO handle genesis better
|
||||
return nil
|
||||
}
|
||||
|
||||
if be := db.getCachedValue(curr.Round); be != nil {
|
||||
if !bytes.Equal(curr.Data, be.Data) {
|
||||
func (db *DrandBeacon) VerifyEntry(entry types.BeaconEntry, prevEntrySig []byte) error {
|
||||
if be := db.getCachedValue(entry.Round); be != nil {
|
||||
if !bytes.Equal(entry.Data, be.Data) {
|
||||
return xerrors.New("invalid beacon value, does not match cached good value")
|
||||
}
|
||||
// return no error if the value is in the cache already
|
||||
return nil
|
||||
}
|
||||
b := &dchain.Beacon{
|
||||
PreviousSig: prev.Data,
|
||||
Round: curr.Round,
|
||||
Signature: curr.Data,
|
||||
}
|
||||
err := dchain.NewVerifier(scheme.GetSchemeFromEnv()).VerifyBeacon(*b, db.pubkey)
|
||||
if err == nil {
|
||||
db.cacheValue(curr)
|
||||
PreviousSig: prevEntrySig,
|
||||
Round: entry.Round,
|
||||
Signature: entry.Data,
|
||||
}
|
||||
|
||||
err := db.scheme.VerifyBeacon(b, db.pubkey)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to verify beacon: %w", err)
|
||||
}
|
||||
|
||||
db.cacheValue(entry)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,15 @@ func TestMaxBeaconRoundForEpoch(t *testing.T) {
|
||||
todayTs := uint64(1652222222)
|
||||
db, err := NewDrandBeacon(todayTs, build.BlockDelaySecs, nil, build.DrandConfigs[build.DrandTestnet])
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, db.IsChained())
|
||||
mbr15 := db.MaxBeaconRoundForEpoch(network.Version15, 100)
|
||||
mbr16 := db.MaxBeaconRoundForEpoch(network.Version16, 100)
|
||||
assert.Equal(t, mbr15+1, mbr16)
|
||||
}
|
||||
|
||||
func TestQuicknetIsChained(t *testing.T) {
|
||||
todayTs := uint64(1652222222)
|
||||
db, err := NewDrandBeacon(todayTs, build.BlockDelaySecs, nil, build.DrandConfigs[build.DrandQuicknet])
|
||||
assert.NoError(t, err)
|
||||
assert.False(t, db.IsChained())
|
||||
}
|
||||
|
@ -20,6 +20,10 @@ type mockBeacon struct {
|
||||
interval time.Duration
|
||||
}
|
||||
|
||||
func (mb *mockBeacon) IsChained() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func NewMockBeacon(interval time.Duration) RandomBeacon {
|
||||
mb := &mockBeacon{interval: interval}
|
||||
|
||||
@ -47,7 +51,7 @@ func (mb *mockBeacon) Entry(ctx context.Context, index uint64) <-chan Response {
|
||||
return out
|
||||
}
|
||||
|
||||
func (mb *mockBeacon) VerifyEntry(from types.BeaconEntry, to types.BeaconEntry) error {
|
||||
func (mb *mockBeacon) VerifyEntry(from types.BeaconEntry, _prevEntrySig []byte) error {
|
||||
// TODO: cache this, especially for bls
|
||||
oe := mb.entryForIndex(from.Round)
|
||||
if !bytes.Equal(from.Data, oe.Data) {
|
||||
|
@ -53,6 +53,7 @@ func NewActorRegistry() *vm.ActorRegistry {
|
||||
inv.Register(actorstypes.Version10, vm.ActorsVersionPredicate(actorstypes.Version10), builtin.MakeRegistry(actorstypes.Version10))
|
||||
inv.Register(actorstypes.Version11, vm.ActorsVersionPredicate(actorstypes.Version11), builtin.MakeRegistry(actorstypes.Version11))
|
||||
inv.Register(actorstypes.Version12, vm.ActorsVersionPredicate(actorstypes.Version12), builtin.MakeRegistry(actorstypes.Version12))
|
||||
inv.Register(actorstypes.Version13, vm.ActorsVersionPredicate(actorstypes.Version13), builtin.MakeRegistry(actorstypes.Version13))
|
||||
|
||||
return inv
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user