-
Notifications
You must be signed in to change notification settings - Fork 123
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
[feature]: Enhance asset_sum
report to clarify conservation
#1106
Comments
Further detail per debugging with @guggero: "maybe we forgot to not count Context: the output of |
Updated original issue with more context |
asset_sum
report to clarify conservation
@gijswijs Will start task 2 - show balance script key path is true and considering spend flag |
Reopen as more remediation is needed [edit: here] |
I confirmed in the code that we do not accidentally count non-local script keys towards the balance. taproot-assets/tapfreighter/interface.go Lines 199 to 204 in 65539b6
And: taproot-assets/tapdb/assets_store.go Lines 3020 to 3022 in 65539b6
And: taproot-assets/tapdb/assets_store.go Lines 3039 to 3042 in 65539b6
When the asset is a tombstone, from a non-local script key, a burn, or derived by the local wallet or explicitly declared to be known the asset creation in the database is skipped and therefor those assets will not turn up in the balance queries. |
Maybe it is prudent to create a test that checks whether those assets are not created in the database. But maybe that's overkill. @dstadulis ? If the latter, then consider this issue closed, since Task 1 is more of a UX discussion that we decided should be had further down the line (cc: @Roasbeef ) |
Discussed with @Roasbeef |
Since un completed items is UX clarification, will deprio a bit to focus on adding testing lightninglabs/lightning-terminal#867 |
It is now confirmed that L1-balances and custom channel balances are not reported mutually exclusive. The This litd PR depends on this issue being resolved: lightninglabs/lightning-terminal#871 |
I thought about this quite a bit and have come up with the following plan:
So what I think we want is to just always exclude any script keys that are the exact key of We of course wouldn't hard code that in the SQL query but pass it in as an |
Background
Strict, asset-amount conservation checks exists in the tapd VM to prevent undue inflation of asset quantities. However, there may be instances where the daemon reports asset amounts that appear to be double counted, even though they are being properly conserved.
Asset Balance Clarification
To avoid confusion, it is essential to clearly delineate between payment-channel balances and L1-only asset balances. This will ensure that users have a comprehensive understanding of their asset holdings.
Task 1: Ensure Mutual Exclusivity
no overlap or double counting between the two types of balances.
Comprehensive Asset Sum Calculations
To ensure accuracy in asset sum calculations, we need to investigate the comprehensiveness of these calculations.
Task 2: Investigate
asset sum
Calculationasset_sum
report to clarify conservation #1106 (comment)Check if thescript_key_has_script_path": true
flag is being incorrectly included in the asset sum. (Intuition is no)Force Close Scenario
Background
In the scenario where two nodes have a channel
Node 1 force closes
Node 2 (the responder) -- even if it didn't have the channel's entire balance, the node insert the force close transaction, into it's own database
These inserted transaction are added to the database fields that are importing the outputs as well
While these outputs cannot be spent due to the presence of a script path.
But litd/tapd displays these as part of the node's balance today
Solution
make another delineated name space, to track the amounts
in order for thewallet balance commands
toby default not show these balance, by default
Considerations
These values are used during tests to assert certain outcomes have been met
add a flag to enable reporting
in order forassertion tests
tohave the necessary data available to run tests
The text was updated successfully, but these errors were encountered: