HomePhabricator

redefine virtual transaction size to something useful

Description

redefine virtual transaction size to something useful

Summary:
Currently GetVirtualTransactionSize is a useless placeholder function that
simply returns size, also its comment describes it as having to do with
weight.

Redefine it to be useful: for dense-sigops transactions, it increases above
the actual size, representing the 'excess resources' consumed. Accordingly
the default value for nBytesPerSigOp is increased from 20 to 50, a number
based on actual consensus limits.

This is analogous to what Core does in the mempool sense of virtual size,
but really it's very different since we don't have segwit witness weight
and their choice of sigops constant is too permissive: Core's definition
is max(weight, nsigopscost * 20)/4, i.e., max(bip141size, nsigopscount * 20).

(Note: as of this Diff, nothing in the codebase uses virtual size.)

Depends on D4895 and D4898

Test Plan: ninja check

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

Details

Provenance
Mark Lundeberg <markblundeberg@users.noreply.github.com>Authored on Jan 11 2020, 08:28
markblundebergPushed on Jan 13 2020, 00:06
Reviewer
Restricted Project
Differential Revision
D4896: redefine virtual transaction size to something useful
Parents
rSTAGINGe4a435d58f82: remove segwit 'sigops cost' leftovers
Branches
Unknown
Tags
Unknown