Page MenuHomePhabricator

fix inappropriate uses of virtual size
ClosedPublic

Authored by markblundeberg on Jan 11 2020, 09:20.

Details

Summary

In Bitcoin Core, virtual size has two meanings:

  1. BIP 141 defines virtual size = weight/4 (rounded up), i.e. transaction size plus witness size divided by 4. (https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#additional-definitions )
  1. Virtual size = max(weight, sigopscost*bytespersigop) / 4 rounded up, used in all mempool code to punish very very high sigops transactions.

Currently we have no code that uses meaning #2, but we do have some weird
backported code that uses meaning #1, which is definitely inappropriate
for BCH since we don't have segwit.

This diff removes that stuff and also removes the ability to ask for
virtual size in the BIP141 convention (without a sigops count), which is always
going to be a conceptual mistake in our codebase.

(see D3655 D3316 D3180 D3243)

Test Plan

ninja all check bench-bitcoin

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markblundeberg edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jan 11 2020, 13:28