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

validation: Move warningcache to ChainstateManager and rename to m_warningcache #27357

Conversation

dimitaracev
Copy link
Contributor

Removes warningcache and moves it to ChainstateManager. Also removes the respective TODO completely.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 28, 2023

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

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK TheCharlatan, ajtowns, ryanofsky
Concept ACK dergoegge

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #27596 (assumeutxo (2) by jamesob)

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.

Copy link
Contributor

@ajtowns ajtowns left a comment

Choose a reason for hiding this comment

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

Concept ACK

src/validation.cpp Outdated Show resolved Hide resolved
Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

Please keep you commits squashed according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits Otherwise it is harder to review

src/validation.h Outdated Show resolved Hide resolved
@dimitaracev dimitaracev force-pushed the refactor-move-warningcache-to-chainstatemanager branch from 8bba010 to 5526849 Compare March 29, 2023 11:42
@dimitaracev
Copy link
Contributor Author

@MarcoFalke Thanks for the remainder, squashed them and it should be good now.

@dergoegge
Copy link
Member

Concept ACK

@dimitaracev dimitaracev requested review from ajtowns and maflcko and removed request for ajtowns and maflcko March 30, 2023 14:41
Copy link
Contributor

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

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

ACK 5526849

@ajtowns
Copy link
Contributor

ajtowns commented Apr 5, 2023

ACK 5526849

Looking at this, it occurs to me that we're actually being a bit wasteful scanning through ~780k historical headers 29 times (or 2.4M headers 29 times for testnet) every time we startup. Replacing MinBIP9WarningHeight with MinBIP9WarningStartTime (set it to say 2022-07-01 initially), and using it for WarningBitsConditionChecker::BeginTime(), and just bumping it at each release might be worthwhile.

@DrahtBot DrahtBot removed the request for review from ajtowns April 5, 2023 06:57
@dimitaracev
Copy link
Contributor Author

dimitaracev commented Apr 5, 2023

ACK 5526849

Looking at this, it occurs to me that we're actually being a bit wasteful scanning through ~780k historical headers 29 times (or 2.4M headers 29 times for testnet) every time we startup. Replacing MinBIP9WarningHeight with MinBIP9WarningStartTime (set it to say 2022-07-01 initially), and using it for WarningBitsConditionChecker::BeginTime(), and just bumping it at each release might be worthwhile.

Good point, should increase the startup time significantly. I'm on it and will address it in a following PR.

@maflcko
Copy link
Member

maflcko commented Apr 6, 2023

Please remove the merge commit in this branch. A merge commit will be created by the merge script.

@ajtowns
Copy link
Contributor

ajtowns commented Apr 6, 2023

Good point, should increase the startup time significantly. I'm on it and will address it in a following PR.

(For the record I don't think this will affect startup time significantly and that you'd need to add bench logging code to even observe the difference outside of the noise of disk reads and reconnecting on the network)

@dimitaracev dimitaracev force-pushed the refactor-move-warningcache-to-chainstatemanager branch from 683bef9 to 5526849 Compare April 6, 2023 10:51
@dimitaracev
Copy link
Contributor Author

Please remove the merge commit in this branch. A merge commit will be created by the merge script.

Somehow when I synced my forked repo with the latest changes, it merged this branch too. thx

@dimitaracev
Copy link
Contributor Author

Good point, should increase the startup time significantly. I'm on it and will address it in a following PR.

(For the record I don't think this will affect startup time significantly and that you'd need to add bench logging code to even observe the difference outside of the noise of disk reads and reconnecting on the network)

I just assumed that since there would be less block header processing, but what you say makes sense in that regard.

This was referenced May 2, 2023
Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

Code review ACK 5526849

This change does seem ready to merge, but I notice it conflicts with #27596 so might not be worth creating more rebase churn there. Will leave alone for now and wait for more input or a better opportunity to merge

@DrahtBot DrahtBot requested review from ryanofsky and removed request for ryanofsky June 9, 2023 17:39
@dimitaracev
Copy link
Contributor Author

The priority of this change should be pretty low anyways so I agree with that.

@ajtowns
Copy link
Contributor

ajtowns commented Jun 10, 2023

This change does seem ready to merge, but I notice it conflicts with #27596 so might not be worth creating more rebase churn there. Will leave alone for now and wait for more input or a better opportunity to merge

FWIW, I think the rebase churn is pretty trivial (the PR's change neighbouring lines in validation.h -- this one introduces m_warningcache while assumeutxo moves GetSnapshotBaseHeight), #27596 needs rebase anyway (to combine the fixups at least), and it doesn't conflict with #27746 which I think is the next part of assumevalid, though is still draft.

@fanquake
Copy link
Member

I think it's ok to merge this now.

@fanquake fanquake merged commit 6f5f37e into bitcoin:master Jun 12, 2023
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 12, 2023
…er and rename to m_warningcache

5526849 validation: Move warningcache to ChainstateManager (dimitaracev)

Pull request description:

  Removes `warningcache`  and moves it to `ChainstateManager`. Also removes the respective `TODO`  completely.

ACKs for top commit:
  ajtowns:
    ACK 5526849
  dimitaracev:
    > ACK [5526849](bitcoin@5526849)
  TheCharlatan:
    ACK 5526849
  ryanofsky:
    Code review ACK 5526849

Tree-SHA512: 6869bd7aa4f0b59324e12eb8e3df47f2c9a3f3b0d9b7d45857426ec9e8b71c5573bdcf71db822f8c10aff7d8679a00a4bedc7a256c28f325e744e5d7267b41e9
@bitcoin bitcoin locked and limited conversation to collaborators Jun 11, 2024
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.

8 participants