rapid-gossip-sync-server
2 days agoCorrect v2 symlink paths main
Matt Corallo [Wed, 29 May 2024 14:54:57 +0000 (14:54 +0000)]
Correct v2 symlink paths

2 days agoMerge pull request #76 from arik-so/arik/2024/02/node-gossip
Matt Corallo [Wed, 29 May 2024 13:50:46 +0000 (06:50 -0700)]
Merge pull request #76 from arik-so/arik/2024/02/node-gossip

RGS v2: NodeAnnouncement Delta Serialization

2 days agoStore v1 and v2 snapshots.
Arik Sosman [Wed, 15 May 2024 21:56:08 +0000 (14:56 -0700)]
Store v1 and v2 snapshots.

2 days agoVersion-aware serialization of node features and addresses in delta.
Arik Sosman [Mon, 20 May 2024 06:02:39 +0000 (23:02 -0700)]
Version-aware serialization of node features and addresses in delta.

9 days agoIntroduce method for comparing node announcements.
Arik Sosman [Thu, 25 Apr 2024 05:18:10 +0000 (22:18 -0700)]
Introduce method for comparing node announcements.

11 days agoTrack db schema version 14.
Arik Sosman [Wed, 15 May 2024 19:45:04 +0000 (12:45 -0700)]
Track db schema version 14.

11 days agoTest NodeAnnouncement persistence.
Arik Sosman [Thu, 28 Mar 2024 06:48:08 +0000 (23:48 -0700)]
Test NodeAnnouncement persistence.

2 weeks agoMerge pull request #79 from arik-so/persist-node-data
Matt Corallo [Wed, 15 May 2024 19:04:09 +0000 (12:04 -0700)]
Merge pull request #79 from arik-so/persist-node-data

Persist NodeAnnouncement Gossip

2 weeks agoTest storing node addresses.
Arik Sosman [Thu, 28 Mar 2024 06:57:19 +0000 (23:57 -0700)]
Test storing node addresses.

2 weeks agoTest NodeAnnouncement persistence.
Arik Sosman [Thu, 28 Mar 2024 06:48:08 +0000 (23:48 -0700)]
Test NodeAnnouncement persistence.

2 weeks agoStore serialized addresses and features.
Arik Sosman [Wed, 15 May 2024 16:10:08 +0000 (09:10 -0700)]
Store serialized addresses and features.

2 weeks agoUpdate rust-lightning version.
Arik Sosman [Thu, 28 Mar 2024 06:45:05 +0000 (23:45 -0700)]
Update rust-lightning version.

2 weeks agoUpdate schema for node announcement and address storage.
Arik Sosman [Thu, 28 Mar 2024 06:28:41 +0000 (23:28 -0700)]
Update schema for node announcement and address storage.

2 weeks agoMerge pull request #78 from arik-so/conservative-announcements
Matt Corallo [Mon, 13 May 2024 21:14:50 +0000 (14:14 -0700)]
Merge pull request #78 from arik-so/conservative-announcements

Only consider channel announcements with bidirectional updates.

2 weeks agoOnly consider channel announcements with bidirectional updates.
Arik Sosman [Fri, 10 May 2024 23:42:20 +0000 (16:42 -0700)]
Only consider channel announcements with bidirectional updates.

2 weeks agoMerge pull request #77 from arik-so/static-channel-reminders
Matt Corallo [Fri, 10 May 2024 20:07:16 +0000 (13:07 -0700)]
Merge pull request #77 from arik-so/static-channel-reminders

Send reminders for non-mutating channels

3 weeks agoIncrease reminder snapshot scope interval threshold.
Arik Sosman [Fri, 10 May 2024 16:41:30 +0000 (09:41 -0700)]
Increase reminder snapshot scope interval threshold.

3 weeks agoUse reference timestamp for reminder calculation.
Arik Sosman [Fri, 10 May 2024 01:55:54 +0000 (18:55 -0700)]
Use reference timestamp for reminder calculation.

3 weeks agoAllow passing a timestamp override to snapshot calculation.
Arik Sosman [Fri, 10 May 2024 01:40:37 +0000 (18:40 -0700)]
Allow passing a timestamp override to snapshot calculation.

3 weeks agoMake reminder inclusion more conservative.
Arik Sosman [Thu, 9 May 2024 23:18:10 +0000 (16:18 -0700)]
Make reminder inclusion more conservative.

3 weeks agoUpdate test to reflect new reminder mechanics.
Arik Sosman [Thu, 9 May 2024 06:58:52 +0000 (23:58 -0700)]
Update test to reflect new reminder mechanics.

3 weeks agoDetect beginning of static channel status streaks.
Arik Sosman [Thu, 9 May 2024 06:58:29 +0000 (23:58 -0700)]
Detect beginning of static channel status streaks.

Previously, whenever a channel hasn't received updates in
6+ days, we would automatically send incremental reminders
that only contain the update flags.

However, if a channel has been received updates
within that six-day-timeframe, but all those updates were
identical, it would result in no updates being added to the
snapshot because the mutation set ended up empty and that
data would get purged from the serialization.

In order to avoid the reminder logic being duped by
channels simply being consistent, we now look up the
beginning of the latest continuous stretch of non-mutating
channel updates. If a channel's details have not been
altered in more than six days, we now send reminders no
matter the frequency with which channel updates have been
received since.

3 weeks agoTest that channels with non-changing updates result in missing reminders.
Arik Sosman [Wed, 8 May 2024 08:37:23 +0000 (01:37 -0700)]
Test that channels with non-changing updates result in missing reminders.

3 weeks agoDon't panic while panicking.
Arik Sosman [Wed, 24 Apr 2024 23:51:57 +0000 (16:51 -0700)]
Don't panic while panicking.

3 weeks agoStop tracking Cargo.lock
Arik Sosman [Wed, 8 May 2024 08:03:46 +0000 (01:03 -0700)]
Stop tracking Cargo.lock

2 months agoMerge pull request #74 from TheBlueMatt/main
Arik [Sun, 24 Mar 2024 01:01:04 +0000 (18:01 -0700)]
Merge pull request #74 from TheBlueMatt/main

Bump LDK to 0.0.121/rust-bitcoin 0.30

2 months agoFix unused `Result` in tests
Matt Corallo [Sat, 23 Mar 2024 21:24:38 +0000 (21:24 +0000)]
Fix unused `Result` in tests

2 months agoFix indentation in `test_ln_peers`
Matt Corallo [Sat, 23 Mar 2024 21:24:29 +0000 (21:24 +0000)]
Fix indentation in `test_ln_peers`

2 months agoBump LDK to 0.0.121/rust-bitcoin 0.30, bumping MSRV to 1.63
Matt Corallo [Wed, 13 Mar 2024 14:28:26 +0000 (14:28 +0000)]
Bump LDK to 0.0.121/rust-bitcoin 0.30, bumping MSRV to 1.63

Co-authored-by: Arik Sosman <git@arik.io>
2 months agoMerge pull request #73 from arik-so/arik/2024-03-tokio-runtime-split
Matt Corallo [Fri, 22 Mar 2024 22:44:41 +0000 (22:44 +0000)]
Merge pull request #73 from arik-so/arik/2024-03-tokio-runtime-split

Use separate Tokio runtime for gossip persistence.

2 months agoSimplify client creation.
Arik Sosman [Thu, 21 Mar 2024 00:41:34 +0000 (17:41 -0700)]
Simplify client creation.

2 months agoUse separate tokio runtime for gossip persistence.
Arik Sosman [Tue, 12 Mar 2024 06:41:27 +0000 (23:41 -0700)]
Use separate tokio runtime for gossip persistence.

2 months agoFix CI compilation in beta environment.
Arik Sosman [Thu, 21 Mar 2024 00:45:18 +0000 (17:45 -0700)]
Fix CI compilation in beta environment.

3 months agoMerge pull request #71 from TheBlueMatt/main
Arik [Tue, 6 Feb 2024 19:42:10 +0000 (11:42 -0800)]
Merge pull request #71 from TheBlueMatt/main

Do DB insertions in parallel

3 months agoMerge pull request #72 from lightningdevkit/arik/2024/01/bitcoin-rest-error
Matt Corallo [Thu, 1 Feb 2024 17:39:10 +0000 (17:39 +0000)]
Merge pull request #72 from lightningdevkit/arik/2024/01/bitcoin-rest-error

Improve bitcoind RPC/Rest error message

4 months agoImprove bitcoind RPC/Rest error message.
Arik Sosman [Tue, 30 Jan 2024 19:27:22 +0000 (11:27 -0800)]
Improve bitcoind RPC/Rest error message.

4 months agoDo DB insertions in parallel
Matt Corallo [Mon, 29 Jan 2024 17:24:32 +0000 (17:24 +0000)]
Do DB insertions in parallel

When inserting new gossip into the DB, we block the LDK peer
handling if we get behind. This is mostly okay, but can cause ping
timeouts and reconnections, which isn't ideal. To limit how often
we should see this, here we move to doing the new gossip insertions
in parallel.

4 months agoMerge pull request #70 from domZippilli/2024/01/load-peers-tolerating-trailing-comma
Matt Corallo [Mon, 29 Jan 2024 17:27:14 +0000 (17:27 +0000)]
Merge pull request #70 from domZippilli/2024/01/load-peers-tolerating-trailing-comma

Ignore trailing commas when parsing peers, and log more on error.

4 months agoIgnore trailing commas when parsing peers, and log more on error.
Dominic Zippilli [Thu, 25 Jan 2024 06:02:54 +0000 (22:02 -0800)]
Ignore trailing commas when parsing peers, and log more on error.

4 months agoMerge pull request #68 from johncantrell97/118
Matt Corallo [Wed, 10 Jan 2024 17:38:14 +0000 (17:38 +0000)]
Merge pull request #68 from johncantrell97/118

bump to ldk 118

5 months agobump to ldk 118
John Cantrell [Tue, 5 Dec 2023 21:42:47 +0000 (16:42 -0500)]
bump to ldk 118

6 months agoMerge pull request #65 from arik-so/announcement-history-tests
Matt Corallo [Sat, 11 Nov 2023 17:27:16 +0000 (17:27 +0000)]
Merge pull request #65 from arik-so/announcement-history-tests

Update-recency-based inclusion logic tests

6 months agoTest announcement inclusion logic.
Arik Sosman [Sat, 4 Nov 2023 04:43:33 +0000 (21:43 -0700)]
Test announcement inclusion logic.

6 months agoInclude old updates when necessary.
Arik Sosman [Sat, 4 Nov 2023 06:05:26 +0000 (23:05 -0700)]
Include old updates when necessary.

When a channel has only recently become bidirectional,
but there has not been a new update in the old direction
since the last sync, the latest update in the old direction
must still be included in full because it is the first time
the full channel is being snapshotted.

6 months agoAllow seen override for announcements.
Arik Sosman [Sat, 4 Nov 2023 03:58:21 +0000 (20:58 -0700)]
Allow seen override for announcements.

7 months agoMerge pull request #63 from arik-so/2023/10/ordering_fix
Matt Corallo [Thu, 19 Oct 2023 19:50:38 +0000 (19:50 +0000)]
Merge pull request #63 from arik-so/2023/10/ordering_fix

Fix update recency issue with expanded test coverage

7 months agoOptimize indices for expired value fix lookup.
Arik Sosman [Thu, 19 Oct 2023 18:52:32 +0000 (11:52 -0700)]
Optimize indices for expired value fix lookup.

7 months agoFix expired value being sent as the latest update.
Arik Sosman [Thu, 19 Oct 2023 18:52:06 +0000 (11:52 -0700)]
Fix expired value being sent as the latest update.

7 months agoReproduce test for expired value being sent as the latest update.
Arik Sosman [Thu, 19 Oct 2023 18:49:27 +0000 (11:49 -0700)]
Reproduce test for expired value being sent as the latest update.

7 months agoCreate snapshot generation test.
Arik Sosman [Wed, 18 Oct 2023 00:37:55 +0000 (17:37 -0700)]
Create snapshot generation test.

7 months agoExtract snapshot generation method.
Arik Sosman [Tue, 17 Oct 2023 20:49:48 +0000 (13:49 -0700)]
Extract snapshot generation method.

7 months agoReplicate Mutiny test scenarios.
Arik Sosman [Mon, 16 Oct 2023 15:27:45 +0000 (08:27 -0700)]
Replicate Mutiny test scenarios.

7 months agoAllow setting custom gossip seen timestamps.
Arik Sosman [Sat, 14 Oct 2023 01:39:27 +0000 (18:39 -0700)]
Allow setting custom gossip seen timestamps.

7 months agoMerge pull request #62 from arik-so/2023/10/ordering_fix
Matt Corallo [Sun, 15 Oct 2023 19:54:49 +0000 (19:54 +0000)]
Merge pull request #62 from arik-so/2023/10/ordering_fix

Create Postgres step in CI.

7 months agoAssert that schema is uninitialized.
Arik Sosman [Sat, 14 Oct 2023 01:01:21 +0000 (18:01 -0700)]
Assert that schema is uninitialized.

7 months agoCreate Postgres step in CI.
Arik Sosman [Fri, 13 Oct 2023 19:54:34 +0000 (12:54 -0700)]
Create Postgres step in CI.

7 months agoMerge pull request #60 from arik-so/2023/08/first_unit_test
Matt Corallo [Thu, 12 Oct 2023 17:35:33 +0000 (17:35 +0000)]
Merge pull request #60 from arik-so/2023/08/first_unit_test

First unit test

7 months agoAssert schema sanitization.
Arik Sosman [Tue, 12 Sep 2023 19:25:09 +0000 (12:25 -0700)]
Assert schema sanitization.

7 months agoUse schema as test logger id.
Arik Sosman [Fri, 8 Sep 2023 17:47:11 +0000 (10:47 -0700)]
Use schema as test logger id.

7 months agoCreate first unit test.
Arik Sosman [Tue, 15 Aug 2023 21:39:12 +0000 (14:39 -0700)]
Create first unit test.

7 months agoUpgrade to LDK 117.
Arik Sosman [Tue, 15 Aug 2023 21:38:46 +0000 (14:38 -0700)]
Upgrade to LDK 117.

8 months agoCreate TestLogger.
Arik Sosman [Tue, 15 Aug 2023 21:38:17 +0000 (14:38 -0700)]
Create TestLogger.

8 months agoCreate test-aware db env vars.
Arik Sosman [Tue, 15 Aug 2023 21:37:25 +0000 (14:37 -0700)]
Create test-aware db env vars.

8 months agoMerge pull request #56 from arik-so/2023/08/connect-to-peers-asynchronously
Matt Corallo [Wed, 6 Sep 2023 23:51:06 +0000 (23:51 +0000)]
Merge pull request #56 from arik-so/2023/08/connect-to-peers-asynchronously

Track gossip data prior to peer connection loop.

8 months agoAlways wait 10 seconds prior to attempting reconnection.
Arik Sosman [Wed, 6 Sep 2023 23:26:59 +0000 (16:26 -0700)]
Always wait 10 seconds prior to attempting reconnection.

8 months agoDon't special-case initial connection attempt.
Arik Sosman [Wed, 6 Sep 2023 04:28:15 +0000 (21:28 -0700)]
Don't special-case initial connection attempt.

8 months agoConnect peers independently.
Arik Sosman [Mon, 28 Aug 2023 21:40:35 +0000 (14:40 -0700)]
Connect peers independently.

Previously, we wouldn't start monitoring the gossip data until all
intended peers had either failed or succeeded to connect.

Instead, we're now spawn each peer connection independently, and only
await the first 5 successful peer connections.

8 months agoMerge pull request #57 from arik-so/2023/08/old-incremental-update-fix
Matt Corallo [Wed, 6 Sep 2023 22:16:26 +0000 (22:16 +0000)]
Merge pull request #57 from arik-so/2023/08/old-incremental-update-fix

Send full updates after old last seen updates.

8 months agoSend full updates after old last seen updates.
Arik Sosman [Tue, 29 Aug 2023 01:01:03 +0000 (18:01 -0700)]
Send full updates after old last seen updates.

Previously, whenever we saw that there was a previous update that a
client would have seen, we simply calculated the delta set based on
which properties have changed, and would most likely send an
incremental update set (excepting the case of a new or newly sent
announcement, in which case all sent updates are full).

However, if the last seen update was old, and there's a chance that
a user may have run RGS since, it is possible that due to the
7-day-backdating-mechanism included on the client, the reference
update would no longer be present.

To fix that, anytime we see that a last seen update is more than six
days old, we automatically include a full update.

8 months agoMerge pull request #59 from arik-so/2023/08/custom-intervals
Matt Corallo [Sat, 2 Sep 2023 16:27:08 +0000 (16:27 +0000)]
Merge pull request #59 from arik-so/2023/08/custom-intervals

Distinction between snapshot and symlink intervals

8 months agoDynamically adjust snapshot scopes.
Arik Sosman [Fri, 1 Sep 2023 21:42:40 +0000 (14:42 -0700)]
Dynamically adjust snapshot scopes.

Previously, we had hard-coded factors for the default snapshot
generation interval, which also served as the minimum snapshot
scope. In this commit, we substitute that with a doubling
mechanism that stops once it reaches or exceeds the
21-day-mark, which can be configured using an additional flag.

8 months agoDistinguish between snapshot and symlink intervals.
Arik Sosman [Thu, 31 Aug 2023 22:59:32 +0000 (15:59 -0700)]
Distinguish between snapshot and symlink intervals.

Snapshots may be generated every day or even every couple days,
but symlinks will be generated at the given symlink granularity.

To avoid gcd complications, all snapshot generation intervals
must be multiples of the symlink granularity interval.

9 months agoAllow the snapshot interval to be configurable in the environment variables
Graham Krizek [Thu, 6 Jul 2023 05:31:24 +0000 (00:31 -0500)]
Allow the snapshot interval to be configurable in the environment variables

9 months agoMerge pull request #55 from arik-so/2023/08/multiplication-overflow-fix
Matt Corallo [Mon, 28 Aug 2023 21:20:51 +0000 (21:20 +0000)]
Merge pull request #55 from arik-so/2023/08/multiplication-overflow-fix

Fix multiplication overflow bug

9 months agoFix multiplication overflow bug.
Arik Sosman [Mon, 28 Aug 2023 16:07:19 +0000 (09:07 -0700)]
Fix multiplication overflow bug.

The `snapshot_sync_day_factors` array is sorted
ascendingly, so find() will return on the first
iteration that is at least equal to the requested
interval.

However, the last value in the array is u64::max,
which means that multiplying it with DAY_SECONDS
will overflow. To avoid that, we use saturating_mul.

9 months agoMerge pull request #54 from arik-so/2023/08/incremental-update-fix
Matt Corallo [Thu, 17 Aug 2023 20:55:48 +0000 (20:55 +0000)]
Merge pull request #54 from arik-so/2023/08/incremental-update-fix

Only send full updates with announcements

9 months agoCreate indices for schema version 12.
Arik Sosman [Thu, 17 Aug 2023 20:14:18 +0000 (13:14 -0700)]
Create indices for schema version 12.

9 months agoCreate method for obtaining UTC-prepared Postgres client.
Arik Sosman [Thu, 17 Aug 2023 04:35:55 +0000 (21:35 -0700)]
Create method for obtaining UTC-prepared Postgres client.

9 months agoSend full updates whenever the channel announcement is sent.
Arik Sosman [Thu, 17 Aug 2023 04:50:43 +0000 (21:50 -0700)]
Send full updates whenever the channel announcement is sent.

9 months agoFix ordering of intermediate commits to ensure the latest comes first and is used...
Arik Sosman [Thu, 17 Aug 2023 03:55:51 +0000 (20:55 -0700)]
Fix ordering of intermediate commits to ensure the latest comes first and is used as the authoritative source of what's latest.

9 months agoMerge pull request #53 from arik-so/2023/08/query-timestamp-fix
Matt Corallo [Thu, 17 Aug 2023 00:16:14 +0000 (00:16 +0000)]
Merge pull request #53 from arik-so/2023/08/query-timestamp-fix

Switch timestamp queries to use f64

9 months agoSwitch timestamp reads to use i64.
Arik Sosman [Thu, 17 Aug 2023 00:04:06 +0000 (17:04 -0700)]
Switch timestamp reads to use i64.

9 months agoSwitch timestamp queries to use f64.
Arik Sosman [Wed, 16 Aug 2023 23:18:40 +0000 (16:18 -0700)]
Switch timestamp queries to use f64.

9 months agoMerge pull request #49 from TheBlueMatt/main
Matt Corallo [Sun, 13 Aug 2023 16:37:54 +0000 (16:37 +0000)]
Merge pull request #49 from TheBlueMatt/main

9 months agoMake snapshotter a bit more amenable to changes in interval
Matt Corallo [Sun, 16 Jul 2023 20:41:28 +0000 (20:41 +0000)]
Make snapshotter a bit more amenable to changes in interval

By separating the concept of "seconds in a day" from the snapshot
interval.

9 months agoOnly generate as many symlinks as we need (rather than 27 years worth)
Matt Corallo [Sun, 16 Jul 2023 20:41:00 +0000 (20:41 +0000)]
Only generate as many symlinks as we need (rather than 27 years worth)

9 months agoMerge pull request #51 from arik-so/2023/08/pre_test_refactors
Matt Corallo [Sun, 13 Aug 2023 05:30:42 +0000 (05:30 +0000)]
Merge pull request #51 from arik-so/2023/08/pre_test_refactors

Allow arbitrary logger types.

9 months agoAllow log threshold configuration.
Arik Sosman [Fri, 4 Aug 2023 21:30:02 +0000 (14:30 -0700)]
Allow log threshold configuration.

9 months agoRemove println from verifier.rs
Arik Sosman [Thu, 3 Aug 2023 01:34:01 +0000 (18:34 -0700)]
Remove println from verifier.rs

9 months agoRemove println from tracking.rs
Arik Sosman [Thu, 3 Aug 2023 01:26:55 +0000 (18:26 -0700)]
Remove println from tracking.rs

9 months agoRemove println from snapshot.rs
Arik Sosman [Thu, 3 Aug 2023 01:21:29 +0000 (18:21 -0700)]
Remove println from snapshot.rs

9 months agoRemove println from persistence.rs
Arik Sosman [Thu, 3 Aug 2023 01:19:13 +0000 (18:19 -0700)]
Remove println from persistence.rs

9 months agoRemove println from lookup.rs
Arik Sosman [Thu, 3 Aug 2023 01:16:24 +0000 (18:16 -0700)]
Remove println from lookup.rs

9 months agoRemove println from lib.rs
Arik Sosman [Thu, 3 Aug 2023 01:11:06 +0000 (18:11 -0700)]
Remove println from lib.rs

9 months agoSwitch Logger from Arc to Deref.
Arik Sosman [Wed, 2 Aug 2023 23:00:36 +0000 (16:00 -0700)]
Switch Logger from Arc to Deref.

9 months agoAllow custom logger types.
Arik Sosman [Wed, 2 Aug 2023 22:41:14 +0000 (15:41 -0700)]
Allow custom logger types.

9 months agoUpgrade to 116 release.
Arik Sosman [Wed, 2 Aug 2023 21:33:05 +0000 (14:33 -0700)]
Upgrade to 116 release.

10 months agoMerge pull request #48 from TheBlueMatt/2023-07-further-opt
Arik [Sun, 16 Jul 2023 17:36:13 +0000 (10:36 -0700)]
Merge pull request #48 from TheBlueMatt/2023-07-further-opt

Further optimize intermediate row fetching

10 months agoCorrect upgrade logic to ignore missing indexes 2023-07-further-opt
Matt Corallo [Sun, 16 Jul 2023 17:25:10 +0000 (17:25 +0000)]
Correct upgrade logic to ignore missing indexes

If we upgrade multiple versions in one go, the indexes we're trying
to drop may not exist, and that shouldn't cause us to fail to
upgrade.

10 months agoDrop overly optimistic index
Matt Corallo [Sun, 16 Jul 2023 17:20:56 +0000 (17:20 +0000)]
Drop overly optimistic index

The `channel_updates_id_with_scid_dir_blob` index allows the
intermediate-row-fetching logic to be index-only, but there's very
little reason to do so - we now use subqueries to build the exact
set of rows we want, by id, and then fetch various colums. Having
an index that lets us look up those columns without hitting the
regular table is fine, but there's not a ton of cost to hitting the
table by primary key and maintaining yet another index isn't free.