Skip to content

Commit

Permalink
feat: ec: Integrate Fast Finality for Filecoin (filecoin-project#12119)
Browse files Browse the repository at this point in the history
Integrate F3 into Lotus

Signed-off-by: Jakub Sztandera <[email protected]>
Co-authored-by: Jennifer Wang <[email protected]>
Co-authored-by: Masih H. Derkani <[email protected]>
Co-authored-by: Steven Allen <[email protected]>
  • Loading branch information
4 people authored Jun 28, 2024
1 parent b4c2e2e commit 7cdf9aa
Show file tree
Hide file tree
Showing 27 changed files with 1,630 additions and 462 deletions.
13 changes: 13 additions & 0 deletions api/api_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
"github.com/filecoin-project/go-f3/certs"
"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
Expand Down Expand Up @@ -859,6 +860,18 @@ type FullNode interface {
// Note: this API is only available via websocket connections.
// This is an EXPERIMENTAL API and may be subject to change.
SubscribeActorEventsRaw(ctx context.Context, filter *types.ActorEventFilter) (<-chan *types.ActorEvent, error) //perm:read

// F3Participate should be called by a miner node to participate in signing F3 consensus.
// The address should be of type ID
// The returned channel will never be closed by the F3
// If it is closed without the context being cancelled, the caller should retry.
// The values returned on the channel will inform the caller about participation
// Empty strings will be sent if participation succeeded, non-empty strings explain possible errors.
F3Participate(ctx context.Context, minerID address.Address) (<-chan string, error) //perm:admin
// F3GetCertificate returns a finality certificate at given instance number
F3GetCertificate(ctx context.Context, instance uint64) (*certs.FinalityCertificate, error) //perm:read
// F3GetLatestCertificate returns the latest finality certificate
F3GetLatestCertificate(ctx context.Context) (*certs.FinalityCertificate, error) //perm:read
}

// reverse interface to the client, called after EthSubscribe
Expand Down
2 changes: 2 additions & 0 deletions api/docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
"github.com/filecoin-project/go-f3/certs"
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
Expand Down Expand Up @@ -399,6 +400,7 @@ func init() {
FromHeight: epochPtr(1010),
ToHeight: epochPtr(1020),
})
addExample(&certs.FinalityCertificate{})
}

func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {
Expand Down
46 changes: 46 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.

40 changes: 40 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 7cdf9aa

Please sign in to comment.