18352 Commits

Author SHA1 Message Date
Elle Mouton
c9e57c2539
graph/db: populate the graph cache in Start instead of during construction
In this commit, we move the graph cache population logic out of the
ChannelGraph constructor and into its Start method instead.
2025-03-03 08:48:18 +02:00
Elle Mouton
fb4ec92fc4
multi: add Start and Stop methods for ChannelGraph
We do this in preparation for moving channel cache population logic out
of the constructor and into the Start method. We also will later on
(when topology subscription is moved to the ChannelGraph), have a
goroutine that will need to be kicked off and stopped.
2025-03-03 08:48:18 +02:00
Elle Mouton
7d17e5f3c0
graph/db: completely remove cache from KVStore 2025-03-03 08:48:18 +02:00
Elle Mouton
7454c15491
graph/db: move cache write for UpdateEdgePolicy
To the ChannelGraph.
2025-03-03 08:48:18 +02:00
Elle Mouton
44c4c19fb8
graph/db: move cache write for MarkEdgeZombie
From the KVStore to the ChannelGraph.
2025-03-03 08:48:17 +02:00
Elle Mouton
c4294b2662
graph/db: move FilterKnownChanIDs zombie logic up one layer
Here, we move the business logic in FilterKnownChanIDs from the CRUD
layer to the ChannelGraph layer. We also add a test for the logic.
2025-03-03 08:48:17 +02:00
Elle Mouton
b3f75fb4e0
graph/db: move cache writes for Prune methods
This commit moves the cache writes for PruneGraphNodes and PruneGraph
from the KVStore to the ChannelGraph.
2025-03-03 08:48:17 +02:00
Elle Mouton
39964ce6e1
graph/db: move cache update out of pruneGraphNodes
In preparation for moving the cache write completely out of KVStore, we
move the cache write up one layer.
2025-03-03 08:48:17 +02:00
Elle Mouton
28dd4e0f67
graph/db: move some cache writes to ChannelGraph.
Here we move the cache writes for DisconnectBlockAtHeight and
DeleteChannelEdges to the ChannelGraph.
2025-03-03 08:48:17 +02:00
Elle Mouton
1788668889
graph/db: refactor delChannelEdgeUnsafe to return edge info
And update cache outside the method rather. This will make it easier to
completely move the cache write out to the ChannelGraph layer.
2025-03-03 08:48:17 +02:00
Elle Mouton
54208bcdc7
graph/db: move various cache write calls to ChannelGraph
Here, we move the graph cache writes for AddLightningNode,
DeleteLightningNode, AddChannelEdge and MarkEdgeLive to the
ChannelGraph. Since these are writes, the cache is only updated if the
DB write is successful.
2025-03-03 08:48:17 +02:00
Elle Mouton
138e846879
graph/db: move cache read checks to ChannelGraph.
This commit moves the graph cache checks for FetchNodeFeatures,
ForEachNodeDirectedChannel, GraphSession and ForEachNodeCached from the
KVStore to the ChannelGraph. Since the ChannelGraph is currently just a
pass-through for any of the KVStore methods, all that needs to be done
for calls to go via the ChannelGraph instead directly to the KVStore is
for the ChannelGraph to go and implement those methods.
2025-03-03 08:48:17 +02:00
Elle Mouton
ac107ab365
graph/db: let ChannelGraph init the graphCache
In this commit, we let the ChannelGraph be responsible for populating
the graphCache and then passing it to the KVStore. This is a first step
in moving the graphCache completely out of the KVStore layer.
2025-03-03 08:48:17 +02:00
Elle Mouton
c95e753909
multi: add ChannelGraph Config struct
And use this struct to pass NewChannelGraph anything it needs to be able
to init the KVStore that it houses. This will allow us to add
ChannelGraph specific options.
2025-03-03 08:48:17 +02:00
Elle Mouton
cc3ded8838
graph/db: rename Options to KVStoreOptions
Namespace these options so that we can introduce separate options for
the new ChannelGraph.
2025-03-03 08:48:16 +02:00
Elle Mouton
311a14a0b6
graph/db: fix linter issues of old code
Since we have renamed a file housing some very old code, the linter has
now run on all this code for the first time. So we gotta do some
clean-up work here to make it happy.
2025-03-03 08:48:16 +02:00
Elle Mouton
a058774965
graph/db: rename ChannelGraph and introduce the new ChannelGraph layer
In this commit, we rename the existing ChannelGraph struct to KVStore to
better reflect its responsibilities as the CRUD layer. We then introduce
a new ChannelGraph struct which will eventually be the layer above the
CRUD layer in which we will handle cacheing and topology subscriptions.
For now, however, it houses only the KVStore. This means that all calls
to the KVStore will now go through this layer of indirection first. This
will allow us to slowly move the graph Cache management out of the
KVStore and into the new ChannelGraph layer.

We introduce the new ChannelGraph and rename the old one in the same
commit so that all existing call-sites don't need to change at all :)
2025-03-03 08:48:16 +02:00
Elle Mouton
c0389f2cdb
graph/db: rename graph.go file
Rename it to kv_store.go so that we can re-use the graph.go file name
later on. We will use it to house the _new_ ChannelGraph when the
existing ChannelGraph is renamed to more clearly reflect its
responsibilities as the CRUD layer.
2025-03-03 08:48:16 +02:00
Olaoluwa Osuntokun
f744a5477f
Merge pull request #9565 from guggero/bot-typo-fix-spam
GitHub+docs: no longer accept typo fixes to fight PR spam
2025-02-28 16:18:17 -08:00
Oliver Gugger
f1182e4338
Merge pull request #9521 from guggero/coverage-fixes
unit: remove GOACC, use Go 1.20 native coverage functionality
2025-02-28 09:54:12 -06:00
Oliver Gugger
7761e37522
GitHub: remove generated files from coverage 2025-02-28 14:55:34 +01:00
Oliver Gugger
124137e31a
GitHub+make: debug failing test, use official coveralls action 2025-02-28 14:55:34 +01:00
Oliver Gugger
576da75a07
multi: remove unneeded env variables
With Go 1.23 we don't need to set any of these variables anymore, as
they're the default values now.
2025-02-28 14:55:34 +01:00
Oliver Gugger
70ac201cb8
make+tools: remove goacc, use Go 1.20 builtin functionality
Starting with Go 1.20 the -coverprofile flag does the same that GOACC
did before.
2025-02-28 14:55:33 +01:00
Oliver Gugger
dc0ba72271
Merge pull request #9566 from yyforyongyu/improve-itest
lntest+itest: change the method signature of `AssertPaymentStatus`
2025-02-28 07:52:49 -06:00
Oliver Gugger
a78f9f6c0a
GitHub+docs: no longer accept typo fixes to fight PR spam 2025-02-28 13:02:49 +01:00
yyforyongyu
2d5a2ce78a
lntest+itest: change the method signature of AssertPaymentStatus
So this can be used in other tests when we only care about the payment
hash.
2025-02-28 19:07:38 +08:00
Oliver Gugger
dfd43c972c
Merge pull request #9519 from fuyangpengqi/master
refactor: use a more straightforward return value
2025-02-28 04:41:18 -06:00
fuyangpengqi
150f72414a refactor: use a more straightforward return value
Signed-off-by: fuyangpengqi <995764973@qq.com>
2025-02-28 17:09:56 +08:00
Oliver Gugger
8532955b35
Merge pull request #9540 from ellemouton/backwardsCompat
scripts+make+GH: Add simple backwards compatibility test to the CI
2025-02-27 05:05:03 -06:00
Elle Mouton
b3133b99d4
docs: add release note entry 2025-02-27 11:33:15 +02:00
Elle Mouton
343bdff26b
make+gh: add make helper and GH action
Add a makefile helper to run the neww backwards compatability test and
then add a new GH actions job to call it.
2025-02-27 11:33:15 +02:00
Elle Mouton
f0d4ea10a2
scripts/bw-compatibility-test: add backwards compat test
In this commit, a new backwards compatibility test is added. See the
added README.md file in this commit for all the info.
2025-02-27 11:33:15 +02:00
Oliver Gugger
e3d9fcb5ac
Merge pull request #9549 from yyforyongyu/fix-bitcond-test
Fix unit test flake `TestHistoricalConfDetailsTxIndex`
2025-02-26 07:23:30 -06:00
yyforyongyu
cfa4341740
routing: fix flake in TestFilteredChainView/bitcoind_polling 2025-02-26 19:51:53 +08:00
yyforyongyu
56fa3aae34
routing/chainview: refactor TestFilteredChainView
So each test has its own miner and chainView.
2025-02-26 19:51:53 +08:00
yyforyongyu
4bfcfea2ee
lntest+chainntnfs: make sure bitcoind node is synced
This commit makes sure the bitcoind node is synced to the miner when
initialized and returned from `NewBitcoindBackend`.
2025-02-26 19:51:52 +08:00
yyforyongyu
99d49dec6a
multi: change NewBitcoindBackend to take a miner as its param
Prepares for the following commit where we assert the chain backend is
synced to the miner.
2025-02-26 19:51:52 +08:00
yyforyongyu
c725ba9f25
docs: update release notes re flake fix 2025-02-26 19:51:52 +08:00
yyforyongyu
1618d2c789
chainntnfs+lntest: fix sync to miner block flake
In this commit we document an unexpected behavior found when connecting
a bitcoind node to a btcd node. We mitigate this in our test by
reconnecting the nodes when the connection is broken. We also limit the
connection made from `bitcoind` to be v1 only.
2025-02-26 19:51:52 +08:00
yyforyongyu
175301628f
lntest/unittest: make sure miner is connected to bitcoind
We change how the `bitcoind` node connects to the miner by creating a
temp RPC client and use it to connect to the miner. In addition we also
assert the connection is made.
2025-02-25 21:11:26 +08:00
yyforyongyu
245ea85894
lntest/unittest: assert bitcoind is shut down
Make sure the shutdown of `bitcoind` is finished without any errors.
2025-02-25 21:11:25 +08:00
yyforyongyu
7666d62a43
lntest/unittest: update config for miner and bitcoind
The config used for the miner is updated to skip banning and debug. For
bitcoind, the config is updated to use a unique port for P2P conn.
2025-02-25 21:10:40 +08:00
yyforyongyu
fa8527af09
Makefile+scripts: add unit test flake hunter
This commit adds a script to hunt flakes for a specific unit test with
trace logs. Also rename the make commands to make them more clear on
whether it's a unit test, itest, or paralleled itest.
2025-02-25 21:10:40 +08:00
Oliver Gugger
5d3680a6f6
Merge pull request #9484 from Abdulkbk/refactor-makedir
lnutils: add CreateDir util function
2025-02-25 01:00:45 -06:00
Oliver Gugger
b8c5e85821
Merge pull request #8900 from guggero/go-cc
Makefile: add GOCC variable
2025-02-25 00:59:14 -06:00
Yong
fca9fae2d8
Merge pull request #9433 from hieblmi/estimate-route-fee-fix
routerrpc: fix estimateroutefee for public route hints
2025-02-25 13:58:43 +08:00
Slyghtning
f867954a68
docs: update release notes 2025-02-24 09:56:24 +01:00
Slyghtning
6399d77c18
routerrpc: fix estimateroutefee for public route hints 2025-02-24 09:56:22 +01:00
Oliver Gugger
ad021a290d
Makefile: add GOCC variable 2025-02-23 09:48:54 +01:00