forked from prysmaticlabs/prysm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
69 lines (61 loc) · 2.48 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package blocks
import (
"github.com/pkg/errors"
field_params "github.com/stratisproject/prysm-stratis/config/fieldparams"
"github.com/stratisproject/prysm-stratis/consensus-types/interfaces"
"github.com/stratisproject/prysm-stratis/consensus-types/primitives"
eth "github.com/stratisproject/prysm-stratis/proto/prysm/v1alpha1"
)
var (
_ = interfaces.ReadOnlySignedBeaconBlock(&SignedBeaconBlock{})
_ = interfaces.ReadOnlyBeaconBlock(&BeaconBlock{})
_ = interfaces.ReadOnlyBeaconBlockBody(&BeaconBlockBody{})
)
var (
errPayloadWrongType = errors.New("execution payload has wrong type")
errPayloadHeaderWrongType = errors.New("execution payload header has wrong type")
)
const (
incorrectBlockVersion = "incorrect beacon block version"
incorrectBodyVersion = "incorrect beacon block body version"
)
var (
// ErrUnsupportedVersion for beacon block methods.
ErrUnsupportedVersion = errors.New("unsupported beacon block version")
errNilBlock = errors.New("received nil beacon block")
errNilBlockBody = errors.New("received nil beacon block body")
errIncorrectBlockVersion = errors.New(incorrectBlockVersion)
errIncorrectBodyVersion = errors.New(incorrectBodyVersion)
)
// BeaconBlockBody is the main beacon block body structure. It can represent any block type.
type BeaconBlockBody struct {
version int
randaoReveal [field_params.BLSSignatureLength]byte
eth1Data *eth.Eth1Data
graffiti [field_params.RootLength]byte
proposerSlashings []*eth.ProposerSlashing
attesterSlashings []*eth.AttesterSlashing
attestations []*eth.Attestation
deposits []*eth.Deposit
voluntaryExits []*eth.SignedVoluntaryExit
syncAggregate *eth.SyncAggregate
executionPayload interfaces.ExecutionData
executionPayloadHeader interfaces.ExecutionData
blsToExecutionChanges []*eth.SignedBLSToExecutionChange
blobKzgCommitments [][]byte
}
// BeaconBlock is the main beacon block structure. It can represent any block type.
type BeaconBlock struct {
version int
slot primitives.Slot
proposerIndex primitives.ValidatorIndex
parentRoot [field_params.RootLength]byte
stateRoot [field_params.RootLength]byte
body *BeaconBlockBody
}
// SignedBeaconBlock is the main signed beacon block structure. It can represent any block type.
type SignedBeaconBlock struct {
version int
block *BeaconBlock
signature [field_params.BLSSignatureLength]byte
}