forked from 0xPolygonHermez/zkevm-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
103 lines (92 loc) · 2.69 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package etherman
import (
"time"
"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/etrogpolygonzkevm"
"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/preetrogpolygonzkevm"
"github.com/ethereum/go-ethereum/common"
)
// Block struct
type Block struct {
BlockNumber uint64
BlockHash common.Hash
ParentHash common.Hash
ForcedBatches []ForcedBatch
SequencedBatches [][]SequencedBatch
UpdateEtrogSequence UpdateEtrogSequence
VerifiedBatches []VerifiedBatch
SequencedForceBatches [][]SequencedForceBatch
ForkIDs []ForkID
ReceivedAt time.Time
// GER data
GlobalExitRoots, L1InfoTree []GlobalExitRoot
}
// GlobalExitRoot struct
type GlobalExitRoot struct {
BlockNumber uint64
MainnetExitRoot common.Hash
RollupExitRoot common.Hash
GlobalExitRoot common.Hash
Timestamp time.Time
PreviousBlockHash common.Hash
}
// SequencedBatchElderberryData represents an Elderberry sequenced batch data
type SequencedBatchElderberryData struct {
MaxSequenceTimestamp uint64
InitSequencedBatchNumber uint64 // Last sequenced batch number
}
// SequencedBatch represents virtual batch
type SequencedBatch struct {
BatchNumber uint64
L1InfoRoot *common.Hash
SequencerAddr common.Address
TxHash common.Hash
Nonce uint64
Coinbase common.Address
// Struct used in preEtrog forks
*preetrogpolygonzkevm.PolygonZkEVMBatchData
// Struct used in Etrog
*etrogpolygonzkevm.PolygonRollupBaseEtrogBatchData
// Struct used in Elderberry
*SequencedBatchElderberryData
}
// UpdateEtrogSequence represents the first etrog sequence
type UpdateEtrogSequence struct {
BatchNumber uint64
SequencerAddr common.Address
TxHash common.Hash
Nonce uint64
// Struct used in Etrog
*etrogpolygonzkevm.PolygonRollupBaseEtrogBatchData
}
// ForcedBatch represents a ForcedBatch
type ForcedBatch struct {
BlockNumber uint64
ForcedBatchNumber uint64
Sequencer common.Address
GlobalExitRoot common.Hash
RawTxsData []byte
ForcedAt time.Time
}
// VerifiedBatch represents a VerifiedBatch
type VerifiedBatch struct {
BlockNumber uint64
BatchNumber uint64
Aggregator common.Address
StateRoot common.Hash
TxHash common.Hash
}
// SequencedForceBatch is a sturct to track the ForceSequencedBatches event.
type SequencedForceBatch struct {
BatchNumber uint64
Coinbase common.Address
TxHash common.Hash
Timestamp time.Time
Nonce uint64
etrogpolygonzkevm.PolygonRollupBaseEtrogBatchData
}
// ForkID is a sturct to track the ForkID event.
type ForkID struct {
BatchNumber uint64
ForkID uint64
Version string
}