-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathtxpool.proto
116 lines (101 loc) · 2.82 KB
/
txpool.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
syntax = "proto3";
import "google/protobuf/empty.proto";
import "types/types.proto";
package txpool;
option go_package = "./txpool;txpoolproto";
message TxHashes {
repeated types.H256 hashes = 1;
}
message AddRequest {
repeated bytes rlp_txs = 1;
}
enum ImportResult {
SUCCESS = 0;
ALREADY_EXISTS = 1;
FEE_TOO_LOW = 2;
STALE = 3;
INVALID = 4;
INTERNAL_ERROR = 5;
}
message AddReply {
repeated ImportResult imported = 1;
repeated string errors = 2;
}
message TransactionsRequest {
repeated types.H256 hashes = 1;
}
message TransactionsReply {
repeated bytes rlp_txs = 1;
}
message OnAddRequest {}
message OnAddReply {
repeated bytes rpl_txs = 1;
}
message AllRequest {}
message AllReply {
enum TxnType {
PENDING = 0; // All currently processable transactions
QUEUED = 1; // Queued but non-processable transactions
BASE_FEE = 2; // BaseFee not enough baseFee non-processable transactions
}
message Tx {
TxnType txn_type = 1;
types.H160 sender = 2;
bytes rlp_tx = 3;
}
repeated Tx txs = 1;
}
message PendingReply {
message Tx {
types.H160 sender = 1;
bytes rlp_tx = 2;
bool is_local = 3;
}
repeated Tx txs = 1;
}
message StatusRequest {}
message StatusReply {
uint32 pending_count = 1;
uint32 queued_count = 2;
uint32 base_fee_count = 3;
}
message NonceRequest {
types.H160 address = 1;
}
message NonceReply {
bool found = 1;
uint64 nonce = 2;
}
message GetBlobsRequest{
repeated types.H256 blob_hashes = 1;
}
message BlobAndProofV1 {
bytes blob = 1;
bytes proof = 2;
}
message GetBlobsReply{
repeated BlobAndProofV1 blobs_and_proofs = 1;
}
service Txpool {
// Version returns the service version number
rpc Version(google.protobuf.Empty) returns (types.VersionReply);
// preserves incoming order, changes amount, unknown hashes will be omitted
rpc FindUnknown(TxHashes) returns (TxHashes);
// Expecting signed transactions. Preserves incoming order and amount
// Adding txs as local (use P2P to add remote txs)
rpc Add(AddRequest) returns (AddReply);
// preserves incoming order and amount, if some transaction doesn't exists in pool - returns nil in this slot
rpc Transactions(TransactionsRequest) returns (TransactionsReply);
// returns all transactions from tx pool
rpc All(AllRequest) returns (AllReply);
// Returns all pending (processable) transactions, in ready-for-mining order
rpc Pending(google.protobuf.Empty) returns (PendingReply);
// subscribe to new transactions add event
rpc OnAdd(OnAddRequest) returns (stream OnAddReply);
// returns high level status
rpc Status(StatusRequest) returns (StatusReply);
// returns nonce for given account
rpc Nonce(NonceRequest) returns (NonceReply);
// returns the list of blobs and proofs for a given list of blob hashes
rpc GetBlobs(GetBlobsRequest) returns (GetBlobsReply);
}