backport: Merge bitcoin#25430, 25394#6518
Conversation
|
This pull request has conflicts, please rebase. |
609b238 to
dd1a8de
Compare
dbac4df to
cc9fc6b
Compare
|
This pull request has conflicts, please rebase. |
cc9fc6b to
0afb883
Compare
f6c5655 to
e21be96
Compare
be8d0db test: refactor: save MiniWallet mode explicitly (Sebastian Falbesoner) Pull request description: Rather than abusing the member variables `self._priv_key` and `self._address` to determine the MiniWallet mode, save it explicitly (`self._mode`) in the constructor and use that instead to increase the readability and maintainability of the code. ACKs for top commit: MarcoFalke: review ACK be8d0db 🔳 Tree-SHA512: 882c635e39c89911d995917a0603395158ee86dc46b26a49815756db67c61a7aa35059eddf1dc6f2933a77169941426b98bd463e60e39515a596b1b69edf89df
f862f4a build: add *_STANDARD vars to depends gen_id (fanquake) Pull request description: Followup to bitcoin#22380 😅. We need to have these in `gen_id` so that we rebuild if we change / unset a *_STANDARD. Guix Build (x86_64): ```bash afc2a24bae06f87b7f14f0958b2ca497c050f6069e68958e45120215bab4507e guix-build-f862f4a74ec6/output/aarch64-linux-gnu/SHA256SUMS.part 547266e64002dc1124adedc1679f4c526088212b6ba31fb3457523adeb80be50 guix-build-f862f4a74ec6/output/aarch64-linux-gnu/bitcoin-f862f4a74ec6-aarch64-linux-gnu-debug.tar.gz af73193740f93d9ff13ed4eb459aabaf942e7075ac53967f5505bbebfea1eb9f guix-build-f862f4a74ec6/output/aarch64-linux-gnu/bitcoin-f862f4a74ec6-aarch64-linux-gnu.tar.gz b36f58a4e37ed30ac8463716b5ed715f427e419d80d7e90381341fcab2712427 guix-build-f862f4a74ec6/output/arm-linux-gnueabihf/SHA256SUMS.part 1ed49ea3efd7d9f5eba53d8e73356e82dfb5da2050f91a284dd38f157fa790b4 guix-build-f862f4a74ec6/output/arm-linux-gnueabihf/bitcoin-f862f4a74ec6-arm-linux-gnueabihf-debug.tar.gz dfaf6359511fa82a36448e16722179bd49d1d04e366cf140aaa0dfaa1be75b12 guix-build-f862f4a74ec6/output/arm-linux-gnueabihf/bitcoin-f862f4a74ec6-arm-linux-gnueabihf.tar.gz 41dbc79a8372c2dd2eccc1af282e160f749faacd51c5d2594e8d48afaa6df5bc guix-build-f862f4a74ec6/output/arm64-apple-darwin/SHA256SUMS.part abe6a3506441faeebdc08682c92d51ba3a0e5fc6af3a2b28f054d0ea1f2b5781 guix-build-f862f4a74ec6/output/arm64-apple-darwin/bitcoin-f862f4a74ec6-arm64-apple-darwin-unsigned.dmg 01be81fd0c99a384afd06806441fb1775fc4a875153a3e699417a2c74547ad3a guix-build-f862f4a74ec6/output/arm64-apple-darwin/bitcoin-f862f4a74ec6-arm64-apple-darwin-unsigned.tar.gz 7e1b5547d5deb5944b6b3552634e3dd737da144c87ce75a5e9029e4edfe126a4 guix-build-f862f4a74ec6/output/arm64-apple-darwin/bitcoin-f862f4a74ec6-arm64-apple-darwin.tar.gz c4387c1d98f7146aa8926d827129063d502cd9b098a2674c487e550036df36fb guix-build-f862f4a74ec6/output/dist-archive/bitcoin-f862f4a74ec6.tar.gz 084912a415d3c8eedf47a60684abc7c753977ecf8990bd72c67158371cf39e2c guix-build-f862f4a74ec6/output/powerpc64-linux-gnu/SHA256SUMS.part 17f3aba98063f51af29b8b3ad2d9edd9a34b39aee09c82d28e8f49e765395de8 guix-build-f862f4a74ec6/output/powerpc64-linux-gnu/bitcoin-f862f4a74ec6-powerpc64-linux-gnu-debug.tar.gz 12ebd244f31597a54c0b93d23dc6d2a7b375d47edf9576e205d23c7ca7c2cac8 guix-build-f862f4a74ec6/output/powerpc64-linux-gnu/bitcoin-f862f4a74ec6-powerpc64-linux-gnu.tar.gz c28467af85a6a043cc5c80234680eabc3cbb2857b778b412a128c039c85c419a guix-build-f862f4a74ec6/output/powerpc64le-linux-gnu/SHA256SUMS.part 69ae9c40f0d413e0cfdff58dab0e6938c58a72f8cf3c7b6259e2da67dae61b1a guix-build-f862f4a74ec6/output/powerpc64le-linux-gnu/bitcoin-f862f4a74ec6-powerpc64le-linux-gnu-debug.tar.gz c75065dcab7260d6072dcb753cf43976a7ad6b0c2be1ab2f96d65b99083c0628 guix-build-f862f4a74ec6/output/powerpc64le-linux-gnu/bitcoin-f862f4a74ec6-powerpc64le-linux-gnu.tar.gz 63fdefb6c04fc61fc4354d4f6bc1b1530595e21ecbd9e8dfc7a459e9daaaad32 guix-build-f862f4a74ec6/output/riscv64-linux-gnu/SHA256SUMS.part 9e5c7a8d459befce46742c254f74771c95d91496a350f396878c204003375f28 guix-build-f862f4a74ec6/output/riscv64-linux-gnu/bitcoin-f862f4a74ec6-riscv64-linux-gnu-debug.tar.gz 884a789984eda3e3c68f69e975cf664a2bb4e6986b649ab6f09f529995c84702 guix-build-f862f4a74ec6/output/riscv64-linux-gnu/bitcoin-f862f4a74ec6-riscv64-linux-gnu.tar.gz 59821609cd76efdc8efb1deacaf9f1bc6af754a764ebfbdad47df392152e19ac guix-build-f862f4a74ec6/output/x86_64-apple-darwin/SHA256SUMS.part 5f48f56c2efe5ccf9bb22c6ba78af6c019f2df86eacada8241a7a351e0b81f83 guix-build-f862f4a74ec6/output/x86_64-apple-darwin/bitcoin-f862f4a74ec6-x86_64-apple-darwin-unsigned.dmg 73d0885ac4208345ff8a762a8a421e4812af621b441cfb6ddf4430a0ce657620 guix-build-f862f4a74ec6/output/x86_64-apple-darwin/bitcoin-f862f4a74ec6-x86_64-apple-darwin-unsigned.tar.gz 9b001f66b969e80c3d22d0eadceaa53d16440e2c1550d181e4e63747de8779f5 guix-build-f862f4a74ec6/output/x86_64-apple-darwin/bitcoin-f862f4a74ec6-x86_64-apple-darwin.tar.gz 0ace0d29576c6bf110ad7a067399eca649960a7dd6a33b03e82a4eadcfec0fa1 guix-build-f862f4a74ec6/output/x86_64-linux-gnu/SHA256SUMS.part 3efea8a971c36d642cbfa7fd5d95044f895c81e4729281588726689c4cc4688e guix-build-f862f4a74ec6/output/x86_64-linux-gnu/bitcoin-f862f4a74ec6-x86_64-linux-gnu-debug.tar.gz afa95414ab703a0cdb632b963ef28ba93bb8f136590c5169c90b3906858282d5 guix-build-f862f4a74ec6/output/x86_64-linux-gnu/bitcoin-f862f4a74ec6-x86_64-linux-gnu.tar.gz 7993b7ed1592f440c498f7643c2a8cc36d0e4c887b77d6fc7e5bef2cc85afb7a guix-build-f862f4a74ec6/output/x86_64-w64-mingw32/SHA256SUMS.part 54ab6be514f0f865858d278997c409d96572a1f33aa85fd819f395d57aa4a388 guix-build-f862f4a74ec6/output/x86_64-w64-mingw32/bitcoin-f862f4a74ec6-win64-debug.zip 90a04f298826699c808519846cb1cec50047ff2959471a684b26c20a2e504c47 guix-build-f862f4a74ec6/output/x86_64-w64-mingw32/bitcoin-f862f4a74ec6-win64-setup-unsigned.exe f487dd6a8d1eb7566df85c1b2fe536352e4e0c3e50c911766f1daccdbdf5706d guix-build-f862f4a74ec6/output/x86_64-w64-mingw32/bitcoin-f862f4a74ec6-win64-unsigned.tar.gz 82be7831089e8245c17ed3d61cd56606b36554c15978c1a64181df02df918a14 guix-build-f862f4a74ec6/output/x86_64-w64-mingw32/bitcoin-f862f4a74ec6-win64.zip ``` Guix Build (arm64): ```bash b465ed412b625a0980473d359e0b34ec646d90d844d1055ad61f99d5a4e08e47 guix-build-f862f4a74ec6/output/arm-linux-gnueabihf/SHA256SUMS.part 0391c59642724c205f466844995c8dc702a581278295189c4ef39c1dd53c915a guix-build-f862f4a74ec6/output/arm-linux-gnueabihf/bitcoin-f862f4a74ec6-arm-linux-gnueabihf-debug.tar.gz 42ff69794e2c61b205e6f9e8060aa4b5c382c6ba53c1a91dfd46069619ac589a guix-build-f862f4a74ec6/output/arm-linux-gnueabihf/bitcoin-f862f4a74ec6-arm-linux-gnueabihf.tar.gz b26d85b2beb0e8812d71833f493d623ac9419d2f791f34d3726bff387541d096 guix-build-f862f4a74ec6/output/arm64-apple-darwin/SHA256SUMS.part 0e2a81f2a4ea64b2a7407b52499af41e9a8448d56ebcc65befda42bac964f94e guix-build-f862f4a74ec6/output/arm64-apple-darwin/bitcoin-f862f4a74ec6-arm64-apple-darwin-unsigned.dmg f896df86baab84c737a5e2082b184e77a6b983a1a8dfbc1282ed22d7cea5aa0b guix-build-f862f4a74ec6/output/arm64-apple-darwin/bitcoin-f862f4a74ec6-arm64-apple-darwin-unsigned.tar.gz 3c3be5e7fc97950c612c00f36970e498f356147fee4c0f590298f5ad94fbc7a6 guix-build-f862f4a74ec6/output/arm64-apple-darwin/bitcoin-f862f4a74ec6-arm64-apple-darwin.tar.gz c4387c1d98f7146aa8926d827129063d502cd9b098a2674c487e550036df36fb guix-build-f862f4a74ec6/output/dist-archive/bitcoin-f862f4a74ec6.tar.gz 792e2ae8c991203765aaa080c58111c57bd59cf217cbf0b461e50cde10754d5b guix-build-f862f4a74ec6/output/powerpc64-linux-gnu/SHA256SUMS.part ff68b5693861bc5d9e016ea23e976367f8d4b7655bdbe16c71a02704dc7f602c guix-build-f862f4a74ec6/output/powerpc64-linux-gnu/bitcoin-f862f4a74ec6-powerpc64-linux-gnu-debug.tar.gz d6385cfce11872d7008e345cfe6396e24dc37b2367139ce95841a16a91853c0b guix-build-f862f4a74ec6/output/powerpc64-linux-gnu/bitcoin-f862f4a74ec6-powerpc64-linux-gnu.tar.gz 9c14549a899c7ac550d4d6e51ebd0416bb62ad31351bc18dac9eada5a2b41d1b guix-build-f862f4a74ec6/output/powerpc64le-linux-gnu/SHA256SUMS.part e7557409ee809483be422c1f046f3de4994538e3dc840f9683dc341f35897006 guix-build-f862f4a74ec6/output/powerpc64le-linux-gnu/bitcoin-f862f4a74ec6-powerpc64le-linux-gnu-debug.tar.gz a2b9e75edccfadb7b54b7e01cd3ea602aa1d6907037bf8c1517637558e08beb6 guix-build-f862f4a74ec6/output/powerpc64le-linux-gnu/bitcoin-f862f4a74ec6-powerpc64le-linux-gnu.tar.gz 099b822c656c738b2f4119dffc9630af7c398acd9039d65520653158c05eaff9 guix-build-f862f4a74ec6/output/riscv64-linux-gnu/SHA256SUMS.part 6bcff8b4b4d68e18fd19d7407be3ba2768894a46e53a10e7a1ea5e730bddf216 guix-build-f862f4a74ec6/output/riscv64-linux-gnu/bitcoin-f862f4a74ec6-riscv64-linux-gnu-debug.tar.gz 58c3e536e0f199f85d3a71aa5ae41bcebc4bba94fe8b93062a01952f80e3fd49 guix-build-f862f4a74ec6/output/riscv64-linux-gnu/bitcoin-f862f4a74ec6-riscv64-linux-gnu.tar.gz 59821609cd76efdc8efb1deacaf9f1bc6af754a764ebfbdad47df392152e19ac guix-build-f862f4a74ec6/output/x86_64-apple-darwin/SHA256SUMS.part 5f48f56c2efe5ccf9bb22c6ba78af6c019f2df86eacada8241a7a351e0b81f83 guix-build-f862f4a74ec6/output/x86_64-apple-darwin/bitcoin-f862f4a74ec6-x86_64-apple-darwin-unsigned.dmg 73d0885ac4208345ff8a762a8a421e4812af621b441cfb6ddf4430a0ce657620 guix-build-f862f4a74ec6/output/x86_64-apple-darwin/bitcoin-f862f4a74ec6-x86_64-apple-darwin-unsigned.tar.gz 9b001f66b969e80c3d22d0eadceaa53d16440e2c1550d181e4e63747de8779f5 guix-build-f862f4a74ec6/output/x86_64-apple-darwin/bitcoin-f862f4a74ec6-x86_64-apple-darwin.tar.gz 6181e4941f836084d33eec2131b88fa793da168f79a887a7688ded690a3172db guix-build-f862f4a74ec6/output/x86_64-linux-gnu/SHA256SUMS.part c561ac1f2466fc4a685a23a89b325cf76e200b2016daa2692950af7901995149 guix-build-f862f4a74ec6/output/x86_64-linux-gnu/bitcoin-f862f4a74ec6-x86_64-linux-gnu-debug.tar.gz c89c49ff45ab9a71c2b3f0e656fdca18be815f2474beb1c4dd663d466e077e8a guix-build-f862f4a74ec6/output/x86_64-linux-gnu/bitcoin-f862f4a74ec6-x86_64-linux-gnu.tar.gz 461d8a96c28854eb131544205978849a192ef7a1db14f85f1ae4791a90da96c5 guix-build-f862f4a74ec6/output/x86_64-w64-mingw32/SHA256SUMS.part 9e77f1aa937c3d690160ad362eac92ffc20e5a8d2272243ba10099239521aa70 guix-build-f862f4a74ec6/output/x86_64-w64-mingw32/bitcoin-f862f4a74ec6-win64-debug.zip 90a04f298826699c808519846cb1cec50047ff2959471a684b26c20a2e504c47 guix-build-f862f4a74ec6/output/x86_64-w64-mingw32/bitcoin-f862f4a74ec6-win64-setup-unsigned.exe f487dd6a8d1eb7566df85c1b2fe536352e4e0c3e50c911766f1daccdbdf5706d guix-build-f862f4a74ec6/output/x86_64-w64-mingw32/bitcoin-f862f4a74ec6-win64-unsigned.tar.gz 5f120f1af427ee1c7bd3129a67297b6bc34693e963e90004aee2558c9c5622d5 guix-build-f862f4a74ec6/output/x86_64-w64-mingw32/bitcoin-f862f4a74ec6-win64.zip ``` ACKs for top commit: laanwj: Code review ACK f862f4a Tree-SHA512: df52d0165eb1ca1db1c50bfc06e0f647ef976bd133daf2fd310f25455ee6b69b26a1e5cb48f2d8873aac78660465bfedcd2acdec67e67bf76bb44257d28912a3
WalkthroughThe changes modify components in both build configuration and functional testing areas. In the build system, the ✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
test/functional/test_framework/wallet.py (2)
196-202: Replace assert False with proper exceptionUsing
assert Falseis not recommended as it can be removed when running Python with the-Ooptimization flag.elif self._mode == MiniWalletMode.RAW_P2PK: vsize = Decimal(168) # P2PK (73 bytes scriptSig + 35 bytes scriptPubKey + 60 bytes other) else: - assert False + raise AssertionError(f"Unsupported MiniWalletMode: {self._mode}")🧰 Tools
🪛 Ruff (0.8.2)
201-201: Do not
assert False(python -Oremoves these calls), raiseAssertionError()Replace
assert False(B011)
209-217: Streamlined transaction signing logic with better error handlingThe refactored code now handles each mode case distinctly, making the logic clearer. However, the same issue with
assert Falseexists here.if self._mode == MiniWalletMode.RAW_P2PK: self.sign_tx(tx) elif self._mode == MiniWalletMode.RAW_OP_TRUE: tx.vin[0].scriptSig = CScript([OP_NOP] * 24) # pad to identical size elif self._mode == MiniWalletMode.ADDRESS_OP_TRUE: tx.vin[0].scriptSig = CScript([CScript([OP_TRUE])]) else: - assert False + raise AssertionError(f"Unsupported MiniWalletMode: {self._mode}")🧰 Tools
🪛 Ruff (0.8.2)
216-216: Do not
assert False(python -Oremoves these calls), raiseAssertionError()Replace
assert False(B011)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
depends/Makefile(1 hunks)depends/gen_id(2 hunks)test/functional/test_framework/wallet.py(4 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
test/functional/test_framework/wallet.py
201-201: Do not assert False (python -O removes these calls), raise AssertionError()
Replace assert False
(B011)
216-216: Do not assert False (python -O removes these calls), raise AssertionError()
Replace assert False
(B011)
🔇 Additional comments (7)
test/functional/test_framework/wallet.py (3)
77-77: Refactoring to use_modefor internal state managementThe change from using separate
_priv_keyand_addressattributes to a single_modeattribute improves the design by centralizing the wallet's operational mode state.
115-115: Improved assertion check using the new mode-based approachChecking against
MiniWalletMode.RAW_P2PKis more expressive and consistent with the refactored mode-based design.
144-144: Consistent mode-based assertionThis change maintains consistency with the refactoring by checking the mode rather than the presence of an attribute.
depends/gen_id (3)
3-5: Updated documentation to include new variablesThe changes to the usage comment properly document the supported environment variables
C_STANDARDandCXX_STANDARDthat can be provided to the script.
43-43: Added C standard output to build ID generationThis change ensures that the C standard version is captured in the build ID, which helps with build reproducibility.
50-50: Added C++ standard output to build ID generationThis change ensures that the C++ standard version is captured in the build ID, which helps with build reproducibility.
depends/Makefile (1)
147-148: Updated build ID generation to include language standardsIncluding
C_STANDARDandCXX_STANDARDin the build ID calculation ensures that changes to language standards will trigger appropriate rebuilds of dependencies.This is a good improvement to the build system as it increases build determinism by capturing more of the build environment configuration in the build ID. It works together with the changes in
depends/gen_idto ensure consistent dependency rebuilds when C or C++ standards change.
|
Hello @PastaPastaPasta , requesting review |
|
Hello @PastaPastaPasta, requesting review |
bitcoin backport cryptotura