Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support to configure max latency #391

Merged
merged 10 commits into from
Feb 23, 2024
Merged

add support to configure max latency #391

merged 10 commits into from
Feb 23, 2024

Conversation

cctdaniel
Copy link
Contributor

@cctdaniel cctdaniel commented Feb 15, 2024

add configurable max latency in slots between send and receive

for price feeds with more publishers this can be reduced instead of using the default 25 value to reduce latency

@@ -195,8 +195,9 @@ typedef struct pc_price
pc_ema_t twac_; // time-weighted average conf interval
int64_t timestamp_; // unix timestamp of aggregate price
uint8_t min_pub_; // min publishers for valid price
int8_t drv2_; // space for future derived values
int16_t drv3_; // space for future derived values
int8_t message_sent_; // flag to indicate if the current aggregate price has been sent as a message to the message buffer, 0 if not sent, 1 if sent
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by: this was already changed in the rust program previously but wasn't changed here

int8_t drv2_; // space for future derived values
int16_t drv3_; // space for future derived values
int8_t message_sent_; // flag to indicate if the current aggregate price has been sent as a message to the message buffer, 0 if not sent, 1 if sent
uint8_t max_latency_; // configurable max latency in slots between send and receive
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we only need uint8_t for max_latency_ so splitting it to uint8_t and int8_t

@cctdaniel cctdaniel marked this pull request as ready for review February 19, 2024 11:24
@cctdaniel cctdaniel changed the title add initial code to support max latency add code to support max latency Feb 19, 2024
@cctdaniel cctdaniel changed the title add code to support max latency add support to configure max latency Feb 19, 2024
Copy link
Contributor

@ali-bahjati ali-bahjati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I will look again after you addressed the feedbacks (just to be extra careful).

guibescos
guibescos previously approved these changes Feb 20, 2024
guibescos
guibescos previously approved these changes Feb 20, 2024
Copy link
Contributor

@ali-bahjati ali-bahjati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I left some minor comments.

ali-bahjati
ali-bahjati previously approved these changes Feb 21, 2024
Copy link
Contributor

@ali-bahjati ali-bahjati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I left some minor comments.

@cctdaniel cctdaniel merged commit 854c72e into main Feb 23, 2024
3 checks passed
@cctdaniel cctdaniel deleted the max-latency branch February 23, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants