Skip to content

Conversation

@theStack
Copy link
Contributor

prototypes used in src/test/script_tests.cpp:

  • CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int nValue = 0);
  • CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CTransaction& txCredit);

prototypes used in bench/verify_script.cpp:

  • CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey);
  • CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMutableTransaction& txCredit);

The more generic versions from the script tests are moved into setup_common.cpp and the calls are adapted accordingly in the verify_script benchmark (passing the nValue of 1 explicitely for BuildCreditingTransaction(), passing empty scriptWitness explicitely and converting txCredit parameter to CTransaction in BuildSpendingTransaction()).

@fanquake fanquake added the Tests label Oct 18, 2019
@maflcko
Copy link
Member

maflcko commented Oct 18, 2019

re-run ci

@maflcko maflcko closed this Oct 18, 2019
@maflcko maflcko reopened this Oct 18, 2019
@theStack
Copy link
Contributor Author

re-run ci

Thanks. Unfortunately it has failed again, with another reason this time though (Job lint macOS 10.12 (compat)):

==> Pouring portable-ruby--2.6.3.mavericks.bottle.tar.gz
...
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.

@maflcko maflcko mentioned this pull request Oct 19, 2019
@theStack theStack force-pushed the 20191018-refactor-deduplicate_build_transaction_functions branch 2 times, most recently from cd6e71b to 8fdd33b Compare October 21, 2019 20:28
@theStack
Copy link
Contributor Author

Still not 100% sure about the name of the new file (currently named transaction_utils.h/cpp). Should it also have the suffix _common to show that it is shared between the unit tests and the benchmarks? Open for any suggestions.

prototypes used in src/test/script_tests.cpp:
- CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int nValue = 0);
- CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CTransaction& txCredit);

prototypes used in bench/verify_script.cpp:
- CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey);
- CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMutableTransaction& txCredit);

The more generic versions from the script tests are moved into a new file pair
transaction_utils.cpp/h and the calls are adapted accordingly in the
verify_script benchmark (passing the nValue of 1 explicitely for
BuildCreditingTransaction(), passing empty scriptWitness explicitely and
converting txCredit parameter to CTransaction in BuildSpendingTransaction()).
@theStack theStack force-pushed the 20191018-refactor-deduplicate_build_transaction_functions branch from 8fdd33b to a0fc076 Compare October 23, 2019 00:01
@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:

  • #16540 (test: Add ASSERT_DEBUG_LOG to unit test framework by MarcoFalke)
  • #15845 (wallet: Fast rescan with BIP157 block filters by MarcoFalke)

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 pushed a commit to maflcko/bitcoin-core that referenced this pull request Oct 23, 2019
…ding}Transaction()

a0fc076 refactor: test/bench: dedup Build{Crediting,Spending}Transaction() (Sebastian Falbesoner)

Pull request description:

  prototypes used in `src/test/script_tests.cpp`:
  - `CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int nValue = 0);`
  - `CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CTransaction& txCredit);`

  prototypes used in `bench/verify_script.cpp`:
  - `CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey);`
  - `CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMutableTransaction& txCredit);`

  The more generic versions from the script tests are moved into `setup_common.cpp` and the calls are adapted accordingly in the verify_script benchmark (passing the nValue of 1 explicitely for `BuildCreditingTransaction()`, passing empty scriptWitness explicitely and converting txCredit parameter to CTransaction in `BuildSpendingTransaction()`).

Top commit has no ACKs.

Tree-SHA512: 8444f8a18f15070eeec1e5dfd255b55a851dfc2e6647c12b1995a6f7abd7196e830db2181d0e860bcd4cf4c815967584a3756dd450346bca70649dd1d4493e04
@maflcko maflcko merged commit a0fc076 into bitcoin:master Oct 23, 2019
@maflcko
Copy link
Member

maflcko commented Oct 23, 2019

Thanks. ACK

deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Apr 22, 2020
Summary:
prototypes used in src/test/script_tests.cpp:
- CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int nValue = 0);
- CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CTransaction& txCredit);

prototypes used in bench/verify_script.cpp:
- CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey);
- CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMutableTransaction& txCredit);

The more generic versions from the script tests are moved into a new file pair
transaction_utils.cpp/h and the calls are adapted accordingly in the
verify_script benchmark (passing the nValue of 1 explicitely for
BuildCreditingTransaction(), passing empty scriptWitness explicitely and
converting txCredit parameter to CTransaction in BuildSpendingTransaction()).

This is a backport of Core [[bitcoin/bitcoin#17183 | PR17183]]

The benchmark in question was deleted because segwit dependent, but it may be a good time to resurrect it.

Test Plan:
  make check
  ninja check

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D5806
ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request Aug 17, 2020
Summary:
prototypes used in src/test/script_tests.cpp:
- CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int nValue = 0);
- CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CTransaction& txCredit);

prototypes used in bench/verify_script.cpp:
- CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey);
- CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMutableTransaction& txCredit);

The more generic versions from the script tests are moved into a new file pair
transaction_utils.cpp/h and the calls are adapted accordingly in the
verify_script benchmark (passing the nValue of 1 explicitely for
BuildCreditingTransaction(), passing empty scriptWitness explicitely and
converting txCredit parameter to CTransaction in BuildSpendingTransaction()).

This is a backport of Core [[bitcoin/bitcoin#17183 | PR17183]]

The benchmark in question was deleted because segwit dependent, but it may be a good time to resurrect it.

Test Plan:
  make check
  ninja check

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D5806
@theStack theStack deleted the 20191018-refactor-deduplicate_build_transaction_functions branch December 1, 2020 09:57
@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.

5 participants