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
  1. luke-jr commented at 6:02 AM on July 7, 2015: member

    A global vector keeps track of involved codebases. New items can be added by patches, by repeating a 3-line comment.

  2. 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.
    8342b30619
  3. 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.

  4. 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.

  5. luke-jr commented at 6:54 AM on July 7, 2015: member

    @jgarzik That doesn't make sense to me. The FormatUserAgent function doesn't do anything except handle the structs... Do you mean UAInitialiser?

  6. 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.

  7. luke-jr closed this on Jul 7, 2015

  8. luke-jr reopened this on Jul 7, 2015

  9. 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.

  10. laanwj commented at 7:28 AM on July 7, 2015: member

    Agree with @jgarzik. I'm not convinced that we need the extra complexity and boilerplate here. What is the use of a vector of involved codebases inside one codebase? You're at most in one codebase at a time.

  11. 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.

  12. laanwj added the label Refactoring on Jul 17, 2015
  13. jonasschnelli commented at 11:33 AM on July 24, 2015: contributor

    Concept ACK. How would this intersects with #6462?

  14. laanwj commented at 3:40 PM on August 20, 2015: member

    Needs rebase.

  15. 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.

  16. 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).

  17. laanwj commented at 12:03 PM on September 24, 2015: member

    Closing this for now.

  18. laanwj closed this on Sep 24, 2015

  19. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me