@@ -23,11 +23,11 @@ package pyth_lazer;
23
23
// <magic:u32><module:u8><action:u8><chain:u16><GovernanceInstruction:bytes>
24
24
// You can find the xc-admin spec in: ../../../governance/xc_admin/packages/xc_admin_common/src/governance_payload
25
25
message GovernanceInstruction {
26
- // Action requested by this instruction. For the instruction to be accepted, all directives
26
+ // Action requested by this instruction. For the instruction to be accepted, all items
27
27
// must be successfully applied. In case of any failure, the whole instruction is reverted.
28
28
// However, note that if the instruction targets multiple (or all) shards, each shard will
29
29
// accept or reject the instruction independently of other shards.
30
- repeated GovernanceDirective directives = 2 ;
30
+ repeated GovernanceInstructionItem items = 2 ;
31
31
// [optional] If specified, the instruction will be rejected if the current timestamp
32
32
// is less than the specified value. In case of rejection, the same instruction can be resubmitted
33
33
// and executed later once the time requirement is met.
@@ -70,7 +70,7 @@ message ShardFilter {
70
70
}
71
71
72
72
// An item of a governance instruction.
73
- message GovernanceDirective {
73
+ message GovernanceInstructionItem {
74
74
// [required] Specifies which shards the governance instruction applies to.
75
75
// The instruction applies to each shard independently of other shards and may apply
76
76
// at a different time. The instruction may succeed on some shards and fail on other shards.
@@ -84,13 +84,16 @@ message GovernanceDirective {
84
84
CreateShard create_shard = 101 ;
85
85
AddGovernanceSource add_governance_source = 102 ;
86
86
UpdateGovernanceSource update_governance_source = 103 ;
87
- SetShardName set_shard_name = 104 ;
88
- SetShardGroup set_shard_group = 105 ;
89
- ResetLastSequenceNo reset_last_sequence_no = 106 ;
90
- AddPublisher add_publisher = 107 ;
91
- UpdatePublisher update_publisher = 108 ;
92
- AddFeed add_feed = 109 ;
93
- UpdateFeed update_feed = 110 ;
87
+ RemoveGovernanceSource remove_governance_source = 104 ;
88
+ SetShardName set_shard_name = 105 ;
89
+ SetShardGroup set_shard_group = 106 ;
90
+ ResetLastSequenceNo reset_last_sequence_no = 107 ;
91
+ AddPublisher add_publisher = 108 ;
92
+ UpdatePublisher update_publisher = 109 ;
93
+ RemovePublisher remove_publisher = 110 ;
94
+ AddFeed add_feed = 111 ;
95
+ UpdateFeed update_feed = 112 ;
96
+ RemoveFeed remove_feed = 113 ;
94
97
}
95
98
}
96
99
@@ -100,21 +103,33 @@ message Permissions {
100
103
enum ShardAction {
101
104
// Required by protobuf. Instruction will be rejected if this value is encountered.
102
105
SHARD_ACTION_UNSPECIFIED = 0 ;
106
+ // All operations, including operations added in the future.
107
+ ALL_ACTIONS = 1 ;
103
108
CREATE_SHARD = 101 ;
104
109
ADD_GOVERNANCE_SOURCE = 102 ;
110
+ // All operations under `UpdateGovernanceSource`,
111
+ // including operations added in the future.
105
112
UPDATE_GOVERNANCE_SOURCE = 103 ;
106
- SET_SHARD_NAME = 104 ;
107
- SET_SHARD_GROUP = 105 ;
108
- RESET_LAST_SEQUENCE_NO = 106 ;
109
- ADD_PUBLISHER = 107 ;
110
- ADD_FEED = 109 ;
113
+ REMOVE_GOVERNANCE_SOURCE = 104 ;
114
+ SET_SHARD_NAME = 105 ;
115
+ SET_SHARD_GROUP = 106 ;
116
+ RESET_LAST_SEQUENCE_NO = 107 ;
117
+ ADD_PUBLISHER = 108 ;
118
+ // All operations under `UpdatePublisher`,
119
+ // including operations added in the future.
120
+ UPDATE_PUBLISHER = 109 ;
121
+ REMOVE_PUBLISHER = 110 ;
122
+ ADD_FEED = 111 ;
123
+ // All operations under `UpdateFeed`,
124
+ // including operations added in the future.
125
+ UPDATE_FEED = 112 ;
126
+ REMOVE_FEED = 113 ;
111
127
}
112
128
113
129
enum UpdateGovernanceSourceAction {
114
130
// Required by protobuf. Instruction will be rejected if this value is encountered.
115
131
UPDATE_GOVERNANCE_SOURCE_ACTION_UNSPECIFIED = 0 ;
116
132
SET_GOVERNANCE_SOURCE_PERMISSIONS = 101 ;
117
- REMOVE_GOVERNANCE_SOURCE = 199 ;
118
133
}
119
134
120
135
enum UpdatePublisherAction {
@@ -125,7 +140,6 @@ message Permissions {
125
140
REMOVE_PUBLISHER_PUBLIC_KEYS = 103 ;
126
141
SET_PUBLISHER_PUBLIC_KEYS = 104 ;
127
142
SET_PUBLISHER_ACTIVE = 105 ;
128
- REMOVE_PUBLISHER = 199 ;
129
143
}
130
144
131
145
enum UpdateFeedAction {
@@ -135,24 +149,12 @@ message Permissions {
135
149
UPDATE_FEED_METADATA = 102 ;
136
150
ENABLE_FEED_IN_SHARD = 103 ;
137
151
DISABLE_FEED_IN_SHARD = 104 ;
138
- REMOVE_FEED = 199 ;
139
152
}
140
153
141
- // All operations, including operations added in the future.
142
- optional bool all_actions = 1 ;
143
- repeated ShardAction shard_actions = 2 ;
144
- // All operations under `UpdateGovernanceSource` (update and delete),
145
- // including operations added in the future.
146
- optional bool all_update_governance_source_actions = 3 ;
147
- repeated UpdateGovernanceSourceAction update_governance_source_actions = 4 ;
148
- // All operations under `UpdatePublisher` (update and delete),
149
- // including operations added in the future.
150
- optional bool all_update_publisher_action = 5 ;
151
- repeated UpdatePublisherAction update_publisher_actions = 6 ;
152
- // All operations under `UpdateFeed` (update and delete),
153
- // including operations added in the future.
154
- optional bool all_update_feed_actions = 7 ;
155
- repeated UpdateFeedAction update_feed_actions = 8 ;
154
+ repeated ShardAction actions = 1 ;
155
+ repeated UpdateGovernanceSourceAction update_governance_source_actions = 2 ;
156
+ repeated UpdatePublisherAction update_publisher_actions = 3 ;
157
+ repeated UpdateFeedAction update_feed_actions = 4 ;
156
158
}
157
159
158
160
// Specifies the way governance transactions are signed and verified.
@@ -183,8 +185,8 @@ message GovernanceSource {
183
185
// to allow horizontal scaling when the number of feeds grows. Feeds can be divided into subsets
184
186
// and each subset will be assigned to a shard.
185
187
//
186
- // Shard name will be determined by the value of `GovernanceDirective .filter`.
187
- // This action will be rejected unless `GovernanceDirective .filter` specified a single shard.
188
+ // Shard name will be determined by the value of `GovernanceInstructionItem .filter`.
189
+ // This action will be rejected unless `GovernanceInstructionItem .filter` specified a single shard.
188
190
// Shard name must be unique across all shards in all groups.
189
191
// (Warning: it's not possible to enforce this rule within a shard!)
190
192
message CreateShard {
@@ -215,10 +217,6 @@ message UpdateGovernanceSource {
215
217
// Note: when adding a new variant here, update `Permissions` as well.
216
218
oneof action {
217
219
SetGovernanceSourcePermissions set_governance_source_permissions = 101 ;
218
- // Removes a governance source. Note that the last sequence number associated with this source
219
- // will be retained in the state to prevent repeated execution of instructions in case
220
- // the same source is re-added later.
221
- google.protobuf.Empty remove_governance_source = 199 ;
222
220
}
223
221
}
224
222
@@ -227,15 +225,24 @@ message SetGovernanceSourcePermissions {
227
225
optional Permissions permissions = 1 ;
228
226
}
229
227
230
- // Set shard name. This action will be rejected if `GovernanceDirective.shard_names` is empty or contains
228
+ // Removes a governance source. Note that the last sequence number associated with this source
229
+ // will be retained in the state to prevent repeated execution of instructions in case
230
+ // the same source is re-added later.
231
+ message RemoveGovernanceSource {
232
+ // [required] Governance source that should be deleted. Rejects if there is no such source.
233
+ // Rejects if the specified source is the same as the source of the current instruction.
234
+ optional GovernanceSource source = 1 ;
235
+ }
236
+
237
+ // Set shard name. This action will be rejected if `GovernanceInstructionItem.shard_names` is empty or contains
231
238
// more than one item.
232
239
message SetShardName {
233
240
// [required] New shard name. Must be unique across all shards in all groups.
234
241
// (Warning: it's not possible to enforce this rule within a shard!)
235
242
optional string shard_name = 1 ;
236
243
}
237
244
238
- // Set shard group. This action will be rejected if `GovernanceDirective .shard_names` is empty or contains
245
+ // Set shard group. This action will be rejected if `GovernanceInstructionItem .shard_names` is empty or contains
239
246
// more than one item.
240
247
message SetShardGroup {
241
248
// [required] Group name, e.g. "production", "staging", "testing", etc.
@@ -273,10 +280,14 @@ message UpdatePublisher {
273
280
RemovePublisherPublicKeys remove_publisher_public_keys = 103 ;
274
281
SetPublisherPublicKeys set_publisher_public_keys = 104 ;
275
282
SetPublisherActive set_publisher_active = 105 ;
276
- google.protobuf.Empty remove_publisher = 199 ;
277
283
}
278
284
}
279
285
286
+ message RemovePublisher {
287
+ // [required] ID of the publisher that is being deleted. Rejects if there is no such publisher.
288
+ optional uint32 publisher_id = 1 ;
289
+ }
290
+
280
291
message SetPublisherName {
281
292
// [required] New name.
282
293
optional string name = 1 ;
@@ -343,10 +354,14 @@ message UpdateFeed {
343
354
UpdateFeedMetadata update_feed_metadata = 102 ;
344
355
EnableFeedInShard enable_feed_in_shard = 103 ;
345
356
DisableFeedInShard disable_feed_in_shard = 104 ;
346
- google.protobuf.Empty remove_feed = 199 ;
347
357
}
348
358
}
349
359
360
+ message RemoveFeed {
361
+ // [required] ID of the feed that is being removed. Rejects if there is no such feed.
362
+ optional uint32 feed_id = 1 ;
363
+ }
364
+
350
365
// Update a feed's properties. The feed will be updated with values present in each field.
351
366
// If a value is not supplied, the corresponding property will remain unchanged.
352
367
// Refer to `Feed` message fields documentation.
@@ -386,8 +401,8 @@ message UpdateFeedMetadata {
386
401
// moved between shards, use `enable_in_shard_timestamp` and `disable_in_shard_timestamp`
387
402
// to disable it in the old shard and enable it in the new shard at the same time.
388
403
message EnableFeedInShard {
389
- // [optional] If provided, the feed will be enabled at the specified timestamp.
390
- // If `enable_in_shard_timestamp` is already passed or if it's unset ,
404
+ // [required] The feed will be enabled at the specified timestamp.
405
+ // If `enable_in_shard_timestamp` is already passed,
391
406
// the feed will be enabled immediately when this
392
407
// governance instruction is processed.
393
408
optional google.protobuf.Timestamp enable_in_shard_timestamp = 1 ;
@@ -398,8 +413,8 @@ message EnableFeedInShard {
398
413
// when this governance instruction is processed.
399
414
// See also: `EnableFeedInShard` docs.
400
415
message DisableFeedInShard {
401
- // [optional] If provided, the feed will be disabled at the specified timestamp.
402
- // If `disable_in_shard_timestamp` is already passed or if it's unset ,
416
+ // [required] The feed will be disabled at the specified timestamp.
417
+ // If `disable_in_shard_timestamp` is already passed,
403
418
// the feed will be disabled immediately when this
404
419
// governance instruction is processed.
405
420
optional google.protobuf.Timestamp disable_in_shard_timestamp = 1 ;
0 commit comments