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

Intro: Have user choose assumevalid #149

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Dec 10, 2020

@Sjors
Copy link
Member

Sjors commented Dec 11, 2020

Concept ACK on allowing the GUI user to opt-out of -assumevalid. The text needs some work, e.g. it should explain what is and isn't validated.

@luke-jr
Copy link
Member Author

luke-jr commented Dec 11, 2020

@Sjors Any suggestions for the text?

Note that validation is largely a black-and-white thing: unless you validate everything, you might as well be validating nothing. I think the only exception is the PoW?

@Sjors
Copy link
Member

Sjors commented Dec 11, 2020

I'm pretty sure it also checks that coins aren't created out of nothing (i.e. it checks a coin spends outpoints and tracks which new ones it creates, and that the amounts add up).

Copy link

@Talkless Talkless 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/qt/intro.cpp Outdated Show resolved Hide resolved
src/qt/intro.cpp Outdated Show resolved Hide resolved
src/qt/intro.cpp Outdated Show resolved Hide resolved
src/qt/intro.cpp Outdated Show resolved Hide resolved
src/qt/intro.cpp Outdated Show resolved Hide resolved
src/qt/intro.h Outdated Show resolved Hide resolved
src/qt/intro.cpp Outdated Show resolved Hide resolved
@Rspigler
Copy link
Contributor

Hm, I keep getting errors when trying to compile

make:

qt/intro.cpp: In constructor ‘Intro::Intro(QWidget*, int64_t, int64_t)’:
qt/intro.cpp:178:52: error: invalid initialization of reference of type ‘const string&’ {aka ‘const std::__cxx11::basic_string&’} from expression of type ‘ArgsManager’
const auto chainparams = CreateChainParams(gArgs, gArgs.GetChainName());
^~~~~
In file included from qt/intro.cpp:9:
./chainparams.h:117:37: note: in passing argument 1 of ‘std::unique_ptr CreateChainParams(const string&)’
std::unique_ptr CreateChainParams(const std::string& chain);
^~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:13191: qt/libbitcoinqt_a-intro.o] Error 1
make[2]: Leaving directory '/home/user/gui/src'
make[1]: *** [Makefile:18989: all-recursive] Error 1
make[1]: Leaving directory '/home/user/gui/src'
make: *** [Makefile:798: all-recursive] Error 1

@Rspigler
Copy link
Contributor

Rspigler commented Dec 21, 2021

Still getting errors trying to compile Duh

@luke-jr
Copy link
Member Author

luke-jr commented Mar 23, 2022

Rebased, reviews addressed

src/qt/intro.cpp Outdated Show resolved Hide resolved
@Talkless
Copy link

Sorry for a lot of "n/a's" @luke-jr , I guess I need to up my diff reading game...

@Rspigler
Copy link
Contributor

tACK 75aff9e
Simple, I like the language, and I think it is an important setting the user should set

@laanwj
Copy link
Member

laanwj commented Jun 20, 2022

Concept ACK, this choice seems sufficiently important to me to expose in the GUI.

@luke-jr
Copy link
Member Author

luke-jr commented Nov 15, 2022

Rebased

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 15, 2022

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 pablomartin4btc
Concept ACK Sjors, Talkless, laanwj, kristapsk
Approach ACK hebasto
Stale ACK Rspigler

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:

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

DrahtBot commented Jun 9, 2023

🐙 This pull request conflicts with the target branch and needs rebase.

@hebasto
Copy link
Member

hebasto commented Sep 22, 2023

Please rebase if this PR is still relevant.

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

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

tACK cf940f0

Without -assumevalid its checkbox is ticked:

image

Witth -assumevalid its checkbox is un-ticked:

image

On -signet & -tesnet behave similarly, block hash updates correctly ofc.

On -regtest the layoutAssumeValid is not visible:

image

Shouldn't we reduce the empty space/ windows size a bit when the layoutAssumeValid is not visible? As currently without this PR:

image

I think this shouldn't happen -assumevalid=23aaa:

image

Comment on lines +165 to +176
if (gArgs.IsArgSet("-assumevalid")) {
const auto user_assumevalid = gArgs.GetArg("-assumevalid", /* ignored default; determines return type */ "");
if (uint256S(user_assumevalid).IsNull()) {
// -assumevalid=0: default checkbox to off, and initialise with chainparams later
ui->assumevalid->setChecked(false);
} else {
// -assumevalid=blockhash: initialise with the user-specified value, enabled
ui->assumevalid->setChecked(true);
ui->assumevalidBlock->setText(QString::fromStdString(user_assumevalid));
have_user_assumevalid = true;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: while not mandatory nor blocker, maybe you could consider refactoring these if statements into functions like the above UpdateFreeSpaceLabel(), as it could improve code readability and maintainability, especially as we keep adding more logic.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 3, 2024

There hasn't been much activity lately and the patch still needs rebase. What is the status here?

  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

@kristapsk
Copy link
Contributor

Concept ACK

Copy link
Member

@hebasto hebasto 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 cf940f0.

This branch has to be rebased due to the conflicts with the master branch.

@DrahtBot DrahtBot requested review from Talkless and removed request for Talkless February 12, 2024 11:19
@DrahtBot
Copy link
Contributor

⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?

  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

@DrahtBot
Copy link
Contributor

🤔 There hasn't been much activity lately and the CI seems to be failing.

If no one reviewed the current pull request by commit hash, a rebase can be considered. While the CI failure may be a false positive, the CI hasn't been running for some time, so there may be a real issue hiding as well. A rebase triggers the latest CI and makes sure that no silent merge conflicts have snuck in.

@Sjors
Copy link
Member

Sjors commented May 13, 2024

Realistically anyone who wants to use this probably won't do so the first time they install the node. So they'll have to carefully delete the blocks and chainstate from their data dir, wipe the GUI settings and trigger this dialog again.

It seems both easier and safer to encourage such a user to add reindex-chainstate=1 and assumevalid=0 to their config file instead.

I don't think we should be cluttering the Intro screen for this, especially when looking ahead to Assume UTXO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants