Remove gArgs #21005

issue maflcko openend this issue on January 25, 2021
  1. maflcko commented at 6:28 pm on January 25, 2021: member

    The gArgs global should be removed.

    Motivation

    Bitcoin Core has a single gArgs, which is used by all binaries (bitcoind, bitcoin-qt, bench_bitcoin, bitcoin-wallet, …). This is generally fine, because binaries only need to parse arguments for themselves.

    However, for testing purposes in bench_bitcoin, some benchmarks spin up a Bitcoin Core node via the TestingSetup NodeContext. Thus, they will end up with conflicting use of gArgs. This issue is popping up too often for me. For example #18662, #21003, …

    Moreover, test_bitcoin might want to set up and pass around local ArgsManagers without modifying the “main” global gArgs.

    And finally, globals usually come with other issues such as the static initialization fiasco. Getting rid of them will make the code cleaner.

    However, “the GUI already relies on a global QApplication instance, a global event loop, global settings state and probably other global state, so getting rid of gArgs there doesn’t seem to accomplish much.” (See https://github.com/bitcoin-core/gui/pull/75#issuecomment-689675368)

  2. maflcko added the label Feature on Jan 25, 2021
  3. maflcko added the label Refactoring on Jan 25, 2021
  4. maflcko added the label Brainstorming on Jan 25, 2021
  5. maflcko removed the label Feature on Jan 25, 2021
  6. practicalswift commented at 11:07 am on January 26, 2021: contributor
    I don’t know about GUI needs, but for non-GUI needs (including fuzzers): Strong Concept ACK :)
  7. fanquake referenced this in commit a839303edc on Apr 20, 2021
  8. blockstreamsatellite referenced this in commit df3300918d on Oct 28, 2021
  9. blockstreamsatellite referenced this in commit 5f88b92254 on Nov 10, 2021
  10. maflcko referenced this in commit f63bf05e73 on Nov 10, 2021
  11. maflcko referenced this in commit 300124dedf on Jan 4, 2022
  12. maflcko referenced this in commit 98e9d8e8e2 on Mar 24, 2022
  13. maflcko closed this on Mar 10, 2023

  14. vijaydasmp referenced this in commit ea11fc38a9 on Dec 11, 2023
  15. vijaydasmp referenced this in commit f9e8062f8b on Feb 3, 2024
  16. bitcoin locked this on Mar 9, 2024

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: 2024-07-01 10:13 UTC

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