Skip to content

Conversation

@sipa
Copy link
Member

@sipa sipa commented Jun 10, 2020

I encountered difficulties with the test framework in #17977. This fixes them, and I think the change is generally useful.

This breaks the script->key->address->script dependency cycle.
@fanquake fanquake added the Tests label Jun 10, 2020
@DrahtBot
Copy link
Contributor

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

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.

@maflcko
Copy link
Member

maflcko commented Jun 10, 2020

cc @jnewbery

@laanwj
Copy link
Member

laanwj commented Jun 10, 2020

Code review ACK c75de5d

and I think the change is generally useful.

I think it makes conceptual sense as well now that base58 is only one of the address formats.

@maflcko
Copy link
Member

maflcko commented Jun 10, 2020

ACK c75de5d according to --color-moved=dimmed-zebra this is a move-only apart from the imports 👒

Show signature and timestamp

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

ACK c75de5da5fdd3a304f9da3d8a2e0370d1723ddd0 according to --color-moved=dimmed-zebra this is a move-only apart from the imports 👒
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUi9JQv9GtzM9DRsgO0BnO8JJfq58H6VDVwSvMuM1ZSKO1r7uB4F23/h1YYl0U16
Z3EV2I/YzYetLn2Bj+LwqOcQcJWE3cOqb8VxlRud4fLCjm48kssjos8W4eYA2tzY
IjzKnEOUEoq4dXatYOwmNMfnnoPBWR3RnItmTFqP6TkAQFViV11ltr+NbBzMET8I
w1zhkhOtGvPcxry2pcWeFVzo414DP6NfpPjiwQxYKI9JAzf+DxAIbJYZ2WlWjVRs
docESMvjbHvKmAP7oM2mZq5wJ231d3pRIC8/T+mbODmdclVjdjkUjz6sq2WcAG9x
xjJNoHNUClrP3bLOl5y7q5x+u5r/Z4GfoKT/+T1W8jIssReS8f5OK2QSyYZ6GQDh
9+ra2QB/vwkUU/Hqv2hCNveIqO+zuP86Zrgyeusphy6WM4IJrh7WZ/JZCVnrKvXd
DiKnSO/rSgL4ZrlW4gzcs7cfnhSGfuC29GWtA53aTuzDT5U86dNqM+rr3SGrtGAc
1UlcEIKi
=/Rus
-----END PGP SIGNATURE-----

Timestamp of file with hash 99fa2b205d75124baf7f30ed5ab5d28755a747c6e20eb143e6144df69ddfbd09 -

@maflcko maflcko merged commit 6762a62 into bitcoin:master Jun 10, 2020
@jnewbery
Copy link
Contributor

What was the circular dependency that this was fixing?

@jnewbery
Copy link
Contributor

Concept NACK. This just seems to be moving code around for no good reason. base58 is very much linked to legacy P2PKH and P2SH addresses, so it makes sense that the code for those things should live in the same module (see segwit_address.py where the bech32 and segwit v0 address code are in the same module). The only thing that imports base58 for any other reason are the bytes_to_wif() and generate_wif_key(). Those absolutely shouldn't be in key.py and I have no idea why they were put in a crypo module that previously had no imports.

@sipa
Copy link
Member Author

sipa commented Jun 10, 2020

@jnewbery The circular dependency was script->key->address->script, and I couldn't get the taproot tests to work without it.

If you have another solution, I'm all ears, but this seems like a generally clean solution to me.

@jnewbery
Copy link
Contributor

The circular dependency was script->key->address->script

script doesn't import key

@sipa
Copy link
Member Author

sipa commented Jun 10, 2020

Hmm! Perhaps that was fixed then. I wrote this a few months ago, and was annoyed about keeping to rebase it, so I PRed it separately.

@jnewbery
Copy link
Contributor

I don't think script has ever imported key in master. It does in your branch, but that doesn't seem like a good reason to open a PR against master

@sipa
Copy link
Member Author

sipa commented Jun 10, 2020

Oops, I see.

Still, I think this is generally an improvement.

@jnewbery
Copy link
Contributor

I'm simply giving you the feedback that I'd give any other contributor, including someone new to the project: moving the code around for no discernible benefit isn't a good use of reviewer resource.

I'm neutral on whether base58 should have its own module. The bech32 code seems to be perfectly happy in segwit_address.py and I don't see this as any different. I do think it's disappointing that his got two ACKs and was merged within 12 hours even though the motivation and commit log were wrong.

@sipa
Copy link
Member Author

sipa commented Jun 10, 2020

@jnewbery You're right about that. If I would have had the facts right, I would not have opened this PR.

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 10, 2020
…lar dependency

c75de5d [TESTS] Move base58 to own module to break circular dependency (Pieter Wuille)

Pull request description:

  I encountered difficulties with the test framework in bitcoin#17977. This fixes them, and I think the change is generally useful.

ACKs for top commit:
  laanwj:
    Code review ACK c75de5d
  MarcoFalke:
    ACK c75de5d according to --color-moved=dimmed-zebra this is a move-only apart from the imports 👒

Tree-SHA512: 9e0493de3e279074f0c70e92c959b73ae30479ad6f2083a3c6bbf4b0191d65ef94854559a5b7c904f5dadc5e93129ed00f6dc0a8ccce6ba7921cd45f7119f74b
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Aug 25, 2021
Summary:
generate_wif_key is a wallet utility function. Move
it from the EC key module to the wallet util module.

This is a backport of [[bitcoin/bitcoin#19239 | core#19239]]

Backport note: the revert commit is not relevant, we haven't backported [[bitcoin/bitcoin#19230 | core#19230]]

Test Plan: `ninja check-functional-extended`

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D9934
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants