@@ -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,31 @@ 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 bool is_enabled_in_shard = 201 ;
329+
330+ // TODO: IDs of publishers enabled for this feed.
331+ // repeated uint32 permissioned_publishers = 3;
316332}
317333
318334message UpdateFeed {
@@ -321,43 +337,68 @@ message UpdateFeed {
321337 // [required]
322338 // Note: when adding a new variant here, update `Permissions` as well.
323339 oneof action {
324- UpdateFeedMetadata update_feed_metadata = 101 ;
325- ActivateFeed activate_feed = 102 ;
326- DeactivateFeed deactivate_feed = 103 ;
340+ UpdateFeedProperties update_feed_properties = 101 ;
341+ UpdateFeedMetadata update_feed_metadata = 102 ;
342+ EnableFeedInShard enable_feed_in_shard = 103 ;
343+ DisableFeedInShard disable_feed_in_shard = 104 ;
327344 google.protobuf.Empty remove_feed = 199 ;
328345 }
329346}
330347
348+ // Update a feed's properties. The feed will be updated with values present in each field.
349+ // If a value is not supplied, the corresponding property will remain unchanged.
350+ // Refer to `Feed` message fields documentation.
351+ message UpdateFeedProperties {
352+ // [optional]
353+ optional DynamicValue.Map metadata = 3 ;
354+ // [optional]
355+ optional string name = 101 ;
356+ // [optional]
357+ optional sint32 exponent = 102 ;
358+ // [optional]
359+ optional uint32 min_publishers = 103 ;
360+ // [optional]
361+ optional google.protobuf.Duration min_rate = 104 ;
362+ // [optional]
363+ optional google.protobuf.Duration expiry_time = 105 ;
364+ // [optional]
365+ optional string market_schedule = 106 ;
366+ // [optional]
367+ optional FeedState state = 107 ;
368+ // [optional]
369+ optional bool is_enabled_in_shard = 201 ;
370+ }
371+
331372message UpdateFeedMetadata {
332373 // [required] Property name.
333374 optional string name = 1 ;
334375 // [optional] Property value. If unset, the property will be removed.
335376 optional DynamicValue value = 2 ;
336377}
337378
338- // Set the feed as active or shedule an activation .
339- // If there was already a pending activation or deactivation , it will be cleared
379+ // Set the feed as enabled in this shard or shedule it for a certain timestamp .
380+ // If there was already a pending status change , it will be cleared
340381// when this governance instruction is processed.
341- // Warning: there must never be two feeds with the same name active at the same time
382+ // Warning: there must never be two feeds with the same name enabled at the same time
342383// 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
384+ // moved between shards, use `enable_in_shard_timestamp ` and `disable_in_shard_timestamp `
385+ // to disable it in the old shard and enable it in the new shard at the same time.
386+ message EnableFeedInShard {
387+ // [optional] If provided, the feed will be enabled at the specified timestamp.
388+ // If `enable_in_shard_timestamp ` is already passed or if it's unset,
389+ // the feed will be enabled immediately when this
349390 // governance instruction is processed.
350- optional google.protobuf.Timestamp activation_timestamp = 1 ;
391+ optional google.protobuf.Timestamp enable_in_shard_timestamp = 1 ;
351392}
352393
353- // Set the feed as inactive or shedule a deactivation .
354- // If there was already a pending activation or deactivation , it will be cleared
394+ // Set the feed as disabled in this shard or shedule it for a certain timestamp .
395+ // If there was already a pending status change , it will be cleared
355396// 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
397+ // See also: `EnableFeedInShard ` docs.
398+ message DisableFeedInShard {
399+ // [optional] If provided, the feed will be disabled at the specified timestamp.
400+ // If `disable_in_shard_timestamp ` is already passed or if it's unset,
401+ // the feed will be disabled immediately when this
361402 // governance instruction is processed.
362- optional google.protobuf.Timestamp deactivation_timestamp = 1 ;
403+ optional google.protobuf.Timestamp disable_in_shard_timestamp = 1 ;
363404}
0 commit comments