ACINQ / eclair

A scala implementation of the Lightning Network.
Apache License 2.0
1.24k stars 266 forks source link

Record begin and end timestamps for relays #2701

Closed thomash-acinq closed 1 year ago

thomash-acinq commented 1 year ago

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 commented 1 year ago

Codecov Report

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

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

:exclamation: 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%) :arrow_up:
.../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