Page MenuHomePhabricator

fix inappropriate uses of virtual size
ClosedPublic

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

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC1196ec83ae81: fix inappropriate uses of virtual size
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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.