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

backport: merge bitcoin#19143, #20377, #20946, #20936, #21226, #21264, #19259, #21380, #21489, #19288, #19055, #20882, #21185, #21115, partial bitcoin#11389 (fuzzing harness backports: part 6) #5548

Merged
merged 17 commits into from
Aug 30, 2023

Conversation

kwvg
Copy link
Collaborator

@kwvg kwvg commented Aug 26, 2023

Motivation

Updating libsecp256k1 (which is required to integrate fixes, improvements and new APIs and capabilities, such as secp256k1#1129 needed for BIP324) involves not only updating the subtree but also usage of library APIs (such as the removal of ECCVerifyHandle from fuzzing code, commit).

In the past, this has created problems where updates to API usage include updates to portions of code implementing features Dash has deprioritized/omitted (see dash#4332, where API updates in Taproot-specific code had to be omitted, rendering the backport partial).

To avoid this from happening, this PR aims to backport the necessary changes needed to be able to backport the updates to libsecp256k1 and does it alongside some general backports related to fuzzing.

Additional Notes

  • hdwallet.cpp has been moved from libbitcoin_common to libbitcoin_wallet to avoid linker failures that were apparent once some fuzzing backports were done.

    Linker errors:

    /usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
    libbitcoin_wallet.a(libbitcoin_wallet_a-rpcwallet.o): in function `getwalletinfo(JSONRPCRequest const&)':
    rpcwallet.cpp:(.text+0x4db2d): undefined reference to `CHDChain::CountAccounts()'
    /usr/bin/ld: rpcwallet.cpp:(.text+0x4dc15): undefined reference to `CHDChain::CountAccounts()'
    /usr/bin/ld: rpcwallet.cpp:(.text+0x4dd42): undefined reference to `CHDChain::GetAccount(unsigned int, CHDAccount&)'
    /usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
    libbitcoin_wallet.a(libbitcoin_wallet_a-scriptpubkeyman.o): in function `LegacyScriptPubKeyMan::CheckDecryptionKey(std::vector<unsigned char, secure_allocator<unsigned char> > const&, bool)':
    scriptpubkeyman.cpp:(.text+0x1041): undefined reference to `CHDChain::IsNull() const'
    /usr/bin/ld: scriptpubkeyman.cpp:(.text+0x1058): undefined reference to `CHDChain::IsNull() const'
    /usr/bin/ld: scriptpubkeyman.cpp:(.text+0x11a9): undefined reference to `CHDChain::GetSeedHash()'
    /usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-scriptpubkeyman.o): in function `LegacyScriptPubKeyMan::DecryptHDChain(std::vector<unsigned char, secure_allocator<unsigned char> > const&, CHDChain&) const':
    [...]
    rpcdump.cpp:(.text+0x216d8): undefined reference to `CHDChain::GetMnemonic(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> >&) const'
    /usr/bin/ld: rpcdump.cpp:(.text+0x217a3): undefined reference to `CHDChain::GetSeed() const'
    /usr/bin/ld: rpcdump.cpp:(.text+0x21a44): undefined reference to `CHDChain::CountAccounts()'
    /usr/bin/ld: rpcdump.cpp:(.text+0x21a6e): undefined reference to `CHDChain::GetAccount(unsigned int, CHDAccount&)'
    /usr/bin/ld: rpcdump.cpp:(.text+0x21b80): undefined reference to `CHDChain::CountAccounts()'
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

  • The original backport of bitcoin#18353 done in dash#4829 (segment) omitted ShellEscape, presumably to ensure that it compiles on Windows.

    Bitcoin resolved this with bitcoin#21115, which has been backported in this pull request, hence the backport doesn't only do the changes necessary for Windows compilation but also includes previously omitted changes.

@kwvg kwvg changed the title backport: merge bitcoin#19143, #20377, #20946, #20936, #21226, #21264, #19259, #21380, #21489, #19288, #19055, #20882, #21185, partial bitcoin#11389 (fuzzing harness backports: part 6) backport: merge bitcoin#19143, #20377, #20946, #20936, #21226, #21264, #19259, #21380, #21489, #19288, #19055, #20882, #21185, #21115, partial bitcoin#11389 (fuzzing harness backports: part 6) Aug 26, 2023
@kwvg kwvg marked this pull request as ready for review August 26, 2023 18:10
@UdjinM6
Copy link

UdjinM6 commented Aug 26, 2023

11389: should include 18e0718 imo (simply set BIP16Height = 0; // always enforce P2SH BIP16 for all networks in chainparams)

@kwvg
Copy link
Collaborator Author

kwvg commented Aug 26, 2023

11389: should include 18e0718 imo (simply set BIP16Height = 0; // always enforce P2SH BIP16 for all networks in chainparams)

@UdjinM6, resolved in latest push

@UdjinM6 UdjinM6 added this to the 20 milestone Aug 26, 2023
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

LGTM, utACK

Copy link
Collaborator

@knst knst left a comment

Choose a reason for hiding this comment

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

utACK

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK for merging via merge commit

kwvg added 16 commits August 29, 2023 21:55
…le, LoadExternalBlockFile and other FILE* consumers

includes:
- ad6c348
Required to resolve link failures:

```
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
libbitcoin_wallet.a(libbitcoin_wallet_a-rpcwallet.o): in function `getwalletinfo(JSONRPCRequest const&)':
rpcwallet.cpp:(.text+0x4db2d): undefined reference to `CHDChain::CountAccounts()'
/usr/bin/ld: rpcwallet.cpp:(.text+0x4dc15): undefined reference to `CHDChain::CountAccounts()'
/usr/bin/ld: rpcwallet.cpp:(.text+0x4dd42): undefined reference to `CHDChain::GetAccount(unsigned int, CHDAccount&)'
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
libbitcoin_wallet.a(libbitcoin_wallet_a-scriptpubkeyman.o): in function `LegacyScriptPubKeyMan::CheckDecryptionKey(std::vector<unsigned char, secure_allocator<unsigned char> > const&, bool)':
scriptpubkeyman.cpp:(.text+0x1041): undefined reference to `CHDChain::IsNull() const'
/usr/bin/ld: scriptpubkeyman.cpp:(.text+0x1058): undefined reference to `CHDChain::IsNull() const'
/usr/bin/ld: scriptpubkeyman.cpp:(.text+0x11a9): undefined reference to `CHDChain::GetSeedHash()'
/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-scriptpubkeyman.o): in function `LegacyScriptPubKeyMan::DecryptHDChain(std::vector<unsigned char, secure_allocator<unsigned char> > const&, CHDChain&) const':
[...]
rpcdump.cpp:(.text+0x216d8): undefined reference to `CHDChain::GetMnemonic(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> >&) const'
/usr/bin/ld: rpcdump.cpp:(.text+0x217a3): undefined reference to `CHDChain::GetSeed() const'
/usr/bin/ld: rpcdump.cpp:(.text+0x21a44): undefined reference to `CHDChain::CountAccounts()'
/usr/bin/ld: rpcdump.cpp:(.text+0x21a6e): undefined reference to `CHDChain::GetAccount(unsigned int, CHDAccount&)'
/usr/bin/ld: rpcdump.cpp:(.text+0x21b80): undefined reference to `CHDChain::CountAccounts()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
contains:
- b111410
- 01297fb

completes:
- c7eb44a (from dash#4704)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants