Skip to content

Improve Confirm docs #1900

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

Merged

Conversation

tnull
Copy link
Contributor

@tnull tnull commented Dec 5, 2022

Fixes #1188.

We improve the wording of the Confirm docs to improve clarity.

@tnull tnull marked this pull request as draft December 5, 2022 17:02
@tnull
Copy link
Contributor Author

tnull commented Dec 5, 2022

Draft for now, I want to do another pass trying to highlight any pitfalls. Moreover, I'm thinking of adding a usage basic example.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Basically LGTM, any update on un-draft-ing?

/// block.
/// - Dependent transactions within the same block must be given in topological order, possibly in
/// separate calls.
/// - Unconfirmed transactions must be given after the original confirmations and before any
/// reconfirmation.
/// - Reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed in the
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should maybe just rephrase all of this as "everything has to be in topological order"? I guess we want to let someone connect uncorrelated transactions in the same block in any order :/. We at least need to mention that all unconfirms have to happen before any confirmations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tend to disagree: I think we should not resort to terminology such as "topological" that may or may not known to the users and might be ambiguous or unclear to some. Rather, we should try to make things as explicit as possible, even if the description can get redundant at times: redundancy can be a good thing in writing.

The fact that we need to unconfirm all before reconfirming any is one of the reasons why it's still in draft, as I wanted to make sure clarity is improved here. Now pushed a fixup regarding that.

@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2022

Codecov Report

Base: 90.71% // Head: 91.19% // Increases project coverage by +0.48% 🎉

Coverage data is based on head (c2eb743) compared to base (de2acc0).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1900      +/-   ##
==========================================
+ Coverage   90.71%   91.19%   +0.48%     
==========================================
  Files          91       91              
  Lines       48400    54891    +6491     
  Branches    48400    54891    +6491     
==========================================
+ Hits        43905    50060    +6155     
- Misses       4495     4831     +336     
Impacted Files Coverage Δ
lightning/src/chain/mod.rs 68.18% <ø> (ø)
lightning/src/chain/keysinterface.rs 90.45% <0.00%> (-1.20%) ⬇️
lightning/src/util/enforcing_trait_impls.rs 85.71% <0.00%> (-0.47%) ⬇️
lightning/src/ln/onion_utils.rs 94.76% <0.00%> (-0.17%) ⬇️
lightning/src/ln/functional_tests.rs 97.02% <0.00%> (-0.07%) ⬇️
lightning/src/chain/onchaintx.rs 95.27% <0.00%> (-0.03%) ⬇️
lightning/src/util/byte_utils.rs 100.00% <0.00%> (ø)
lightning/src/ln/onion_route_tests.rs 97.74% <0.00%> (+0.25%) ⬆️
lightning/src/ln/reload_tests.rs 96.68% <0.00%> (+1.43%) ⬆️
lightning/src/ln/chan_utils.rs 95.42% <0.00%> (+1.79%) ⬆️
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tnull tnull marked this pull request as ready for review December 8, 2022 11:03
@tnull
Copy link
Contributor Author

tnull commented Dec 8, 2022

Marking this ready-for-review. I think it it would be nice to have a more concrete usage example under https://lightningdevkit.org/blockchain_data/confirmed_transactions/ eventually, though.

Copy link
Contributor

@wpaulino wpaulino left a comment

Choose a reason for hiding this comment

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

LGTM

/// - All unconfirmed transactions must be given consecutively after the original confirmations
/// and before *any* reconfirmations.
/// - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
/// in regard to the new block.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// in regard to the new block.
/// in the new block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mh, likewise I added that to somewhat separate a) the event of a transaction being confirmed in a block on chain and b) us getting notice of that and calling transactions_confirmed. The former is literally happening in the new block, while the latter is happening in regard to the former, no?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess? I dunno it just read funny to me, it doesn't really matter.

@tnull tnull force-pushed the 2022-12-improve-confirm-docs branch from 7089741 to dfe468a Compare December 12, 2022 18:29
@tnull tnull force-pushed the 2022-12-improve-confirm-docs branch from dfe468a to 9de45ce Compare December 12, 2022 20:44
@tnull
Copy link
Contributor Author

tnull commented Dec 12, 2022

Squashed without further changes.

@TheBlueMatt TheBlueMatt merged commit 2cb3467 into lightningdevkit:main Dec 12, 2022
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.

Clarify the ordering and constraints on chain::Confirm
4 participants