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

Skip persisting signed data for data feed with existing timestamp #91

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

Siegrift
Copy link
Collaborator

@Siegrift Siegrift commented Oct 19, 2023

Closes #90

Background

In #34 we changed how signed API accepts data from pusher. In particular, it no longer checks whether the signed data updates the timestamp. This is by design because we may need the older data for delayed endpoints. This also improves throughput, because we don't need to reject full batch when a single signed data fails the check.

Change

Because the pusher does not keep track of what data it sent to particular signed API it can attempt to send the same beacon data multiple times, increasing the storage requirements for signed API.

This change does not persists signed data for a data feed for which we already have a signed data value with the same timestamp. This assumes that the signed data with same timestamp is the same, but even if not - there is no way to pick "the correct one" so we can choose which one to skip.

The benefit of not keeping state in pusher is that it can re-push the data to the signed API in case it is redeployed (and loses all previously pushed data). The alternative to this would be to persist the timestamps of successfully pushed signed datas to avoid pushing them again.

@Siegrift Siegrift requested a review from andreogle October 19, 2023 11:08
@Siegrift Siegrift self-assigned this Oct 19, 2023
@Siegrift Siegrift merged commit 5a118a1 into main Oct 24, 2023
4 checks passed
@Siegrift Siegrift deleted the verify-timestamp branch October 24, 2023 10:05
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.

Investigate pusher sending invalid data
2 participants