Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Merge nv22 into master #11699

Merged
merged 74 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
4313f99
[WIP] feat: Add nv22 skeleton
Nov 20, 2023
1324822
update FFI
arajasek Dec 5, 2023
a967a36
feat: drand: refactor round verification
arajasek Jan 24, 2024
9e03fca
feat: sealing: Support nv22 DDO features in the sealing pipeline (#11…
magik6k Jan 25, 2024
7613cdf
feat: implement FIP-0063
arajasek Jan 25, 2024
78edf46
Merge pull request #11572 from filecoin-project/asr/fip-0063
arajasek Jan 29, 2024
3926a96
chore: deps: update to go-multiaddr v0.12.2 (#11602)
arajasek Jan 31, 2024
b460701
feat: fvm: update the FVM/FFI to v4.1 (#11608) (#11612)
rjan90 Feb 7, 2024
a7982fb
AggregateProofType nil when doing batch updates
rvagg Feb 7, 2024
89d47a7
Update to v13.0.0-rc.2 bundle
rjan90 Feb 8, 2024
3426289
chore: Upgrade heights and codename
rjan90 Jan 25, 2024
9112e85
Update epoch after nv22 DRAND switch
rjan90 Feb 12, 2024
cea5ae6
Update Mango codename to Phoneix
rjan90 Feb 13, 2024
e9245c1
Add UpgradePhoenixHeight to API params
arajasek Feb 13, 2024
4f23b06
set UpgradePhoenixHeight to be one hour after Dragon
arajasek Feb 13, 2024
65b1977
Make gen
rjan90 Feb 13, 2024
fe75ee0
Merge pull request #11599 from filecoin-project/phi-butterfly-prep
rjan90 Feb 13, 2024
8ad534b
Update epoch heights (#11637)
rjan90 Feb 21, 2024
2e5de1b
new: add forest bootstrap nodes (#11636)
samuelarogbonlo Feb 21, 2024
ddf535d
Merge pull request #11491 from filecoin-project/fix/remove-decommissi…
arajasek Feb 22, 2024
9250307
feat: api: new verified registry methods to get all allocations and c…
LexLuthr Feb 22, 2024
9dc29bf
chore:: backport #11609 to the feat/nv22 branch (#11644)
rjan90 Feb 27, 2024
01ec166
fix: add UpgradePhoenixHeight to StateGetNetworkParams (#11648)
tom123222 Feb 27, 2024
faf0374
chore: deps: update to go-state-types v13.0.0-rc.1
arajasek Feb 28, 2024
d862e2c
do NOT update the cache when running the real migration
arajasek Feb 28, 2024
fc6229a
Merge pull request #11662 from filecoin-project/asr/migration-nv22
rjan90 Feb 28, 2024
f2bca58
Merge pull request #11632 from hanabi1224/hm/drand-test
arajasek Feb 28, 2024
62989ff
Merge pull request #11667 from filecoin-project/phi-backport-11632
rjan90 Mar 1, 2024
8cf2bbc
chore: deps: update to go-state-types v13.0.0-rc.2
rjan90 Mar 4, 2024
544a16d
feat: set migration config UpgradeEpoch for v13 actors upgrade
arajasek Mar 4, 2024
9aef2ec
Merge pull request #11675 from filecoin-project/phi-bump-gst
rjan90 Mar 4, 2024
f007a01
Built-in actor events first draft
aarshkshah1992 Dec 19, 2023
cef19d5
itest for DDO non-market verified data w/ builtin actor events
rvagg Jan 30, 2024
01ac45c
Tests for builtin actor events API
aarshkshah1992 Feb 7, 2024
bb311dd
Clean up DDO+Events tests, add lots of explainer comments
rvagg Feb 8, 2024
256f0b0
Minor tweaks to events types
rvagg Feb 8, 2024
af6cecb
Avoid duplicate messages when looking for receipts
rvagg Feb 19, 2024
ce38c31
Rename internal events modules for clarity
rvagg Feb 19, 2024
2194eac
Adjust actor event API after review
rvagg Feb 22, 2024
c492b49
s/ActorEvents/Events/g in global config
rvagg Feb 26, 2024
dc0c863
Manage event sending rate for SubscribeActorEvents
rvagg Feb 26, 2024
b12714f
Terminate SubscribeActorEvents chan when at max height
rvagg Feb 26, 2024
377a3e2
Document future API changes
rvagg Feb 26, 2024
e86bb27
More clarity in actor event API docs
rvagg Feb 26, 2024
f9fef2a
More post-review changes, lots of tests for SubscribeActorEvents
rvagg Mar 1, 2024
85584a4
Remove duplicate code from actor event type marshalling tests
masih Mar 1, 2024
5f39979
Rename actor events test to follow go convention
masih Mar 1, 2024
92ce665
Run actor events table tests in deterministic order
masih Mar 1, 2024
4c868da
Reduce scope for filter removal failure when getting actor events
masih Mar 1, 2024
a016747
Use fixed RNG seed for actor event tests
masih Mar 1, 2024
7ca9669
Use provided libraries to assert eventual conditions
masih Mar 1, 2024
5359a17
Update changelog for actor events APIs
rvagg Mar 5, 2024
4dcd658
Fix concerns and docs identified by review
rvagg Mar 5, 2024
338b4c7
Update actor bundle to v13.0.0-rc3
rjan90 Mar 5, 2024
35ac102
Merge pull request #11682 from filecoin-project/update-v13actors-rc
rjan90 Mar 5, 2024
7ee1553
Prep Lotus v1.26.0-rc1
rjan90 Feb 13, 2024
b78aebe
Update CHANGELOG.md
rjan90 Mar 5, 2024
2d1fa77
Make gen
rjan90 Mar 5, 2024
64b32ad
Merge pull request #11620 from filecoin-project/phi-rc1-prep
jennijuju Mar 5, 2024
daafe73
fix: beacon: validate drand change at nv16 correctly
arajasek Mar 6, 2024
1f6e556
Merge pull request #11690 from filecoin-project/asr/fix-drand-skyr
arajasek Mar 6, 2024
1a46f71
bump to v1.26.0-rc2
jennijuju Mar 6, 2024
5704f7c
test: cleanup ddo verified itest, extract steps to functions
rvagg Mar 4, 2024
5e8cf36
test: extract verified DDO test to separate file, add more checks
rvagg Mar 4, 2024
b91da8e
test: add additional actor events checks
rvagg Mar 4, 2024
2bf2706
Add verification for "deal-activated" actor event
rvagg Mar 5, 2024
4a1a7bd
Merge pull request #11691 from filecoin-project/jen/v126rc2
jennijuju Mar 7, 2024
b4e7374
docs(drand): document the meaning of "IsChained" (#11692)
rvagg Mar 7, 2024
b6c446b
Merge branch 'release/v1.26.0' into chore-nv22-to-master
rjan90 Mar 8, 2024
f776093
Resolve conflicts
rjan90 Mar 8, 2024
e875ad3
fixup imports, make jen
arajasek Mar 8, 2024
a613651
Update version
rjan90 Mar 11, 2024
fd27a85
Update node/impl/full/dummy.go
rjan90 Mar 12, 2024
27e035a
Adjust ListClaimsCmd
rjan90 Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
132 changes: 131 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,74 @@

# UNRELEASED

## New features

## Improvements

# 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
## Tracing API

Replace the `CodeCid` field in the message trace (added in 1.23.4) with an `InvokedActor` field.

Expand Down Expand Up @@ -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.
Expand Down
76 changes: 74 additions & 2 deletions api/api_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ 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"
abinetwork "github.com/filecoin-project/go-state-types/network"

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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions api/api_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Loading
Loading