-
Notifications
You must be signed in to change notification settings - Fork 266
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
Add settings.json prune-prev, proxy-prev, onion-prev settings #603
Conversation
Concept ACK, since users can reset settings. Will test soon |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
tACK c2051b3 Works just as described, I think it's really smooth. I think this is a good solution, but open to hearing more opinions obviously. |
Functional and util tests pass. |
Yes this happens on cirrus and locally too because actually enabling proxy/prune/onion settings sets the |
This provides a way for the GUI settings dialog box to retain previous pruning and proxy settings when they are disabled, as requested by vasild: bitcoin/bitcoin#15936 (review) bitcoin/bitcoin#15936 (comment) bitcoin/bitcoin#15936 (comment) Importantly, while this PR changes the settings.json format, it changes it in a fully backwards compatible way, so previous versious of bitcoind and bitcoin-qt will correctly interpret prune, proxy, and onion settins written by new versions of bitcoin-qt.
c2051b3
to
9d3127b
Compare
Done! Rebased c2051b3 -> 9d3127b ( |
This was also implemented in the last push |
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.
ACK 9d3127b, tested on Ubuntu 22.04.
Although, #596 (comment).
re: #596 (comment)
If others agree, I can probably change the PR pretty easily to do this. Just replace new |
Makes sense to me. nit: maybe use "active" instead of "inactive" to avoid double negation "inactive=false" aka "is not non-active". |
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.
ACK 9d3127b
Would be nice to have this in 24.0 to avoid changing user behavior from 23->24 (and to restore it in 24->25).
Would be happy to re-review if changed like discussed in: #603 (comment)
So would I :) |
I started working on this, but I think I changed my mind about this alternate approach and now prefer the current approach. I don't think storing enabled settings in bitcoin-cli settings set prune 3G
bitcoin-cli settings disable prune
bitcoin-cli settings enable prune
bitcoin-cli settings set proxy 127.0.0.1:9050
bitcoin-cli settings disable proxy
bitcoin-cli settings enable proxy could be a good idea, and if implemented should use same disabled settings storage that the GUI uses, making In light of this it would probably be better to move disabled settings logic down into the common or util layers instead of being in the GUI layer. But this could happen in a followup. Would be curious if this makes sense to others. Even if we never add another interface that enables & disables settings, it just seem plausible that there could be other interfaces that use these values, so it makes sense to store them alongside the normal settings, not someplace GUI-specific. |
Just to summarize discussion above, I think that as long we believe it is useful to store disabled prune and proxy values, then If we think it's ok to reset disabled settings to default instead of saving them, then that is the current behavior, and this PR could just be closed. I'm beginning to think more that it is good to store disabled settings, so this PR seems like a good idea, but resetting them also seems reasonable, so I don't have a strong opinion. |
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.
tACK 9d3127b
This is useful for us over at https://github.com/bitcoin-core/gui-qml
… onion-prev settings 9d3127b Add settings.json prune-prev, proxy-prev, onion-prev settings (Ryan Ofsky) Pull request description: With bitcoin#602, if proxy and pruning settings are disabled in the GUI and the GUI is restarted, proxy and prune values are not stored anywhere. So if these settings are enabled in the future, default values will be shown, not previous values. This PR stores previous values so they will preserved across restarts. I'm not sure I like this behavior because showing default values seems simpler and safer to me. Previous values may just have been set temporarily and may have never actually worked, and it adds some code complexity to store them. This PR is one way of resolving bitcoin#596. Other solutions are possible and could be implemented as alternatives. ACKs for top commit: hebasto: ACK 9d3127b, tested on Ubuntu 22.04. vasild: ACK 9d3127b jarolrod: tACK 9d3127b Tree-SHA512: 1778d1819443490c880cfd5c1711d9c5ac75ea3ee8440e2f0ced81d293247163a78ae8aba6027215110aec6533bd7dc6472aeead6796bfbd51bf2354e28f24a9
Pull request description: Sync with the main repo up to bitcoin/bitcoin@73966f7 The reason for this sync is to bring in the functionality of bitcoin-core/gui#603 GUIX hashes: ``` 9465f358e218b9aaf0ee0f22da821544d65fe8b500d33c9719221b90ae9c913f guix-build-976c90d2a30e/output/aarch64-linux-gnu/SHA256SUMS.part ed9aa8fa7e16f3949e73b253d35cdba8c7fc7ee338080ab91f5e90af0dce57d7 guix-build-976c90d2a30e/output/aarch64-linux-gnu/bitcoin-976c90d2a30e-aarch64-linux-gnu-debug.tar.gz 6ce2cba039f1924cd5084ddc07a5d3681b1d4f39733fd6ed10921868ce7f53d1 guix-build-976c90d2a30e/output/aarch64-linux-gnu/bitcoin-976c90d2a30e-aarch64-linux-gnu.tar.gz 6f82a95a6f7954c12fa0f4b7b5cd2b0047beb8e750881b6d4c1223b6cccbfbc6 guix-build-976c90d2a30e/output/arm-linux-gnueabihf/SHA256SUMS.part 573785f291f7ce1cd9c442ca6ff48e2904abeb958f07298fec209531bcd5f475 guix-build-976c90d2a30e/output/arm-linux-gnueabihf/bitcoin-976c90d2a30e-arm-linux-gnueabihf-debug.tar.gz de7724db4746ad0b98f756bef279ca41a8012db36bcd146277d7073ab8ed2f9b guix-build-976c90d2a30e/output/arm-linux-gnueabihf/bitcoin-976c90d2a30e-arm-linux-gnueabihf.tar.gz 49eef5983005d5c92d972217bea655ee93ea33eee61f52cf49b379ed7fd35657 guix-build-976c90d2a30e/output/arm64-apple-darwin/SHA256SUMS.part d7a57e99853531f9f2be7585037e427f402ff26c47ccdb42cf46542fbf2a398e guix-build-976c90d2a30e/output/arm64-apple-darwin/bitcoin-976c90d2a30e-arm64-apple-darwin-unsigned.dmg 81da57a349eb125ba1cd780abf288345d7f8b964248d3b95554e502f9a47d09f guix-build-976c90d2a30e/output/arm64-apple-darwin/bitcoin-976c90d2a30e-arm64-apple-darwin-unsigned.tar.gz b0a098804b53cd4d0486c6ad4c734b711ec749e351beb3d857f4991eddc5df9b guix-build-976c90d2a30e/output/arm64-apple-darwin/bitcoin-976c90d2a30e-arm64-apple-darwin.tar.gz 2c8615626209ed30dd9ba60c4e99c3c4b942a6320d580d6b15aedf5e48f57ed0 guix-build-976c90d2a30e/output/dist-archive/bitcoin-976c90d2a30e.tar.gz f194eec851e22ea42b4cc6dcce87e97d8d0cb43b07567be08c20f20e8457a9eb guix-build-976c90d2a30e/output/powerpc64-linux-gnu/SHA256SUMS.part 23c59be25fee80147b9c9f4fa4c42407478f0528f4b965014fbc1c713baf1f28 guix-build-976c90d2a30e/output/powerpc64-linux-gnu/bitcoin-976c90d2a30e-powerpc64-linux-gnu-debug.tar.gz edd5c26e2d01baa1f09939e4568e6c21d21182496a8e59292d02475c812bcbef guix-build-976c90d2a30e/output/powerpc64-linux-gnu/bitcoin-976c90d2a30e-powerpc64-linux-gnu.tar.gz 5b5160d98dbfb2bb0a6b83f03b2f6d7b63994902a1a9be604e6c8f52be1dfe37 guix-build-976c90d2a30e/output/powerpc64le-linux-gnu/SHA256SUMS.part fea6e0b10079152d99a4afc2f81b2cb629a710dca125f562312fd86dc0a4c5d2 guix-build-976c90d2a30e/output/powerpc64le-linux-gnu/bitcoin-976c90d2a30e-powerpc64le-linux-gnu-debug.tar.gz 3f3eb482f23ce7adda9dbdccdbd4e94d1b90fcfd447b5daa3b8455902f444114 guix-build-976c90d2a30e/output/powerpc64le-linux-gnu/bitcoin-976c90d2a30e-powerpc64le-linux-gnu.tar.gz d0190698eb3f9d84a49f2b97845167a335fb613220932c53b2ccdadf8df8d3bc guix-build-976c90d2a30e/output/riscv64-linux-gnu/SHA256SUMS.part 73e805dfb7d5dbdeea42cef92ea7f0f0788fa08b08925b11c98ac4247277d0d5 guix-build-976c90d2a30e/output/riscv64-linux-gnu/bitcoin-976c90d2a30e-riscv64-linux-gnu-debug.tar.gz 66ef93b3b2248c5a1fc114cfae2a8f8204848599f658441801c99487dcda9b58 guix-build-976c90d2a30e/output/riscv64-linux-gnu/bitcoin-976c90d2a30e-riscv64-linux-gnu.tar.gz 8a62135277c3b78523c02e0118b69b68e47544cf75eb7e1f81300a8724faef2f guix-build-976c90d2a30e/output/x86_64-apple-darwin/SHA256SUMS.part 163538730911593d3a3cdfc2416384d51d34bf9fbb597b516ea943ddfbe2142b guix-build-976c90d2a30e/output/x86_64-apple-darwin/bitcoin-976c90d2a30e-x86_64-apple-darwin-unsigned.dmg 7765a42cf56a80caeb0186509030792f2c0b28aad8926d951f5e1fafe726cda7 guix-build-976c90d2a30e/output/x86_64-apple-darwin/bitcoin-976c90d2a30e-x86_64-apple-darwin-unsigned.tar.gz f469b7c4f6c51fea30554444eaa6fc818d31e651dbda60950cc9b900e5cecae7 guix-build-976c90d2a30e/output/x86_64-apple-darwin/bitcoin-976c90d2a30e-x86_64-apple-darwin.tar.gz fe591d3d4e04c3537974cad6ee84f057c7e48145c32b8645eba266b0d7cb0b3f guix-build-976c90d2a30e/output/x86_64-linux-gnu/SHA256SUMS.part f66091ae7e6b1ebaa7d1ef95ed9b716d2d87687a15bc9379323e6fb4592257cd guix-build-976c90d2a30e/output/x86_64-linux-gnu/bitcoin-976c90d2a30e-x86_64-linux-gnu-debug.tar.gz aa4982f2e330c90d22dc3143892a36d8fb45f7db572d18c503f5b71cf743cb2a guix-build-976c90d2a30e/output/x86_64-linux-gnu/bitcoin-976c90d2a30e-x86_64-linux-gnu.tar.gz 32efeed9488e428ebfa5cb1e145905a43943af7e6a302cb48b85be185d24f2eb guix-build-976c90d2a30e/output/x86_64-w64-mingw32/SHA256SUMS.part 1eabfd2372de89411bd9ba72bfa004857b5414eed65c08e8435245b91ae22f8a guix-build-976c90d2a30e/output/x86_64-w64-mingw32/bitcoin-976c90d2a30e-win64-debug.zip 5a6c153b9258576e1f01892a4856ea29857a5b176e5762a765432bf721e1430f guix-build-976c90d2a30e/output/x86_64-w64-mingw32/bitcoin-976c90d2a30e-win64-setup-unsigned.exe 94de454274fd35e5b7ff99f42092ce43b7050e396eaae18335e80a5fbec58cad guix-build-976c90d2a30e/output/x86_64-w64-mingw32/bitcoin-976c90d2a30e-win64-unsigned.tar.gz 1a438e20c241af3ac5ea57e742e4e96d7f80c065734520e1178820fbe19aff1f guix-build-976c90d2a30e/output/x86_64-w64-mingw32/bitcoin-976c90d2a30e-win64.zip ``` [![Windows](https://img.shields.io/badge/OS-Windows-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/insecure_win_gui.zip?branch=pull/266) [![Intel macOS](https://img.shields.io/badge/OS-Intel%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/insecure_mac_gui.zip?branch=pull/266) [![Apple Silicon macOS](https://img.shields.io/badge/OS-Apple%20Silicon%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/insecure_mac_arm64_gui.zip?branch=pull/266) [![ARM64 Android](https://img.shields.io/badge/OS-Android-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/insecure_android_apk.zip?branch=pull/266) ACKs for top commit: hebasto: ACK 976c90d, I've synced locally and got zero diff. Tree-SHA512: 4c7e95ab8a42ff6cfb2481574b4eb6bee8036ff6ca52c3a0cc1004fcadb1bba06c61c7d27c47dc03dc2fd5715314881edb57421ea2681191e48bbcbc5d8b30db
With #602, if proxy and pruning settings are disabled in the GUI and the GUI is restarted, proxy and prune values are not stored anywhere. So if these settings are enabled in the future, default values will be shown, not previous values.
This PR stores previous values so they will preserved across restarts. I'm not sure I like this behavior because showing default values seems simpler and safer to me. Previous values may just have been set temporarily and may have never actually worked, and it adds some code complexity to store them.
This PR is one way of resolving #596. Other solutions are possible and could be implemented as alternatives.