Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Jan 24, 2020

To increase modularisation and simplify testing, remove the mempool global from net in favour of a mempool member.

This is done in the same way it was done for the connection manager global.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 24, 2020

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

Conflicts

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.

@Empact
Copy link
Contributor

Empact commented Jan 24, 2020

Concept ACK - my only concern is that this increases the number of cases in which the local and the global form of the variable are shadowing one another. How about doing something like this (in whole or in part) to simplify the call patterns overall while making the member references locally explicit: https://github.com/Empact/bitcoin/tree/2020-01-peer-logic-members

@maflcko
Copy link
Member Author

maflcko commented Jan 25, 2020

my only concern is that this increases the number of cases in which the local and the global form of the variable are shadowing one another

The global will be renamed to g_mempool, so this won't be an issue. See also #17564 (comment)

How about doing something like this (in whole or in part) to simplify the call patterns overall while making the member references locally explicit:

Looks good. But seems to increase the diff and time needed to review, so I'd rather do it as a follow-up.

@maflcko maflcko closed this Jan 25, 2020
@maflcko maflcko reopened this Jan 25, 2020
@practicalswift
Copy link
Contributor

Concept ACK

Reduced use of globals is very welcome from a fuzzing perspective :)

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

ACK fa6ff6e, I think it makes more sense squashed.

@Empact
Copy link
Contributor

Empact commented Jan 30, 2020

ACK fa6ff6e code review plus I checked each existing mempool reference to ensure there were no remaining references to ::mempool.

@maflcko
Copy link
Member Author

maflcko commented Feb 18, 2020

Rebased

@promag
Copy link
Contributor

promag commented Feb 18, 2020

Code review ACK fa2c363cca8cb2224bc90a47362244af9a9c498e.

@maflcko maflcko force-pushed the 2001-netMempool branch 2 times, most recently from fa4d4c9 to fa484ba Compare March 11, 2020 20:12
@maflcko
Copy link
Member Author

maflcko commented Mar 11, 2020

Rebased and squashed, as requested by @promag in #17997 (review)

This refactor does two things:
* Pass mempool in to PeerLogicValidation
* Pass m_mempool around where needed
@jnewbery
Copy link
Contributor

code review ACK fa7fea3

@jnewbery
Copy link
Contributor

(looking forward to the mempool -> g_mempool rename)

@maflcko maflcko merged commit 8662387 into bitcoin:master Mar 16, 2020
@maflcko maflcko deleted the 2001-netMempool branch March 16, 2020 15:43
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 16, 2020
fa7fea3 refactor: Remove mempool global from net (MarcoFalke)

Pull request description:

  To increase modularisation and simplify testing, remove the mempool global from net in favour of a mempool member.

  This is done in the same way it was done for the connection manager global.

ACKs for top commit:
  jnewbery:
    code review ACK fa7fea3

Tree-SHA512: 0e3e1eefa8d6e46367bc6991d5f36c636b15ae4a3bda99b6fe6715db3240771c3d87943c6eb257d69f31929fa2f1d0973e14fc9d1353a27551dbe746eae36857
sidhujag pushed a commit to syscoin-core/syscoin that referenced this pull request Nov 10, 2020
fa7fea3 refactor: Remove mempool global from net (MarcoFalke)

Pull request description:

  To increase modularisation and simplify testing, remove the mempool global from net in favour of a mempool member.

  This is done in the same way it was done for the connection manager global.

ACKs for top commit:
  jnewbery:
    code review ACK fa7fea3

Tree-SHA512: 0e3e1eefa8d6e46367bc6991d5f36c636b15ae4a3bda99b6fe6715db3240771c3d87943c6eb257d69f31929fa2f1d0973e14fc9d1353a27551dbe746eae36857
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 4, 2021
Summary:
```
This refactor does two things:
* Pass mempool in to PeerLogicValidation
* Pass m_mempool around where needed
```

Backport of core [[bitcoin/bitcoin#17997 | PR17997]].

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D8772
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
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.

6 participants