forked from erigontech/erigon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
69 lines (59 loc) · 2.09 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 aura
import (
"sync/atomic"
libcommon "github.com/nebojsa94/erigon/erigon-lib/common"
"github.com/nebojsa94/erigon/core/types"
)
type StepDurationInfo struct {
TransitionStep uint64
TransitionTimestamp uint64
StepDuration uint64
}
// EpochTransitionProof - Holds 2 proofs inside: ValidatorSetProof and FinalityProof
type EpochTransitionProof struct {
SignalNumber uint64
SetProof []byte
FinalityProof []byte
}
// ValidatorSetProof - validator set proof
type ValidatorSetProof struct {
Header *types.Header
Receipts types.Receipts
}
// FirstValidatorSetProof state-dependent proofs for the safe contract:
// only "first" proofs are such.
type FirstValidatorSetProof struct { // TODO: whaaat? here is no state!
ContractAddress libcommon.Address
Header *types.Header
}
type EpochTransition struct {
/// Block hash at which the transition occurred.
BlockHash libcommon.Hash
/// Block number at which the transition occurred.
BlockNumber uint64
/// "transition/epoch" proof from the engine combined with a finality proof.
ProofRlp []byte
}
type epochReader interface {
GetEpoch(blockHash libcommon.Hash, blockN uint64) (transitionProof []byte, err error)
GetPendingEpoch(blockHash libcommon.Hash, blockN uint64) (transitionProof []byte, err error)
FindBeforeOrEqualNumber(number uint64) (blockNum uint64, blockHash libcommon.Hash, transitionProof []byte, err error)
}
type epochWriter interface {
epochReader
PutEpoch(blockHash libcommon.Hash, blockN uint64, transitionProof []byte) (err error)
PutPendingEpoch(blockHash libcommon.Hash, blockN uint64, transitionProof []byte) (err error)
}
type PermissionedStep struct {
inner *Step
canPropose atomic.Bool
}
// An empty step message that is included in a seal, the only difference is that it doesn't include
// the `parent_hash` in order to save space. The included signature is of the original empty step
// message, which can be reconstructed by using the parent hash of the block in which this sealed
// empty message is included.
// nolint
type SealedEmptyStep struct {
signature []byte // H520
step uint64
}