rpc: Serialize in getblock without cs_main #15932

pull MarcoFalke wants to merge 3 commits into bitcoin:master from MarcoFalke:1905-rpcBlockNoLock changing 2 files +33 −15
  1. MarcoFalke commented at 4:23 PM on May 1, 2019: member

    No need to hold cs_main when serializing a struct to json

    Fixes: #15925

  2. rpc: Use IsValidNumArgs in getblock fa1c3591ad
  3. fanquake added the label RPC/REST/ZMQ on May 1, 2019
  4. rpc: Serialize in getblock without cs_main fab00a5cb9
  5. MarcoFalke force-pushed on May 1, 2019
  6. jnewbery commented at 1:50 PM on May 2, 2019: member

    Does it make sense to add an AssertLockNotHeld(cs_main) to those functions?

  7. promag commented at 2:10 PM on May 2, 2019: member

    For reference #12153 (comment).

    Concept ACK.

    Does it make sense to add an AssertLockNotHeld(cs_main) to those functions?

    Maybe EXCLUDES annotation instead?

  8. laanwj commented at 2:20 PM on May 2, 2019: member

    Concept ACK. The whole point of moving the lock of cs_main inside the individual RPC functions was to allow optimizations such as this.

  9. rpc: Add lock annotations to block{,header}ToJSON faea56400d
  10. MarcoFalke commented at 6:33 PM on May 2, 2019: member

    Added lock annotations as requested by @promag and @jnewbery

  11. DrahtBot commented at 6:45 PM on May 2, 2019: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #14802 (rpc: faster getblockstats using BlockUndo data by FelixWeis)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  12. jnewbery commented at 7:00 PM on May 2, 2019: member

    utACK faea56400d5578023133cf4d1c761cdeb0c3e3da

  13. promag cross-referenced this on May 2, 2019 from issue getblock performance issue on verbosity by fanatid
  14. fanatid commented at 5:27 AM on May 3, 2019: contributor

    Why not use ENTER_CRITICAL_SECTION & LEAVE_CRITICAL_SECTION instead LOCK?

  15. promag commented at 6:20 AM on May 3, 2019: member

    Because a scoped lock is more clear and "secure".

  16. jonasschnelli commented at 6:48 AM on May 3, 2019: contributor

    utACK faea56400d5578023133cf4d1c761cdeb0c3e3da

  17. MarcoFalke merged this on May 3, 2019
  18. MarcoFalke closed this on May 3, 2019

  19. MarcoFalke referenced this in commit 94daebf327 on May 3, 2019
  20. MarcoFalke deleted the branch on May 3, 2019
  21. sidhujag referenced this in commit ce64be77f2 on May 3, 2019
  22. IntegralTeam cross-referenced this on May 13, 2019 from issue rpc: Serialize in getblock without cs_main by IntegralTeam
  23. IntegralTeam cross-referenced this on May 14, 2019 from issue rpc: Serialize in getblock without cs_main by IntegralTeam
  24. IntegralTeam cross-referenced this on May 15, 2019 from issue rpc: Serialize in getblock without cs_main by IntegralTeam
  25. IntegralTeam cross-referenced this on May 15, 2019 from issue rpc: Serialize in getblock without cs_main by IntegralTeam
  26. IntegralTeam cross-referenced this on May 16, 2019 from issue rpc: Serialize in getblock without cs_main by IntegralTeam
  27. IntegralTeam cross-referenced this on May 16, 2019 from issue rpc: Serialize in getblock without cs_main by IntegralTeam
  28. IntegralTeam cross-referenced this on May 17, 2019 from issue rpc: Serialize in getblock without cs_main by IntegralTeam
  29. IntegralTeam cross-referenced this on May 20, 2019 from issue rpc: Serialize in getblock without cs_main by IntegralTeam
  30. IntegralTeam cross-referenced this on May 22, 2019 from issue [WIP] rpc: Serialize in getblock without cs_main by IntegralTeam
  31. in src/rpc/blockchain.h:14 in faea56400d
      11 | +#include <sync.h>
      12 | +
      13 | +#include <stdint.h>
      14 | +#include <vector>
      15 | +
      16 | +extern RecursiveMutex cs_main;
    


    elichai commented at 11:15 AM on January 7, 2020:

    @MarcoFalke Do you use RecursiveMutex instead of CCriticalSection on purpose?

  32. MarcoFalke cross-referenced this on Jan 7, 2020 from issue scripted-diff: Replace CCriticalSection with RecursiveMutex by MarcoFalke
  33. fanquake referenced this in commit af05bd9e1e on Jan 15, 2020
  34. deadalnix referenced this in commit bb7cea810c on Jun 1, 2020
  35. deadalnix referenced this in commit 6cd4a39874 on Jun 1, 2020
  36. deadalnix referenced this in commit 38c4f1868d on Jun 1, 2020
  37. LarryRuane referenced this in commit 3d1d30d4bc on May 10, 2021
  38. LarryRuane referenced this in commit a99bc82078 on May 10, 2021
  39. LarryRuane cross-referenced this on May 10, 2021 from issue Bitcoin 0.19 locking PRs by LarryRuane
  40. Munkybooty referenced this in commit 1afe02bc6c on Oct 12, 2021
  41. Munkybooty referenced this in commit f6e9396aa8 on Oct 13, 2021
  42. Munkybooty referenced this in commit 3c6c44c938 on Oct 14, 2021
  43. bitcoin locked this on Feb 15, 2022

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-05-20 06:54 UTC