-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Light Client consensus types (#14518)
* protos/SSZ * interfaces * types * cleanup/dedup * changelog * use createBranch in headers * error handling --------- Co-authored-by: rkapka <radoslaw.kapka@gmail.com>
- Loading branch information
1 parent
cfbfccb
commit 7fc5c71
Showing
21 changed files
with
5,564 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ go_library( | |
srcs = [ | ||
"beacon_block.go", | ||
"error.go", | ||
"light_client.go", | ||
"utils.go", | ||
"validator.go", | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package interfaces | ||
|
||
import ( | ||
ssz "github.com/prysmaticlabs/fastssz" | ||
fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" | ||
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" | ||
pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" | ||
) | ||
|
||
type LightClientExecutionBranch = [fieldparams.ExecutionBranchDepth][fieldparams.RootLength]byte | ||
type LightClientSyncCommitteeBranch = [fieldparams.SyncCommitteeBranchDepth][fieldparams.RootLength]byte | ||
type LightClientFinalityBranch = [fieldparams.FinalityBranchDepth][fieldparams.RootLength]byte | ||
|
||
type LightClientHeader interface { | ||
ssz.Marshaler | ||
Version() int | ||
Beacon() *pb.BeaconBlockHeader | ||
Execution() (ExecutionData, error) | ||
ExecutionBranch() (LightClientExecutionBranch, error) | ||
} | ||
|
||
type LightClientBootstrap interface { | ||
ssz.Marshaler | ||
Version() int | ||
Header() LightClientHeader | ||
CurrentSyncCommittee() *pb.SyncCommittee | ||
CurrentSyncCommitteeBranch() LightClientSyncCommitteeBranch | ||
} | ||
|
||
type LightClientUpdate interface { | ||
ssz.Marshaler | ||
Version() int | ||
AttestedHeader() LightClientHeader | ||
NextSyncCommittee() *pb.SyncCommittee | ||
NextSyncCommitteeBranch() LightClientSyncCommitteeBranch | ||
FinalizedHeader() LightClientHeader | ||
FinalityBranch() LightClientFinalityBranch | ||
SyncAggregate() *pb.SyncAggregate | ||
SignatureSlot() primitives.Slot | ||
} | ||
|
||
type LightClientFinalityUpdate interface { | ||
ssz.Marshaler | ||
Version() int | ||
AttestedHeader() LightClientHeader | ||
FinalizedHeader() LightClientHeader | ||
FinalityBranch() LightClientFinalityBranch | ||
SyncAggregate() *pb.SyncAggregate | ||
SignatureSlot() primitives.Slot | ||
} | ||
|
||
type LightClientOptimisticUpdate interface { | ||
ssz.Marshaler | ||
Version() int | ||
AttestedHeader() LightClientHeader | ||
SyncAggregate() *pb.SyncAggregate | ||
SignatureSlot() primitives.Slot | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
load("@prysm//tools/go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = [ | ||
"bootstrap.go", | ||
"finality_update.go", | ||
"header.go", | ||
"helpers.go", | ||
"optimistic_update.go", | ||
"update.go", | ||
], | ||
importpath = "github.com/prysmaticlabs/prysm/v5/consensus-types/light-client", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//config/fieldparams:go_default_library", | ||
"//consensus-types:go_default_library", | ||
"//consensus-types/blocks:go_default_library", | ||
"//consensus-types/interfaces:go_default_library", | ||
"//consensus-types/primitives:go_default_library", | ||
"//encoding/bytesutil:go_default_library", | ||
"//proto/prysm/v1alpha1:go_default_library", | ||
"//runtime/version:go_default_library", | ||
"@org_golang_google_protobuf//proto:go_default_library", | ||
], | ||
) |
Oops, something went wrong.