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

channeldb: node channels cache [poc] #5631

Closed
wants to merge 1 commit into from

Conversation

joostjager
Copy link
Contributor

Rough outline that shows how in-memory pathfinding could be implemented by extending the existing graph channel cache.

@@ -14,6 +18,8 @@ func newChannelCache(n int) *channelCache {
return &channelCache{
n: n,
channels: make(map[uint64]ChannelEdge),

nodeChannels: make(map[route.Vertex][]ChannelEdge),
Copy link
Member

Choose a reason for hiding this comment

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

If the chan edge is a pointer, then it can just point into the entry in the channels map so things don't need to be allocated+stored twice for each channel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I that thought also crossed my mind. It does make things more complicated, so left it out for this PoC. For a first version in production, redundant storage could be an acceptable option. The cache size is limited anyway.

@guggero
Copy link
Collaborator

guggero commented Aug 19, 2021

Superseded by #5642. Thanks for the PoC!

@guggero guggero closed this Aug 19, 2021
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.

3 participants