lightninglabs / lightninglabs/faraday

accounting: time-based balance snapshots

Open
#44 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement feature request
Dominant language
Go
Stars
130
Forks
35
Avg merge
7h 54m
Merged PRs (30d)
5

Description

During the recent call with several `lnd` users, the notion of being able to obtain a balance "snapshot" at any period of time came up. I think the use case here is going back and looking at the historical flow of funds within a channel.

FWIW, this is already available in `lnd` as is, since we store the entire "revocation" chain. However this isn't indexed by "time" and instead uses an auto-incrementing sequence number of each new channel state. The only notion of time for the revocation chain is the absolute expiation heights on any HTLCs possibly present on the commitment transaction.

Alternatively, this can be done by polling `lnd` periodically, or having `faraday` use the streaming balance RPCs to update its own local state.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how lnd stores the revocation chain and how faraday could consume the streaming balance RPCs. Clarify whether snapshots should be indexed by time or maintained as local state, and define the historical balance and fund-flow behavior that would count as complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.