-
Notifications
You must be signed in to change notification settings - Fork 9
/
blockchain.proto
121 lines (102 loc) · 2.17 KB
/
blockchain.proto
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
118
119
120
121
syntax = "proto3";
enum ProofType {
AuthorityRound = 0;
Raft = 1;
Bft = 2;
}
message Proof {
bytes content = 1;
ProofType type = 2;
}
message BlockHeader {
bytes prevhash = 1;
uint64 timestamp = 2;
uint64 height = 3;
bytes state_root = 4;
bytes transactions_root = 5;
bytes receipts_root = 6;
uint64 quota_used = 7;
uint64 quota_limit = 8;
Proof proof = 9;
bytes proposer = 10;
}
message Status {
bytes hash = 1;
uint64 height = 2;
}
message AccountGasLimit {
uint64 common_quota_limit = 1;
map<string,uint64> specific_quota_limit = 2;
}
message RichStatus {
bytes hash = 1;
uint64 height = 2;
repeated bytes nodes = 3;
uint64 interval = 4;
uint32 version = 5;
repeated bytes validators = 6;
uint64 timestamp = 7;
}
enum Crypto {
DEFAULT = 0;
RESERVED = 1;
}
message Transaction {
string to = 1;
string nonce = 2;
uint64 quota = 3;
uint64 valid_until_block = 4;
bytes data = 5;
bytes value = 6;
uint32 chain_id = 7;
uint32 version = 8;
bytes to_v1 = 9;
bytes chain_id_v1 = 10;
}
message UnverifiedTransaction {
Transaction transaction = 1;
bytes signature = 2;
Crypto crypto = 3;
}
message SignedTransaction {
UnverifiedTransaction transaction_with_sig = 1;
// SignedTransaction hash
bytes tx_hash = 2;
// public key
bytes signer = 3;
}
// data precompile API
message BlockBody {
repeated SignedTransaction transactions = 1;
}
message CompactBlockBody {
repeated bytes tx_hashes = 1;
}
message Block {
uint32 version = 1;
BlockHeader header = 2;
BlockBody body = 3;
}
message CompactBlock {
uint32 version = 1;
BlockHeader header = 2;
CompactBlockBody body = 3;
}
message BlockWithProof {
Block blk = 1;
Proof proof = 2;
}
message BlockTxs {
uint64 height = 1;
BlockBody body = 3;
}
message BlackList {
// black list of address, the account that sent the transaction does not have enough gas
repeated bytes black_list = 1;
// clear list of address
repeated bytes clear_list = 2;
}
// State positioning signal
message StateSignal {
uint64 height = 1;
}