Skip to content

Conversation

@sipa
Copy link
Member

@sipa sipa commented Sep 16, 2019

As suggested here: #16800 (comment).

This moves the Span parsing functions out of the descriptor module, making them more easily usable for other parsers (in particular, in preparation for miniscript parsing).

@promag
Copy link
Contributor

promag commented Sep 16, 2019

ACK c072446b5c7fbaabcd17494d1b593b1cb5ebc314, verified it's mostly moved code - new code is just forward declarations, license and include guards.

@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 16, 2019

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #13751 (Utils and libraries: Drops the boost/algorithm/string/split.hpp dependency by l2a5b1)

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.

@laanwj
Copy link
Member

laanwj commented Sep 18, 2019

Concept ACK.

Now that these functions are public, would be nice to have unit tests.

@sipa sipa force-pushed the 201909_spanparsing branch from c072446 to 5e69aee Compare September 18, 2019 19:26
@theStack
Copy link
Contributor

utACK 230d43f 5e69aee

Now that these functions are public, would be nice to have unit tests.

I would be interested to work on that.

@sipa
Copy link
Member Author

sipa commented Sep 20, 2019

@theStack Be my guest!

@theStack
Copy link
Contributor

@theStack Be my guest!

Unit tests for the Span-parsing helpers are ready, will open a PR for them as soon as this one is merged in (I guess it's not possible to open a PR which depends on another PR, right?)

@sipa
Copy link
Member Author

sipa commented Sep 24, 2019

@theStack You can post a commit, and I can include it in my PR. You can also open a PR against my branch.

@fanquake
Copy link
Member

You can post a commit, and I can include it in my PR.

👍 Then we can have the tests alongside the changes in the same PR. @theStack obviously your changes remain attributed to you.

@theStack
Copy link
Contributor

@sipa @fanquake Okay, here we go: theStack@f4db52f

@laanwj
Copy link
Member

laanwj commented Sep 25, 2019

ACK 5e69aee
ACK f4db52f

@theStack thanks !

@laanwj
Copy link
Member

laanwj commented Oct 3, 2019

@sipa if you agree with @theStack's tests, please pull the commit in here

@sipa
Copy link
Member Author

sipa commented Oct 3, 2019

Will do next week.

tests the following four functions:
    - Const() [parse constant]
    - Func()  [parse function]
    - Expr()  [parse expression]
    - Split() [split up a string]
@sipa
Copy link
Member Author

sipa commented Oct 10, 2019

Thanks, @theStack; I've included your commit.

@practicalswift
Copy link
Contributor

The parsing heavy functions Const, Func, Expr and Split all seem like good candidates for fuzz testing (in addition to the ordinary unit testing)?

@maflcko
Copy link
Member

maflcko commented Oct 10, 2019

ACK bb36372

Show signature and timestamp

Signature:

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

ACK bb36372b8f2bd675313ae8553ceb61f28c2c1afd
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUjmOwwAi3Ad7AG9map87wVhJiT68gHzVlnpfujDXkepHRMoqt3E2T9zQuFk1QvW
m11WLTcf7VpTrn+zgGJ90w9HW3ovvNivHCCqwds5R+Rh2MW3u2cQJ7DkRQH7VePJ
B+VLLRXXuCq98kzF7XGqViyqmIA10tA+0rZ2DcIH8jguRsg9mLPybDlN1z+8j2c/
CHvb99LxnKiCHd0z7NgWXr1JsPsh97W5pnDABMybEfG3Oblh0DD/JdVf/w6cdWQD
vD/zuy54Re0CEA8Y4CUviw0OtlfHdiRsqepumXACMxJTvA/EzxOIHpaQZpj/pDOL
YzxHjBmrV/I4fYekscpA+uaPVwKvzHnOEQtZIBFs2/jK1FoaXfBdzSYvorj9V4q5
+DwFPa4aye0lVslBo9sED6ehUzLsP50tF80XrLudTAEKTWjUAaIUf0Mfe/6y4Op3
+XeEvhjOr33N7f6w3a+jdX2DR0MsRMCLZ4FPlLatGVGCfqgPtIWcxi5Bxitmdrla
Gagqrt9v
=NYw8
-----END PGP SIGNATURE-----

Timestamp of file with hash fb19a80d964f70a8c4b0e02b5fb1088d6d3c529398648e56d30d9e2f6fb4ba33 -

@maflcko
Copy link
Member

maflcko commented Oct 10, 2019

Pretty straightforward move-only commit and then a commit adding tests, going to merge now.

maflcko pushed a commit that referenced this pull request Oct 10, 2019
bb36372 test: add unit tests for Span-parsing helpers (Sebastian Falbesoner)
5e69aee Add documenting comments to spanparsing.h (Pieter Wuille)
230d43f Abstract out some of the descriptor Span-parsing helpers (Pieter Wuille)

Pull request description:

  As suggested here: #16800 (comment).

  This moves the Span parsing functions out of the descriptor module, making them more easily usable for other parsers (in particular, in preparation for miniscript parsing).

ACKs for top commit:
  MarcoFalke:
    ACK bb36372

Tree-SHA512: b5c5c11a9bc3f0a1c2c4cfa22755654ecfb8d4b69da0dc1fb9f04e1556dc0f6ffd87ad153600963279ac465d587d7971b53d240ced802d12693682411ac73deb
@maflcko maflcko merged commit bb36372 into bitcoin:master Oct 10, 2019
@promag
Copy link
Contributor

promag commented Oct 10, 2019

reACK 230d43f, utACK bb36372.

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 11, 2019
… helpers

bb36372 test: add unit tests for Span-parsing helpers (Sebastian Falbesoner)
5e69aee Add documenting comments to spanparsing.h (Pieter Wuille)
230d43f Abstract out some of the descriptor Span-parsing helpers (Pieter Wuille)

Pull request description:

  As suggested here: bitcoin#16800 (comment).

  This moves the Span parsing functions out of the descriptor module, making them more easily usable for other parsers (in particular, in preparation for miniscript parsing).

ACKs for top commit:
  MarcoFalke:
    ACK bb36372

Tree-SHA512: b5c5c11a9bc3f0a1c2c4cfa22755654ecfb8d4b69da0dc1fb9f04e1556dc0f6ffd87ad153600963279ac465d587d7971b53d240ced802d12693682411ac73deb
maflcko pushed a commit that referenced this pull request Oct 16, 2019
…helpers

58d67f1 tests: Add fuzzing harness for descriptor Span-parsing helpers (practicalswift)

Pull request description:

  Add fuzzing harness for descriptor Span-parsing helpers (`spanparsing`).

  As suggested by a fuzz testing enthusiast in #16887 (comment).

  **Testing this PR**

  Run:

  ```
  $ CC=clang CXX=clang++ ./configure --enable-fuzz \
        --with-sanitizers=address,fuzzer,undefined
  $ make
  $ src/test/fuzz/spanparsing
  ```

ACKs for top commit:
  MarcoFalke:
    re-ACK 58d67f1

Tree-SHA512: 5eaca9fcda2856e0dcfeb4a98a2dc97051ae6251f7642b92fdae3ff96bb95ccb0377ee4e6c6b531e59061983b8d9485a5282467f2ab1d614861f60202a893b1c
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jul 9, 2020
… helpers

Summary:
bitcoin/bitcoin@230d43f

---

Partial backport of Core [[bitcoin/bitcoin#16887 | PR16887]]

Test Plan:
  ninja check

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6877
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jul 9, 2020
Summary:
bitcoin/bitcoin@5e69aee

---

Depends on D6877

Partial backport of Core [[bitcoin/bitcoin#16887 | PR16887]]

Test Plan:
  read the comments

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6878
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jul 9, 2020
Summary:
tests the following four functions:
    - Const() [parse constant]
    - Func()  [parse function]
    - Expr()  [parse expression]
    - Split() [split up a string]

bitcoin/bitcoin@bb36372

---

Depends on D6878

Concludes backport of Core [[bitcoin/bitcoin#16887 | PR16887]]

Test Plan:
  ninja check-bitcoin-util_tests

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6879
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jul 9, 2020
…ng helpers

Summary:
58d67f1cc068c3779e309dc8a82ce33158c3e5b2 tests: Add fuzzing harness for descriptor Span-parsing helpers (practicalswift)

Pull request description:

  Add fuzzing harness for descriptor Span-parsing helpers (`spanparsing`).

  As suggested by a fuzz testing enthusiast in bitcoin/bitcoin#16887 (comment).

  **Testing this PR**

  Run:

  ```
  $ CC=clang CXX=clang++ ./configure --enable-fuzz \
        --with-sanitizers=address,fuzzer,undefined
  $ make
  $ src/test/fuzz/spanparsing
  ```

---

Depends on D6879

Backport of Core [[bitcoin/bitcoin#17113 | PR17113]]

Test Plan:
  cmake -GNinja .. -DENABLE_SANITIZERS="address;fuzzer" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
  ninja bitcoin-fuzzers link-fuzz-test_runner.py

run `./src/test/fuzz/spanparsing` for a few seconds

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6880
kwvg added a commit to kwvg/dash that referenced this pull request Oct 29, 2021
pravblockc pushed a commit to pravblockc/dash that referenced this pull request Nov 18, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants