Skip to content

Conversation

@theStack
Copy link
Contributor

This PR is a late follow-up to the review club session about the PR "Default to NODE_WITNESS in nLocalServices" (#21090):

17:32 <lightlike> hmm, if we are in pruned mode, we first set NODE_NETWORK and then unset it later in init.cpp. that seems a bit strange.
...
17:33 <jnewbery> lightlike: ah yes, you're right. That does seem a bit messy.

Rather than setting the service bit NODE_NETWORK first and then unset it (if in fPruneMode), start with the bare minimum flags that we always serve and only add NODE_NETWORK if we are running as a non-pruned node. This seems to be a more logical approach than currently on master.

@theStack theStack force-pushed the 202208-init-avoid_nlocalservices_flag_removal branch from 03f2333 to a681bb3 Compare August 20, 2022 12:54
Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

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

Approach ACK a681bb33d8645acf9e7d4f007c4835f9a39aaae0

init.cpp::nLocalServices doesn't get exposed until at the end of AppInitMain() where the flag is now set, so I don't see how this can lead to any behaviour change (except for the different logging)

@theStack theStack changed the title init: refactor: avoid unsetting service bits from nLocalServices init: avoid unsetting service bits from nLocalServices Aug 20, 2022
Rather than setting the service bit `NODE_NETWORK` first and then unset
it, start out the bare minimum flags that every node serves and only add
`NODE_NETWORK` if we are running as a non-pruned node.
@theStack theStack force-pushed the 202208-init-avoid_nlocalservices_flag_removal branch from a681bb3 to 1b5bec7 Compare August 20, 2022 20:37
Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

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

ACK 1b5bec7

@naumenkogs
Copy link
Contributor

ACK 1b5bec7

Copy link
Contributor

@LarryRuane LarryRuane left a comment

Choose a reason for hiding this comment

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

ACK 1b5bec7

@maflcko maflcko merged commit fa5c224 into bitcoin:master Sep 1, 2022
@theStack theStack deleted the 202208-init-avoid_nlocalservices_flag_removal branch September 1, 2022 08:52
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Sep 1, 2022
…ervices`

1b5bec7 init: avoid unsetting service bits from `nLocalServices` (Sebastian Falbesoner)

Pull request description:

  This PR is a late follow-up to the [review club session about the PR "Default to NODE_WITNESS in nLocalServices" ](https://bitcoincore.reviews/21090#l-90) (bitcoin#21090):

  ```
  17:32 <lightlike> hmm, if we are in pruned mode, we first set NODE_NETWORK and then unset it later in init.cpp. that seems a bit strange.
  ...
  17:33 <jnewbery> lightlike: ah yes, you're right. That does seem a bit messy.
  ```

  Rather than setting the service bit `NODE_NETWORK` first and then unset it (if in `fPruneMode`), start with the bare minimum flags that we always serve and only add `NODE_NETWORK` if we are running as a non-pruned node. This seems to be a more logical approach than currently on master.

ACKs for top commit:
  naumenkogs:
    ACK 1b5bec7
  stickies-v:
    ACK 1b5bec7
  LarryRuane:
    ACK 1b5bec7

Tree-SHA512: 2e82d66c4298ffacff41d9e0458b74b83bc156a1fa49e3f3471e942878e5dd2b253b5597ee5ec1d9c8726b432751d05e40f0c580f3976a9e00a7d1f417921ab0
@bitcoin bitcoin locked and limited conversation to collaborators Sep 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants