-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[Qt] implements concept for different disk sizes on intro #13216
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
[Qt] implements concept for different disk sizes on intro #13216
Conversation
|
Tested on Ubuntu 16.04: Image |
|
Thanks for addressing this issue. We generally try to avoid having explicit branching on the network type. Instead, I would suggest adding a variable to CChainParams (which is initialized differently in the different network versions). |
|
Okay, thanks! This will be cleaner. |
Don't forget to update the release process document as well. |
|
Concept ACK. |
|
Concept ACK |
|
utACK,... maybe simplify the code according to #13229 |
|
@jonasschnelli, if #13229 is acceptable, I prefer dropping this PR in favor of #13229. No need to re-do the work here and your approach seems better. Just as a heads up, it seems that #13229 also explicitly branches the network type (see @sipa's suggestion above). I'm new to the code base and I can't tell for sure if using CChainParams for this Qt issue will be better for the rest of the code as a whole. What do you think? |
|
I think it is fine to put it in chainparams, if you call it |
Please continue with this and feel free to grab code from 13229... I had the feeling that this would be GUI only and not appropriate to put Into the chainparams holder... but @sipa and @MarcoFalke think its better there which I guess they are right... |
doc/release-process.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooops, okay
src/chainparams.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds a bit excessive for regtest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have any suggestion for this value? thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 or 1? :)
It doesn't matter, and it's also unpredictable, as it depends on what blocks are created (regtest is purely for testing purposes, and all blocks are typically explicitly created in the test; there is no real network).
src/qt/intro.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't include core files directly (this is part of ongoing work to separate the two more cleanly); you'll need to go through the node interface (see the include below).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see! Thank you, I will fix this as soon as I get back.
|
Updated do address @sipa's review. |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
src/qt/intro.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that the comment is already opened with /* on the line above :-)
src/qt/intro.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that requiredSpace is redefined four lines below :-)
src/qt/intro.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should catch by reference instead of value. Also missing space before ( :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except this one, other issues were caused by a (obviously bad) merge conflict resolution - bad. I'll take a lot more care so it doesn't happen again.
Thank you for taking the time to review it.
- Creates m_assumed_blockchain_size and m_assumed_chain_state_size on CChainParams. - Implements access to CChainParams' m_assumed_blockchain_size and m_assumed_chain_state_size on node interface. - Implements m_assumed_blockchain_size and m_assumed_chain_state_size on qt/intro via node interface. - Updates release process document with the new CChainParam's values.
|
Concept ACK. Code review ACK for non-Qt code 9d0e528 |
|
Re-utACK 9d0e528 |
|
utACK 9d0e528 non-qt code. |
|
Should anything else be done to have this merged? |
|
Tested ACK 9d0e528 |
9d0e528 implements different disk sizes for different networks on intro (marcoagner) Pull request description: Fixes #13213. Mostly, I layed out the concept to open the PR for refinement and getting feedback if the approach is okay. Changes are expected. Two points: - The values for both new consts `TESTNET_BLOCK_CHAIN_SIZE` and `TESTNET_CHAIN_STATE_SIZE` is certainly not optimal; I just checked the size of my testnet3 related dirs and set them to little bit higher values. Which values should be used? - Should we do something like this to regtest? Or these "niceties" do not matter when on regtest? Thanks! Tree-SHA512: 8ae87a29fa8356b899e7a823c76cde793d9126b4ee59554d7a2a8edb088fe42a19976b34c06c2fd4a98a727e1e4971dd983f42b6093ea6caa255b45004e22bb4
|
Thank you for testing, @jonasschnelli. |
maflcko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some post-merge observations
| try { | ||
| node.selectParams(gArgs.GetChainName()); | ||
| } catch (const std::exception&) { | ||
| return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this will hide all error messages from selectParams
| pchMessageStart[3] = 0xd9; | ||
| nDefaultPort = 8333; | ||
| nPruneAfterHeight = 100000; | ||
| m_assumed_blockchain_size = 200; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This used to be 220?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted, thanks! This was 200 when the PR was first made but changed down the line with this maintenance for 0.17: 78dae8c. Do you think this should be addressed here or could wait for the next maintenance (since the release process now asks for this to be changed)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could bump it to 240 before 0.18 is branched, so we don't forget about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks. Like this? -> #15183
|
|
||
| /* If current default data directory does not exist, let the user choose one */ | ||
| Intro intro; | ||
| Intro intro(0, node.getAssumedBlockchainSize(), node.getAssumedChainStateSize()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/0/nullptr/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is another PR for this okay?
…alue 8c3fdd3 fixes m_assumed_blockchain_size variables values: (marcoagner) Pull request description: This is used by Qt but I'm not sure if this is the right tag here. Please, edit the title if there's something better. `m_assumed_blockchain_size` (src/chainparams.cpp:CChainParams) was `BLOCK_CHAIN_SIZE` (src/qt/intro.cpp) and while the transition was being made by PR 13216 (merged commit: 9d0e528), 3fc2063 changed its value from 200 to 220, which 9d0e528 ended up reverting. So, as per MarcoFalke's suggestion (bitcoin#13216 (comment)), I'm bumping it to 240 before 0.18 is branched to avoid any confusion. Anything else (e.g. constexpr) that should/could be done here? Thanks. Tree-SHA512: 4319739b870a2b96a57f268f9edc7dd9f9eff5c4ca3b01863e6b861b9ca58c245416ce362dae54d1673e3d5b1c7f5a16e4031842af250e1b1f0a5109b75fb3c3
Summary: - Creates m_assumed_blockchain_size and m_assumed_chain_state_size on CChainParams. - Implements access to CChainParams' m_assumed_blockchain_size and m_assumed_chain_state_size on node interface. - Implements m_assumed_blockchain_size and m_assumed_chain_state_size on qt/intro via node interface. - Updates release process document with the new CChainParam's values. Backport of core [[ bitcoin/bitcoin#13216 | PR13216 ]]. Test Plan: ninja check-all Build the win64 client and run it on my windows machine. Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D5748
Summary: - Creates m_assumed_blockchain_size and m_assumed_chain_state_size on CChainParams. - Implements access to CChainParams' m_assumed_blockchain_size and m_assumed_chain_state_size on node interface. - Implements m_assumed_blockchain_size and m_assumed_chain_state_size on qt/intro via node interface. - Updates release process document with the new CChainParam's values. Backport of core [[ bitcoin/bitcoin#13216 | PR13216 ]]. Test Plan: ninja check-all Build the win64 client and run it on my windows machine. Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D5748
… on intro 9d0e528 implements different disk sizes for different networks on intro (marcoagner) Pull request description: Fixes bitcoin#13213. Mostly, I layed out the concept to open the PR for refinement and getting feedback if the approach is okay. Changes are expected. Two points: - The values for both new consts `TESTNET_BLOCK_CHAIN_SIZE` and `TESTNET_CHAIN_STATE_SIZE` is certainly not optimal; I just checked the size of my testnet3 related dirs and set them to little bit higher values. Which values should be used? - Should we do something like this to regtest? Or these "niceties" do not matter when on regtest? Thanks! Tree-SHA512: 8ae87a29fa8356b899e7a823c76cde793d9126b4ee59554d7a2a8edb088fe42a19976b34c06c2fd4a98a727e1e4971dd983f42b6093ea6caa255b45004e22bb4
… on intro 9d0e528 implements different disk sizes for different networks on intro (marcoagner) Pull request description: Fixes bitcoin#13213. Mostly, I layed out the concept to open the PR for refinement and getting feedback if the approach is okay. Changes are expected. Two points: - The values for both new consts `TESTNET_BLOCK_CHAIN_SIZE` and `TESTNET_CHAIN_STATE_SIZE` is certainly not optimal; I just checked the size of my testnet3 related dirs and set them to little bit higher values. Which values should be used? - Should we do something like this to regtest? Or these "niceties" do not matter when on regtest? Thanks! Tree-SHA512: 8ae87a29fa8356b899e7a823c76cde793d9126b4ee59554d7a2a8edb088fe42a19976b34c06c2fd4a98a727e1e4971dd983f42b6093ea6caa255b45004e22bb4
Fixes #13213.
Mostly, I layed out the concept to open the PR for refinement and getting feedback if the approach is okay. Changes are expected.
Two points:
TESTNET_BLOCK_CHAIN_SIZEandTESTNET_CHAIN_STATE_SIZEis certainly not optimal; I just checked the size of my testnet3 related dirs and set them to little bit higher values. Which values should be used?Thanks!