Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(server): Drop transactions outside of the metrics time range #1663

Merged
merged 6 commits into from
Dec 2, 2022

Conversation

jan-auer
Copy link
Member

@jan-auer jan-auer commented Dec 2, 2022

Relay used to accept transactions back-dated up to 30 days into the
past, but transaction metrics are restricted to 5 days, a restriction
which our storage relies on. With this PR, metric extraction now
validates the transaction timestamps and does not extract metrics if the
timestamp is outside the allowed range for metrics.

Additionally, Relay also needs to drop the transaction event for
consistency between metrics and events. Otherwise, a transaction may be
indexed that is not included in the "total" metrics dataset. This would
lead to inconsistency between the datasets and violate an invariant that
metrics contain a superset of indexed transactions.

Ref #1630

@jan-auer jan-auer self-assigned this Dec 2, 2022
@jan-auer jan-auer marked this pull request as ready for review December 2, 2022 12:55
@jan-auer jan-auer requested a review from a team December 2, 2022 12:55
@jan-auer jan-auer changed the title fix(server): Drop transactions outside of the metrics timerange fix(server): Drop transactions outside of the metrics time range Dec 2, 2022
Copy link
Contributor

@olksdr olksdr left a comment

Choose a reason for hiding this comment

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

lgtm!

relay-server/src/metrics_extraction/transactions.rs Outdated Show resolved Hide resolved
Co-authored-by: Oleksandr <1931331+olksdr@users.noreply.github.com>
@jan-auer jan-auer enabled auto-merge (squash) December 2, 2022 14:52
@jan-auer jan-auer merged commit 619d3b8 into master Dec 2, 2022
@jan-auer jan-auer deleted the fix/metrics-extraction-timestamps branch December 2, 2022 15:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants