A global vector keeps track of involved codebases. New items can be added by patches, by repeating a 3-line comment.
Refactor user-agent handling to be more extensible #6385
pull luke-jr wants to merge 1 commits into bitcoin:master from luke-jr:ver changing 6 files +65 −26-
luke-jr commented at 6:02 AM on July 7, 2015: member
-
8342b30619
Refactor user-agent handling to be more extensible
A global vector keeps track of involved codebases. New items can be added by patches, by repeating a 3-line comment.
-
luke-jr commented at 6:02 AM on July 7, 2015: member
Inspired by Bitcoin XT and @petertodd's "Satoshi RBF" merely renaming the base codebase rather than appending on to the end or adding comments.
-
jgarzik commented at 6:48 AM on July 7, 2015: contributor
Personally I would only do half of this: Create the FormatUserAgent() wrapper. Then drop the rest.
That way forks have a very easy way to change the UA - change one modular function - without us having to worrying about a struct with a single use case inside the core code itself.
-
luke-jr commented at 6:56 AM on July 7, 2015: member
Oh, and I forgot the original reason I started doing this: so the alert code can be compared to each codebase component individually. Eg, an alert targeting Satoshi 0.10.2 ought to be picked up by minor forks by default, without having to make a special alert for each variant.
- luke-jr closed this on Jul 7, 2015
- luke-jr reopened this on Jul 7, 2015
-
jgarzik commented at 7:00 AM on July 7, 2015: contributor
@luke-jr vUserAgentCodebases is static - this basically adds complexity that is not needed for this codebase.
A less intrusive change centralizing the user version composition makes sense for all codebases, and would be a useful cleanup.
Other codebases can append to the version string without all this complexity, either.
-
luke-jr commented at 9:17 AM on July 9, 2015: member
@laanwj Derived codebases such as my "ljr" forks and (at present) Mike Hearn's Bitcoin XT should be using /Satoshi:x.y.z/Derived:ver/, rather than discarding the hierarchy entirely. Peter Todd's RBF forks should be using a simple comment (since it's just policy). These kinds of modifications are at present unnecessarily complex and conflicting (eg, RBF+ljr+XT don't merge cleanly). Furthermore, alerts currently need to target very specific user-agent strings, so having them split in a logical vector makes it possible (in a "step 2" PR) to match an alert for /Satoshi:x.y.z/ against all derived codebases it affects, rather than need to sign an independent alert for every possible variant.
- laanwj added the label Refactoring on Jul 17, 2015
-
jonasschnelli commented at 11:33 AM on July 24, 2015: contributor
Concept ACK. How would this intersects with #6462?
-
laanwj commented at 3:40 PM on August 20, 2015: member
Needs rebase.
-
jgarzik commented at 1:27 PM on September 16, 2015: contributor
I would love to see just the FormatUserAgent() transformation in a 1st commit. That seems immediately mergeable. Still unconvinced about the overall change -- the default is static always in master, and users who need this are likely knowledgeable enough to accomplish the same thing more easily.
Usually FLOSS source code bases of all stripes simply create a single "version_extra" metavariable and leave it blank, always, in master. Then downstream projects patch version_extra. That analogy seems applicable here.
No need for additional machinery.
-
laanwj commented at 11:44 AM on September 24, 2015: member
I agree again with @jgarzik. Let's just make the extra version easy to patch, but the extra machinery around it doesn't seem worth the extra complexity just to avoid a trivial merge conflict.
As for alerts, if the alert system in its current form survives at all it's not going to be used for anything that fine-grained, just network-wide alerts. Specific software can have its own mechanisms (this has been discussed in various other issues).
-
laanwj commented at 12:03 PM on September 24, 2015: member
Closing this for now.
- laanwj closed this on Sep 24, 2015
- MarcoFalke locked this on Sep 8, 2021