Skip to content

Commit

Permalink
feat: implement F3 list participants API (#12608)
Browse files Browse the repository at this point in the history
* Implement F3 list participants API

Implement Lotus API to list the current miner IDs that are
participating.

* Include lease information to list participants API

Also return start and validity terms of the list participants API.
  • Loading branch information
masih authored Oct 17, 2024
1 parent fda61d3 commit 13a0ce7
Show file tree
Hide file tree
Showing 14 changed files with 734 additions and 500 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fix hotloop in F3 pariticpation API ([filecoin-project/lotus#12575](https://github.com/filecoin-project/lotus/pull/12575))
- `lotus chain head` now supports a `--height` flag to print just the epoch number of the current chain head ([filecoin-project/lotus#12609](https://github.com/filecoin-project/lotus/pull/12609))
- `lotus-shed indexes inspect-indexes` now performs a comprehensive comparison of the event index data for each message by comparing the AMT root CID from the message receipt with the root of a reconstructed AMT. Previously `inspect-indexes` simply compared event counts, comparing AMT roots confirms all the event data is byte-perfect. ([filecoin-project/lotus#12570](https://github.com/filecoin-project/lotus/pull/12570))
- Expose APIs to list the miner IDs that are currently participating in F3 via node. ([filecoin-project/lotus#12608](https://github.com/filecoin-project/lotus/pull/12608))

## Bug Fixes
- Fix a bug in the `lotus-shed indexes backfill-events` command that may result in either duplicate events being backfilled where there are existing events (such an operation *should* be idempotent) or events erroneously having duplicate `logIndex` values when queried via ETH APIs. ([filecoin-project/lotus#12567](https://github.com/filecoin-project/lotus/pull/12567))
Expand Down
15 changes: 15 additions & 0 deletions api/api_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,8 @@ type FullNode interface {
F3IsRunning(ctx context.Context) (bool, error) //perm:read
// F3GetProgress returns the progress of the current F3 instance in terms of instance ID, round and phase.
F3GetProgress(ctx context.Context) (gpbft.Instant, error) //perm:read
// F3ListParticipants returns the list of miners that are currently participating in F3 via this node.
F3ListParticipants(ctx context.Context) ([]F3Participant, error) //perm:read
}

// F3ParticipationTicket represents a ticket that authorizes a miner to
Expand Down Expand Up @@ -993,6 +995,19 @@ func (l *F3ParticipationLease) ToInstance() uint64 {
return l.FromInstance + l.ValidityTerm
}

// F3Participant captures information about the miners that are currently
// participating in F3, along with the number of instances for which their lease
// is valid.
type F3Participant struct {
// MinerID is the actor ID of the miner that is
MinerID uint64
// FromInstance specifies the instance ID from which this lease is valid.
FromInstance uint64
// ValidityTerm specifies the number of instances for which the lease remains
// valid from the FromInstance.
ValidityTerm uint64
}

// EthSubscriber is the reverse interface to the client, called after EthSubscribe
type EthSubscriber interface {
// note: the parameter is ethtypes.EthSubscriptionResponse serialized as json object
Expand Down
15 changes: 15 additions & 0 deletions api/mocks/mock_full.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 13a0ce7

Please sign in to comment.