@@ -5,11 +5,12 @@ import "google/protobuf/duration.proto";
55import "google/protobuf/empty.proto" ;
66
77import "dynamic_value.proto" ;
8+ import "state.proto" ;
89
910// If any field documented as `[required]` is not present in the instruction,
1011// the instruction will be rejected.
1112
12- package pyth_lazer_transaction ;
13+ package pyth_lazer ;
1314
1415// Representation of a complete governance instruction. This value will be signed
1516// by a governance source.
@@ -130,9 +131,10 @@ message Permissions {
130131 enum UpdateFeedAction {
131132 // Required by protobuf. Instruction will be rejected if this value is encountered.
132133 UPDATE_FEED_ACTION_UNSPECIFIED = 0 ;
133- UPDATE_FEED_METADATA = 101 ;
134- ACTIVATE_FEED = 102 ;
135- DEACTIVATE_FEED = 103 ;
134+ UPDATE_FEED_PROPERTIES = 101 ;
135+ UPDATE_FEED_METADATA = 102 ;
136+ ENABLE_FEED_IN_SHARD = 103 ;
137+ DISABLE_FEED_IN_SHARD = 104 ;
136138 REMOVE_FEED = 199 ;
137139 }
138140
@@ -302,17 +304,33 @@ message SetPublisherActive {
302304 optional bool is_active = 1 ;
303305}
304306
305- // Feed is inactive when added, meaning that it will be available to publishers but not to consumers .
307+ // Add a new feed. Refer to `Feed` message fields documentation .
306308message AddFeed {
307- // [required] ID of the feed. Must be unique (within the shard).
309+ // [required]
308310 optional uint32 feed_id = 1 ;
309- // [required] Feed metadata. Some properties are required (name, exponent, etc.).
310- // Known properties must have the expected type.
311- // Additional arbitrary properties are allowed.
312- // (TODO: document known metadata properties)
313- optional DynamicValue.Map metadata = 2 ;
314- // IDs of publishers enabled for this feed.
315- repeated uint32 permissioned_publishers = 3 ;
311+ // [required]
312+ optional DynamicValue.Map metadata = 3 ;
313+ // [required]
314+ optional string name = 101 ;
315+ // [required]
316+ optional sint32 exponent = 102 ;
317+ // [required]
318+ optional uint32 min_publishers = 103 ;
319+ // [required]
320+ optional google.protobuf.Duration min_rate = 104 ;
321+ // [required]
322+ optional google.protobuf.Duration expiry_time = 105 ;
323+ // [required]
324+ optional string market_schedule = 106 ;
325+ // [required]
326+ optional FeedState state = 107 ;
327+ // [required]
328+ optional FeedKind kind = 108 ;
329+ // [required]
330+ optional bool is_enabled_in_shard = 201 ;
331+
332+ // TODO: IDs of publishers enabled for this feed.
333+ // repeated uint32 permissioned_publishers = 3;
316334}
317335
318336message UpdateFeed {
@@ -321,43 +339,68 @@ message UpdateFeed {
321339 // [required]
322340 // Note: when adding a new variant here, update `Permissions` as well.
323341 oneof action {
324- UpdateFeedMetadata update_feed_metadata = 101 ;
325- ActivateFeed activate_feed = 102 ;
326- DeactivateFeed deactivate_feed = 103 ;
342+ UpdateFeedProperties update_feed_properties = 101 ;
343+ UpdateFeedMetadata update_feed_metadata = 102 ;
344+ EnableFeedInShard enable_feed_in_shard = 103 ;
345+ DisableFeedInShard disable_feed_in_shard = 104 ;
327346 google.protobuf.Empty remove_feed = 199 ;
328347 }
329348}
330349
350+ // Update a feed's properties. The feed will be updated with values present in each field.
351+ // If a value is not supplied, the corresponding property will remain unchanged.
352+ // Refer to `Feed` message fields documentation.
353+ message UpdateFeedProperties {
354+ // [optional]
355+ optional DynamicValue.Map metadata = 3 ;
356+ // [optional]
357+ optional string name = 101 ;
358+ // [optional]
359+ optional sint32 exponent = 102 ;
360+ // [optional]
361+ optional uint32 min_publishers = 103 ;
362+ // [optional]
363+ optional google.protobuf.Duration min_rate = 104 ;
364+ // [optional]
365+ optional google.protobuf.Duration expiry_time = 105 ;
366+ // [optional]
367+ optional string market_schedule = 106 ;
368+ // [optional]
369+ optional FeedState state = 107 ;
370+ // [optional]
371+ optional bool is_enabled_in_shard = 201 ;
372+ }
373+
331374message UpdateFeedMetadata {
332375 // [required] Property name.
333376 optional string name = 1 ;
334377 // [optional] Property value. If unset, the property will be removed.
335378 optional DynamicValue value = 2 ;
336379}
337380
338- // Set the feed as active or shedule an activation .
339- // If there was already a pending activation or deactivation , it will be cleared
381+ // Set the feed as enabled in this shard or shedule it for a certain timestamp .
382+ // If there was already a pending status change , it will be cleared
340383// when this governance instruction is processed.
341- // Warning: there must never be two feeds with the same name active at the same time
384+ // Warning: there must never be two feeds with the same name enabled at the same time
342385// within a shard group. This cannot be enforced within a shard. When a feed needs to be
343- // moved between shards, use `activation_timestamp ` and `deactivation_timestamp `
344- // to deactivate it in the old shard and activate it in the new shard at the same time.
345- message ActivateFeed {
346- // [optional] If provided, the feed will activate at the specified timestamp.
347- // If `activation_timestamp ` is already passed or if it's unset,
348- // the feed will be activated immediately when this
386+ // moved between shards, use `enable_in_shard_timestamp ` and `disable_in_shard_timestamp `
387+ // to disable it in the old shard and enable it in the new shard at the same time.
388+ 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,
391+ // the feed will be enabled immediately when this
349392 // governance instruction is processed.
350- optional google.protobuf.Timestamp activation_timestamp = 1 ;
393+ optional google.protobuf.Timestamp enable_in_shard_timestamp = 1 ;
351394}
352395
353- // Set the feed as inactive or shedule a deactivation .
354- // If there was already a pending activation or deactivation , it will be cleared
396+ // Set the feed as disabled in this shard or shedule it for a certain timestamp .
397+ // If there was already a pending status change , it will be cleared
355398// when this governance instruction is processed.
356- // See also: `ActivateFeed ` docs.
357- message DeactivateFeed {
358- // [optional] If provided, the feed will deactivate at the specified timestamp.
359- // If `deactivation_timestamp ` is already passed or if it's unset,
360- // the feed will be deactivated immediately when this
399+ // See also: `EnableFeedInShard ` docs.
400+ 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,
403+ // the feed will be disabled immediately when this
361404 // governance instruction is processed.
362- optional google.protobuf.Timestamp deactivation_timestamp = 1 ;
405+ optional google.protobuf.Timestamp disable_in_shard_timestamp = 1 ;
363406}
0 commit comments