Skip to content

Conversation

skeees
Copy link
Contributor

@skeees skeees commented Jun 7, 2018

This depends on #12934 and #13407: review those first

As a follow up to #12934 which introduces some armature code to make message passing based communication a bit easier and moves ProcessNewBlock into its own thread, this does similar for AcceptToMemoryPool() in p2p

If this approach seems reasonable, I think logical next steps are (in forthcoming prs) to try to reduce dependency on cs_main in p2p so that the benefits of this parallelism can be better realized

@skeees skeees force-pushed the mempool-async branch 2 times, most recently from a0e87b1 to 0154564 Compare June 7, 2018 16:03
@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 7, 2018

Note to reviewers: This pull request conflicts with the following ones:

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.

@DrahtBot
Copy link
Contributor

Needs rebase

skeees added 13 commits June 19, 2018 15:56
Create separate functions to handle responses when a transaction
received from a peer is accepted or rejected.

This commit introduces one behavior change:
   Currently, if -promiscuousmempool is set (only allowed on regtest
   and testnet), it is possible for AcceptToMemoryPool() to return
   true, but for the CValidationState() to contain DoS points if the
   transaction failed validation with policy standard script flags
   but then passed with promiscuous flags. This will cause you to ban
   the peer who sent the transaction. This commit fixes this behavior
   by reseting the validation state in that one situation.
@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 7, 2018

Needs rebase

sipa added a commit that referenced this pull request Jul 14, 2018
3339ba2 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02 [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs #12934 #13413 #13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082

// resubmit it so that it gets a chance to get to the right thread
// when resubmitting, do not block and do not care about failures
// theres a potential deadlock where we try to push this to a queue thats
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo found by codespell: theres (should be “there is”)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: “thats” should be “that is”


T ret;

// use a temporary so theres no side effecting code inside an assert which could be disabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here: “theres” should be “there is”

@maflcko
Copy link
Member

maflcko commented Dec 3, 2018

There hasn't been much activity lately and the patch still needs rebase, so I am closing this for now. Please let me know when you want to continue working on this, so the pull request can be re-opened.

@maflcko maflcko closed this Dec 3, 2018
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Apr 15, 2020
3339ba2 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02 [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs bitcoin#12934 bitcoin#13413 bitcoin#13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/init.cpp
#	src/net_processing.cpp
#	src/net_processing.h
#	src/test/test_dash.cpp
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Apr 16, 2020
3339ba2 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02 [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs bitcoin#12934 bitcoin#13413 bitcoin#13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/init.cpp
#	src/net_processing.cpp
#	src/net_processing.h
#	src/test/test_dash.cpp
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Apr 16, 2020
3339ba2 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02 [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs bitcoin#12934 bitcoin#13413 bitcoin#13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/init.cpp
#	src/net_processing.cpp
#	src/net_processing.h
#	src/test/test_dash.cpp
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Apr 19, 2020
3339ba2 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02 [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs bitcoin#12934 bitcoin#13413 bitcoin#13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/init.cpp
#	src/net_processing.cpp
#	src/net_processing.h
#	src/test/test_dash.cpp
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request May 10, 2020
3339ba2 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02 [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs bitcoin#12934 bitcoin#13413 bitcoin#13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/init.cpp
#	src/net_processing.cpp
#	src/net_processing.h
#	src/test/test_dash.cpp
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request May 12, 2020
3339ba2 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02 [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs bitcoin#12934 bitcoin#13413 bitcoin#13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/init.cpp
#	src/net_processing.cpp
#	src/net_processing.h
#	src/test/test_dash.cpp
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 9, 2020
3339ba2 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02 [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs bitcoin#12934 bitcoin#13413 bitcoin#13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/init.cpp
#	src/net_processing.cpp
#	src/net_processing.h
#	src/test/test_dash.cpp
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 9, 2020
3339ba2 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02 [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs bitcoin#12934 bitcoin#13413 bitcoin#13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/init.cpp
#	src/net_processing.cpp
#	src/net_processing.h
#	src/test/test_dash.cpp
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 10, 2020
3339ba2 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02 [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs bitcoin#12934 bitcoin#13413 bitcoin#13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/init.cpp
#	src/net_processing.cpp
#	src/net_processing.h
#	src/test/test_dash.cpp
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 11, 2020
3339ba2 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02 [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs bitcoin#12934 bitcoin#13413 bitcoin#13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/init.cpp
#	src/net_processing.cpp
#	src/net_processing.h
#	src/test/test_dash.cpp
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants