-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathblock.go
More file actions
117 lines (110 loc) · 6.46 KB
/
block.go
File metadata and controls
117 lines (110 loc) · 6.46 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package data
import (
"github.com/multiversx/mx-chain-core-go/data/api"
)
// Block is a structure containing all the fields that need
//
// to be saved for a block. It has all the default fields
// plus some extra information for ease of search and filter
type Block struct {
UUID string `json:"uuid"`
Nonce uint64 `json:"nonce"`
Round uint64 `json:"round"`
Epoch uint32 `json:"epoch"`
Hash string `json:"-"`
MiniBlocksHashes []string `json:"miniBlocksHashes"`
MiniBlocksDetails []*MiniBlocksDetails `json:"miniBlocksDetails,omitempty"`
NotarizedBlocksHashes []string `json:"notarizedBlocksHashes"`
Proposer uint64 `json:"proposer"`
Validators []uint64 `json:"validators,omitempty"`
PubKeyBitmap string `json:"pubKeyBitmap"`
Size int64 `json:"size"`
SizeTxs int64 `json:"sizeTxs"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
StateRootHash string `json:"stateRootHash"`
PrevHash string `json:"prevHash"`
ShardID uint32 `json:"shardId"`
TxCount uint32 `json:"txCount"`
NotarizedTxsCount uint32 `json:"notarizedTxsCount"`
AccumulatedFees string `json:"accumulatedFees"`
DeveloperFees string `json:"developerFees"`
EpochStartBlock bool `json:"epochStartBlock"`
SearchOrder uint64 `json:"searchOrder"`
EpochStartInfo *EpochStartInfo `json:"epochStartInfo,omitempty"`
GasProvided uint64 `json:"gasProvided"`
GasRefunded uint64 `json:"gasRefunded"`
GasPenalized uint64 `json:"gasPenalized"`
MaxGasLimit uint64 `json:"maxGasLimit"`
ScheduledData *ScheduledData `json:"scheduledData,omitempty"`
EpochStartShardsData []*EpochStartShardData `json:"epochStartShardsData,omitempty"`
Proof *api.HeaderProof `json:"proof,omitempty"`
RandSeed string `json:"randSeed,omitempty"`
PrevRandSeed string `json:"prevRandSeed,omitempty"`
Signature string `json:"signature,omitempty"`
LeaderSignature string `json:"leaderSignature,omitempty"`
ChainID string `json:"chainID,omitempty"`
SoftwareVersion string `json:"softwareVersion,omitempty"`
ReceiptsHash string `json:"receiptsHash,omitempty"`
Reserved []byte `json:"reserved,omitempty"`
ProposerBlsKey string `json:"proposerBlsKey,omitempty"`
}
// MiniBlocksDetails is a structure that hold information about mini-blocks execution details
type MiniBlocksDetails struct {
IndexFirstProcessedTx int32 `json:"firstProcessedTx"`
IndexLastProcessedTx int32 `json:"lastProcessedTx"`
SenderShardID uint32 `json:"senderShard"`
ReceiverShardID uint32 `json:"receiverShard"`
MBIndex int `json:"mbIndex"`
Type string `json:"type"`
ProcessingType string `json:"procType,omitempty"`
TxsHashes []string `json:"txsHashes,omitempty"`
ExecutionOrderTxsIndices []int `json:"executionOrderTxsIndices,omitempty"`
}
// ScheduledData is a structure that hold information about scheduled events
type ScheduledData struct {
ScheduledRootHash string `json:"rootHash,omitempty"`
ScheduledAccumulatedFees string `json:"accumulatedFees,omitempty"`
ScheduledDeveloperFees string `json:"developerFees,omitempty"`
ScheduledGasProvided uint64 `json:"gasProvided,omitempty"`
ScheduledGasPenalized uint64 `json:"penalized,omitempty"`
ScheduledGasRefunded uint64 `json:"gasRefunded,omitempty"`
}
// EpochStartInfo is a structure that hold information about epoch start meta block
type EpochStartInfo struct {
TotalSupply string `json:"totalSupply"`
TotalToDistribute string `json:"totalToDistribute"`
TotalNewlyMinted string `json:"totalNewlyMinted"`
RewardsPerBlock string `json:"rewardsPerBlock"`
RewardsForProtocolSustainability string `json:"rewardsForProtocolSustainability"`
NodePrice string `json:"nodePrice"`
PrevEpochStartRound uint64 `json:"prevEpochStartRound"`
PrevEpochStartHash string `json:"prevEpochStartHash"`
}
// EpochStartShardData is a structure that hold information about epoch start meta block shard data
type EpochStartShardData struct {
ShardID uint32 `json:"shardID,omitempty"`
Epoch uint32 `json:"epoch,omitempty"`
Round uint64 `json:"round,omitempty"`
Nonce uint64 `json:"nonce,omitempty"`
HeaderHash string `json:"headerHash,omitempty"`
RootHash string `json:"rootHash,omitempty"`
ScheduledRootHash string `json:"scheduledRootHash,omitempty"`
FirstPendingMetaBlock string `json:"firstPendingMetaBlock,omitempty"`
LastFinishedMetaBlock string `json:"lastFinishedMetaBlock,omitempty"`
PendingMiniBlockHeaders []*Miniblock `json:"pendingMiniBlockHeaders,omitempty"`
}
// Miniblock is a structure containing miniblock information
type Miniblock struct {
Hash string `json:"hash,omitempty"`
SenderShardID uint32 `json:"senderShard"`
ReceiverShardID uint32 `json:"receiverShard"`
SenderBlockHash string `json:"senderBlockHash,omitempty"`
ReceiverBlockHash string `json:"receiverBlockHash,omitempty"`
Type string `json:"type"`
ProcessingTypeOnSource string `json:"procTypeS,omitempty"`
ProcessingTypeOnDestination string `json:"procTypeD,omitempty"`
Timestamp uint64 `json:"timestamp"`
TimestampMs uint64 `json:"timestampMs,omitempty"`
Reserved []byte `json:"reserved,omitempty"`
}