HomePhabricator

fix inappropriate uses of virtual size

Description

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

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D4895

Details

Provenance
Mark Lundeberg <markblundeberg@users.noreply.github.com>Authored on Jan 11 2020, 08:40
markblundebergPushed on Jan 12 2020, 02:48
Reviewer
Restricted Project
Differential Revision
D4895: fix inappropriate uses of virtual size
Parents
rSTAGING5c61837cc260: Wrap paths in codeblocks in release-process.md
Branches
Unknown
Tags
Unknown

Event Timeline

Mark Lundeberg <markblundeberg@users.noreply.github.com> committed rSTAGING1196ec83ae81: fix inappropriate uses of virtual size (authored by Mark Lundeberg <markblundeberg@users.noreply.github.com>).Jan 12 2020, 02:43