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

Record begin and end timestamps for relays #2701

Merged
merged 6 commits into from Jun 23, 2023
Merged

Conversation

thomash-acinq
Copy link
Member

For fighting jamming attempts, or even just to detect one, we need to know how fast relayed HTLCs are fulfilled. We now measure this and store it in the audit database. Prevously the "IN" and "OUT" directions for the same HTLC were storing the same timestamp (corresponding to when the HTLC is fulfilled), we now use the timestamp at which we received the UpdateAddHtlc for the "IN" direction.

@codecov-commenter
Copy link

Codecov Report

Merging #2701 (1504f8c) into master (1519dd0) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

❗ Current head 1504f8c differs from pull request most recent head c870277. Consider uploading reports for the commit c870277 to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #2701      +/-   ##
==========================================
- Coverage   85.98%   85.91%   -0.08%     
==========================================
  Files         215      215              
  Lines       17707    17708       +1     
  Branches      759      758       -1     
==========================================
- Hits        15226    15213      -13     
- Misses       2481     2495      +14     
Impacted Files Coverage Δ
...main/scala/fr/acinq/eclair/db/DbEventHandler.scala 93.50% <ø> (ø)
...in/scala/fr/acinq/eclair/channel/ChannelData.scala 100.00% <100.00%> (ø)
...c/main/scala/fr/acinq/eclair/db/pg/PgAuditDb.scala 99.68% <100.00%> (ø)
...cala/fr/acinq/eclair/db/sqlite/SqliteAuditDb.scala 99.66% <100.00%> (ø)
.../scala/fr/acinq/eclair/payment/PaymentEvents.scala 97.77% <100.00%> (+0.05%) ⬆️
.../scala/fr/acinq/eclair/payment/PaymentPacket.scala 90.82% <100.00%> (ø)
...a/fr/acinq/eclair/payment/relay/ChannelRelay.scala 95.68% <100.00%> (ø)
...cala/fr/acinq/eclair/payment/relay/NodeRelay.scala 97.87% <100.00%> (ø)
.../eclair/payment/relay/PostRestartHtlcCleaner.scala 90.17% <100.00%> (ø)

... and 9 files with indirect coverage changes

Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

This will be very useful!

Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me, just a comment on when the metric is updated.

Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@thomash-acinq thomash-acinq merged commit 9db0063 into master Jun 23, 2023
1 check passed
@thomash-acinq thomash-acinq deleted the timestamp-begin branch June 23, 2023 11:00
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