Skip to content

Commit 8059308

Browse files
committed
add GetTwoWayPegData RPC
1 parent b23aca0 commit 8059308

File tree

1 file changed

+72
-4
lines changed

1 file changed

+72
-4
lines changed

proto/mainchain.proto

+72-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,20 @@ message BlockHeaderInfo {
1111
bytes work = 4;
1212
}
1313

14+
message OutPoint {
15+
bytes txid = 1;
16+
uint32 vout = 2;
17+
}
18+
19+
message Output {
20+
bytes address = 2;
21+
uint64 value_sats = 3;
22+
}
23+
1424
message Deposit {
1525
uint64 sequence_number = 1;
16-
bytes address = 2;
17-
uint64 value = 3;
26+
OutPoint outpoint = 2;
27+
Output output = 3;
1828
}
1929

2030
enum WithdrawalBundleEventType {
@@ -28,22 +38,56 @@ message WithdrawalBundleEvent {
2838
WithdrawalBundleEventType withdrawal_bundle_event_type = 2;
2939
}
3040

41+
// Specific to an individual sidechain slot
3142
message BlockInfo {
3243
repeated Deposit deposits = 1;
3344
optional WithdrawalBundleEvent withdrawal_bundle_event = 2;
34-
repeated bytes bmm_hashes = 3;
45+
optional bytes bmm_commitment = 3;
3546
}
3647

3748
service Mainchain {
49+
rpc BroadcastWithdrawalBundle(BroadcastWithdrawalBundleRequest)
50+
returns (BroadcastWithdrawalBundleResponse);
51+
rpc CreateBmmCriticalDataTransaction(CreateBmmCriticalDataTransactionRequest)
52+
returns (CreateBmmCriticalDataTransactionResponse);
53+
// Regtest only
54+
rpc GenerateBlocks(GenerateBlocksRequest)
55+
returns (GenerateBlocksResponse);
3856
rpc GetBlockHeaderInfo(GetBlockHeaderInfoRequest)
3957
returns (GetBlockHeaderInfoResponse);
4058
rpc GetBlockInfo(GetBlockInfoRequest) returns (GetBlockInfoResponse);
4159
rpc GetBmmHStarCommitments(GetBmmHStarCommitmentsRequest)
4260
returns (GetBmmHStarCommitmentsResponse);
4361
rpc GetChainTip(GetChainTipRequest) returns (GetChainTipResponse);
62+
rpc GetTwoWayPegData(GetTwoWayPegDataRequest)
63+
returns (GetTwoWayPegDataResponse);
4464
rpc SubscribeEvents(SubscribeEventsRequest) returns (stream EventResponse);
4565
}
4666

67+
message BroadcastWithdrawalBundleRequest {
68+
uint32 sidechain_id = 1;
69+
bytes transaction = 2;
70+
}
71+
message BroadcastWithdrawalBundleResponse {
72+
}
73+
74+
message CreateBmmCriticalDataTransactionRequest {
75+
uint32 sidechain_id = 1;
76+
uint64 value_sats = 2;
77+
uint32 height = 3;
78+
bytes critical_hash = 4;
79+
bytes prev_bytes = 5;
80+
}
81+
message CreateBmmCriticalDataTransactionResponse {
82+
bytes txid = 1;
83+
}
84+
85+
message GenerateBlocksRequest {
86+
uint32 blocks = 1;
87+
}
88+
message GenerateBlocksResponse {
89+
}
90+
4791
message GetBlockHeaderInfoRequest {
4892
bytes block_hash = 1;
4993
}
@@ -53,6 +97,7 @@ message GetBlockHeaderInfoResponse {
5397

5498
message GetBlockInfoRequest {
5599
bytes block_hash = 1;
100+
uint32 sidechain_id = 2;
56101
}
57102
message GetBlockInfoResponse {
58103
BlockHeaderInfo header_info = 1;
@@ -64,7 +109,16 @@ message GetBmmHStarCommitmentsRequest {
64109
uint32 sidechain_id = 2;
65110
}
66111
message GetBmmHStarCommitmentsResponse {
67-
repeated bytes commitments = 1;
112+
message BlockNotFoundError {
113+
bytes block_hash = 1;
114+
}
115+
message Commitments {
116+
repeated bytes commitments = 1;
117+
}
118+
oneof result {
119+
BlockNotFoundError block_not_found = 1;
120+
Commitments commitments = 2;
121+
}
68122
}
69123

70124
message GetChainTipRequest {
@@ -73,7 +127,21 @@ message GetChainTipResponse {
73127
BlockHeaderInfo block_header_info = 1;
74128
}
75129

130+
message GetTwoWayPegDataRequest {
131+
uint32 sidechain_id = 1;
132+
optional bytes start_block_hash = 2;
133+
bytes end_block_hash = 3;
134+
}
135+
message GetTwoWayPegDataResponse {
136+
message ResponseItem {
137+
BlockHeaderInfo block_header_info = 1;
138+
BlockInfo block_info = 2;
139+
}
140+
repeated ResponseItem blocks = 1;
141+
}
142+
76143
message SubscribeEventsRequest {
144+
uint32 sidechain_id = 1;
77145
}
78146
message EventResponse {
79147
message Event {

0 commit comments

Comments
 (0)