-
Notifications
You must be signed in to change notification settings - Fork 2.2k
multi: rename experimental endorsement signal to accountable #10367
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
multi: rename experimental endorsement signal to accountable #10367
Conversation
Summary of ChangesHello @elnosh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a comprehensive renaming of the experimental Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly renames the experimental endorsement feature to accountable to align with the latest bLIP-4 proposal. The changes are applied consistently across the entire codebase, including configuration options, feature flags, internal logic, and tests. I've also noted the removal of the time-based experiment logic for this feature, which is a correct interpretation of the updated proposal. The code quality is high, and I have no further comments. The changes look good to merge.
carlaKC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bringing this up to date!
Linter is unhappy in a few places because renames push over the 80 char limit, and needs an entry in release notes, otherwise LGTM!
| SetNodeAnn: {}, // N | ||
| }, | ||
| lnwire.ExperimentalEndorsementOptional: { | ||
| lnwire.ExperimentalAccountabilityOptional: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: one mention of endorsement left in comment.
rpcserver.go
Outdated
| return clock.NewDefaultClock().Now().Before( | ||
| AccountabilityExperimentEnd, | ||
| ) | ||
| return !s.cfg.ProtocolOptions.NoExperimentalAccountability() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linter unhappy: perhaps NoExpAccountability to shorten line
19f31ec to
73d1e41
Compare
carlaKC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK, tested sending + relaying of zero value signal.
|
Approved the CI run. |
Roasbeef
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 💎
htlcswitch/link.go
Outdated
| // experimentalEndorsement returns the value to set for our outgoing | ||
| // experimental endorsement field, and a boolean indicating whether it should | ||
| // experimentalAccountability returns the value to set for our outgoing | ||
| // experimental accountable field, and a boolean indicating whether it should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment is outdated, it does not return a boolean ?
| // experimental accountable field, and a boolean indicating whether it should | ||
| // be populated on the outgoing htlc. | ||
| func (l *channelLink) experimentalEndorsement( | ||
| func (l *channelLink) experimentalAccountability( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we ok that basically this check resets the whole CustomRecord froward TLV in case no Accuntability bit is set? Probably not a problem now since it is not used for anything but I think this should be more fine granular in the future ? This seems to remove the old customRecord data and replaces it with the single lnwire.ExperimentalUnaccountable value can you verifiy @gemini-code-assist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've accurately identified a potential issue, @ziggie1984. The current implementation of processRemoteAdds (in htlcswitch/link.go, specifically around lines 3194-3199 and 3252-3255) indeed overwrites the entire outgoingAdd.CustomRecords map with only the ExperimentalAccountableType TLV if experimentalAccountability returns a value (which it does if forwarding is enabled, even if the incoming HTLC didn't have the accountability bit set or had an invalid one).
This means any other custom records present in the incoming HTLC would be lost when forwarding. To prevent this, the outgoingAdd.CustomRecords should be initialized with a copy of the incoming add.CustomRecords before adding or updating the ExperimentalAccountableType.
You can use the record.CustomSet.Copy() method to create a mutable copy of the existing custom records. The corrected logic would look something like this:
For lines 3194-3199:
accountableValue.WhenSome(func(e byte) {
// Create a mutable copy of the incoming custom records.
custRecords := add.CustomRecords.Copy()
custRecords[accountableType] = []byte{e}
outgoingAdd.CustomRecords = custRecords
})And similarly for lines 3252-3255:
accountableValue.WhenSome(func(e byte) {
// Create a mutable copy of the incoming custom records.
custRecords := add.CustomRecords.Copy()
custRecords[accountableType] = []byte{e}
addMsg.CustomRecords = custRecords
})This ensures that only the ExperimentalAccountableType is modified or added, while preserving any other custom records.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you clarify? I'm not seeing the custom records passed to experimentalAccountability reset if the accountability bit is not set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so currently I think we do not forward any customRecords so it is fine but look at the code, as soon as this option has a value:
Line 3166 in 801de79
| endorseValue := l.experimentalEndorsement( |
we would replace the complete custome records and in the above function we do not merge any custom records we just set the Endorse or Unendorse Bit:
Line 3199 in 801de79
| outgoingAdd.CustomRecords = custRecords |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I was referring to when it is set, we would overwrite all values which were there in the first place and set only the endorseBit/unendorse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, ok. As you said, seems fine given that at that point the outgoingAdd.CustomRecords is nil since outgoingAdd was set just up above in
Line 3187 in 801de79
| outgoingAdd := &lnwire.UpdateAddHTLC{ |
CustomRecords not set. But lmk if you'd want me to change it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you maybe add in the experimentalEndorsement func comment that this only considers the endorsement bit, and any other custom records present will not be forwarded ?
Can you also rebase!
|
@elnosh, remember to re-request review from reviewers when ready |
4d43f53 to
28b234b
Compare
server.go
Outdated
| // | ||
| // Per blip04: January 1, 2026 12:00:00 AM UTC in unix seconds. | ||
| EndorsementExperimentEnd = time.Unix(1767225600, 0) | ||
| AccountabilityExperimentEnd = time.Unix(1767225600, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there plans to remove the experiment from the code, we are now renaming things and the experiment is actually over so is it really worth it comes to my mind. What are the plans there ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we can just remove this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the plans there ?
The acinq node is collecting data including this signal, and LDK is going to start actively setting the signal so ideally we'd continue to relay these values so we can start fine-tuning parameters for the BOLT PR. Assuming that we're heading in a direction that this proposal is going to be adopted, I think it's reasonable to just deprecate the experimental signal when the BOLT PR is in?
|
@elnosh the linter is still failing |
ziggie1984
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (pending linter fix)
Renames the endorsement signal to accountable to match the latest proposal lightning/blips#67
In the previous iteration with endorsement signaling, the recommendation was for the sender to set it to 1 and that could have had privacy concerns when first deploying given that the default was to downgrade the signal to 0. In the latest proposal the recommended default for both sending and forwarding nodes is to set `accountable` to 0. As a result, the dates have been removed given that there are no privacy risks associated with relaying the signal with zero values.
28b234b to
6f49bea
Compare
This PR renames bLIP4's experimental
endorsementsignal toaccountableto match the latest proposal in lightning/blips#67