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: member

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

    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. fanatid commented at 5:27 am on May 3, 2019: contributor
    Why not use ENTER_CRITICAL_SECTION & LEAVE_CRITICAL_SECTION instead LOCK?
  14. promag commented at 6:20 am on May 3, 2019: member
    Because a scoped lock is more clear and “secure”.
  15. jonasschnelli commented at 6:48 am on May 3, 2019: contributor
    utACK faea56400d5578023133cf4d1c761cdeb0c3e3da
  16. MarcoFalke merged this on May 3, 2019
  17. MarcoFalke closed this on May 3, 2019

  18. MarcoFalke referenced this in commit 94daebf327 on May 3, 2019
  19. MarcoFalke deleted the branch on May 3, 2019
  20. sidhujag referenced this in commit ce64be77f2 on May 3, 2019
  21. 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?
  22. fanquake referenced this in commit af05bd9e1e on Jan 15, 2020
  23. deadalnix referenced this in commit bb7cea810c on Jun 1, 2020
  24. deadalnix referenced this in commit 6cd4a39874 on Jun 1, 2020
  25. deadalnix referenced this in commit 38c4f1868d on Jun 1, 2020
  26. LarryRuane referenced this in commit 3d1d30d4bc on May 10, 2021
  27. LarryRuane referenced this in commit a99bc82078 on May 10, 2021
  28. Munkybooty referenced this in commit 1afe02bc6c on Oct 12, 2021
  29. Munkybooty referenced this in commit f6e9396aa8 on Oct 13, 2021
  30. Munkybooty referenced this in commit 3c6c44c938 on Oct 14, 2021
  31. DrahtBot 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: 2024-11-23 15:12 UTC

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