Page MenuHomePhabricator

Merge #10537: Few Minor per-utxo assert-semantics re-adds and tweak
ClosedPublic

Authored by nakihito on Jul 3 2019, 21:43.

Details

Summary

9417d7a33 Be much more agressive in AccessCoin docs. (Matt Corallo)
f58349ca8 Restore some assert semantics in sigop cost calculations (Matt Corallo)
3533fb4d3 Return a bool in SpendCoin to restore pre-per-utxo assert semantics (Matt Corallo)
ec1271f2b Remove useless mapNextTx lookup in CTxMemPool::TrimToSize. (Matt Corallo)

Tree-SHA512: 158a4bce063eac93e1d50709500a10a7cb1fb3271f10ed445d701852fce713e2bf0da3456088e530ab005f194ef4a2adf0c7cb23226b160cecb37a79561f29ca

Backport of Core PR10537
https://github.com/bitcoin/bitcoin/pull/10537/

Test Plan
make check
test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR10537
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6658
Build 11363: Bitcoin ABC Teamcity Staging
Build 11362: arc lint + arc unit

Event Timeline

nakihito created this revision.Jul 3 2019, 21:43
Owners added a reviewer: Restricted Owners Package.Jul 3 2019, 21:43
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 3 2019, 21:43
nakihito planned changes to this revision.Jul 3 2019, 21:43
nakihito requested review of this revision.Jul 5 2019, 18:44

coins.cpp changes were previously made here: https://reviews.bitcoinabc.org/D470
consensus/tx_verify.cpp changes were made here: https://reviews.bitcoinabc.org/D1739 (note: GetTransactionSigOpCost() was never added)
validation.cpp changes made here: https://reviews.bitcoinabc.org/D1479 and here: https://reviews.bitcoinabc.org/D471#change-8J68DPC7df8b

Fabien requested changes to this revision.Jul 5 2019, 21:25

The changes to consensus/tx_verify.cpp need to be backported. It's not in our codebase.

This revision now requires changes to proceed.Jul 5 2019, 21:25
nakihito added a comment.Jul 5 2019, 23:11
In D3542#84072, @Fabien wrote:

The changes to consensus/tx_verify.cpp need to be backported. It's not in our codebase.

The first change to consensus/tx_verify.cpp to GetP2SHSigOpCount() is already there. Its been turned into the function .GetOutputFor():

  const CTxOut &CCoinsViewCache::GetOutputFor(const CTxIn &input) const {
	    const Coin &coin = AccessCoin(input.prevout);
	    assert(!coin.IsSpent());
	    return coin.GetTxOut();
  }

The second change is to GetTransactionSigOpCost() but that should have been added in D1739. See https://github.com/bitcoin/bitcoin/pull/8329/files for comparison.

nakihito requested review of this revision.Sep 6 2019, 17:16
Fabien accepted this revision.Sep 9 2019, 09:16
This revision is now accepted and ready to land.Sep 9 2019, 09:16