Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid permanent cs_main lock in getblockheader #12153

Merged
merged 1 commit into from Jan 8, 2019

Conversation

@promag
Copy link
Member

@promag promag commented Jan 11, 2018

This PR reduces the cs_main lock scope in getblockheader RPC.

@promag promag force-pushed the 2018-01-getblockheader branch from 3062a36 to d22e406 Jan 11, 2018
@promag promag force-pushed the 2018-01-getblockheader branch 4 times, most recently from 7bb7175 to 5e924f4 Jan 15, 2018
Copy link
Contributor

@ryanofsky ryanofsky left a comment

utACK last commit only 5e924f4d22a16b0c46d4c6cb19877892331d41fa (previous commits are from base PR)

@jnewbery
Copy link
Member

@jnewbery jnewbery commented Apr 3, 2018

needs rebase (but probably not worth doing until #12151 is merged)

@promag
Copy link
Member Author

@promag promag commented Jan 4, 2019

Rebased.

@bitcoin bitcoin deleted a comment from DrahtBot Jan 4, 2019
@bitcoin bitcoin deleted a comment from DrahtBot Jan 4, 2019
@bitcoin bitcoin deleted a comment from DrahtBot Jan 4, 2019
@bitcoin bitcoin deleted a comment from DrahtBot Jan 4, 2019
src/rpc/blockchain.cpp Outdated Show resolved Hide resolved
@promag promag force-pushed the 2018-01-getblockheader branch from 4572a39 to f12e1d0 Jan 4, 2019
@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Jan 4, 2019

utACK f12e1d0

Copy link
Contributor

@ryanofsky ryanofsky left a comment

utACK f12e1d0. No change since last review other than rebase.

@MarcoFalke MarcoFalke added this to the 0.18.0 milestone Jan 5, 2019
@laanwj
Copy link
Member

@laanwj laanwj commented Jan 7, 2019

So to be clear: this is can be done, because it is safe to access the fields on the CBlockIndex instance without the lock?

@promag
Copy link
Member Author

@promag promag commented Jan 7, 2019

@laanwj to best of my knowledge yes. Looks like nStatus is the only field that needs the lock, which is not used.

@jnewbery
Copy link
Member

@jnewbery jnewbery commented Jan 7, 2019

utACK f12e1d0.

Do you intend to do the same for getblock? Not holding cs_main while reading a block from disk and serializing into json seems like a big win.

@laanwj laanwj merged commit f12e1d0 into bitcoin:master Jan 8, 2019
2 checks passed
laanwj added a commit that referenced this issue Jan 8, 2019
f12e1d0 rpc: Avoid permanent cs_main lock in getblockheader (João Barbosa)

Pull request description:

  This PR reduces the `cs_main` lock scope in `getblockheader` RPC.

Tree-SHA512: bc51f80e15d1b32d3c7886836457f9929706b6aad9841dafce31ffca444281471b21b56192bb50de774184b9377412f815ad8d3d2439049a7e64d2e59c415767
@promag promag deleted the 2018-01-getblockheader branch Jan 8, 2019
@promag
Copy link
Member Author

@promag promag commented Jan 8, 2019

@jnewbery #11913 #13903 are related to that.

LarryRuane added a commit to LarryRuane/zcash that referenced this issue Apr 29, 2021
LarryRuane added a commit to LarryRuane/zcash that referenced this issue Jun 1, 2021
Munkybooty added a commit to Munkybooty/dash that referenced this issue Aug 20, 2021
f12e1d0 rpc: Avoid permanent cs_main lock in getblockheader (João Barbosa)

Pull request description:

  This PR reduces the `cs_main` lock scope in `getblockheader` RPC.

Tree-SHA512: bc51f80e15d1b32d3c7886836457f9929706b6aad9841dafce31ffca444281471b21b56192bb50de774184b9377412f815ad8d3d2439049a7e64d2e59c415767
Munkybooty added a commit to Munkybooty/dash that referenced this issue Aug 20, 2021
f12e1d0 rpc: Avoid permanent cs_main lock in getblockheader (João Barbosa)

Pull request description:

  This PR reduces the `cs_main` lock scope in `getblockheader` RPC.

Tree-SHA512: bc51f80e15d1b32d3c7886836457f9929706b6aad9841dafce31ffca444281471b21b56192bb50de774184b9377412f815ad8d3d2439049a7e64d2e59c415767
Munkybooty added a commit to Munkybooty/dash that referenced this issue Aug 21, 2021
f12e1d0 rpc: Avoid permanent cs_main lock in getblockheader (João Barbosa)

Pull request description:

  This PR reduces the `cs_main` lock scope in `getblockheader` RPC.

Tree-SHA512: bc51f80e15d1b32d3c7886836457f9929706b6aad9841dafce31ffca444281471b21b56192bb50de774184b9377412f815ad8d3d2439049a7e64d2e59c415767
Munkybooty added a commit to Munkybooty/dash that referenced this issue Aug 23, 2021
f12e1d0 rpc: Avoid permanent cs_main lock in getblockheader (João Barbosa)

Pull request description:

  This PR reduces the `cs_main` lock scope in `getblockheader` RPC.

Tree-SHA512: bc51f80e15d1b32d3c7886836457f9929706b6aad9841dafce31ffca444281471b21b56192bb50de774184b9377412f815ad8d3d2439049a7e64d2e59c415767
Munkybooty added a commit to Munkybooty/dash that referenced this issue Aug 24, 2021
f12e1d0 rpc: Avoid permanent cs_main lock in getblockheader (João Barbosa)

Pull request description:

  This PR reduces the `cs_main` lock scope in `getblockheader` RPC.

Tree-SHA512: bc51f80e15d1b32d3c7886836457f9929706b6aad9841dafce31ffca444281471b21b56192bb50de774184b9377412f815ad8d3d2439049a7e64d2e59c415767
Munkybooty added a commit to Munkybooty/dash that referenced this issue Aug 24, 2021
f12e1d0 rpc: Avoid permanent cs_main lock in getblockheader (João Barbosa)

Pull request description:

  This PR reduces the `cs_main` lock scope in `getblockheader` RPC.

Tree-SHA512: bc51f80e15d1b32d3c7886836457f9929706b6aad9841dafce31ffca444281471b21b56192bb50de774184b9377412f815ad8d3d2439049a7e64d2e59c415767
UdjinM6 added a commit to UdjinM6/dash that referenced this issue Aug 24, 2021
f12e1d0 rpc: Avoid permanent cs_main lock in getblockheader (João Barbosa)

Pull request description:

  This PR reduces the `cs_main` lock scope in `getblockheader` RPC.

Tree-SHA512: bc51f80e15d1b32d3c7886836457f9929706b6aad9841dafce31ffca444281471b21b56192bb50de774184b9377412f815ad8d3d2439049a7e64d2e59c415767
Munkybooty added a commit to Munkybooty/dash that referenced this issue Aug 24, 2021
f12e1d0 rpc: Avoid permanent cs_main lock in getblockheader (João Barbosa)

Pull request description:

  This PR reduces the `cs_main` lock scope in `getblockheader` RPC.

Tree-SHA512: bc51f80e15d1b32d3c7886836457f9929706b6aad9841dafce31ffca444281471b21b56192bb50de774184b9377412f815ad8d3d2439049a7e64d2e59c415767
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants