Skip to content

Commit c2f4825

Browse files
committed
bip-0300: Add some guesstimate weight adjustments
1 parent 796c80e commit c2f4825

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

bip-0300.mediawiki

+47
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,53 @@ without it, sidechain numbers 0 and 128 would cause the legacy script interprete
429429

430430
If an OP_DRIVECHAIN input is spent, the additional rules for M5 or M6 (see above) must be enforced.
431431

432+
====Weight adjustments====
433+
434+
To account for the additional drivechain checks, each message adds to the block's weight:
435+
436+
{|class="wikitable"
437+
! Message !! Additional weight
438+
|-
439+
| M1 || 840
440+
|-
441+
| M2 || 336
442+
|-
443+
| M3 || 848
444+
|-
445+
| M4 || ?
446+
|-
447+
| M5 || 340
448+
|-
449+
| M6 || 352
450+
|}
451+
452+
<!--
453+
get: 168 WU for 1 byte
454+
delete: free?
455+
create: 168 WU for 33 bytes
456+
hash: 4 WU??
457+
search outputs: ?
458+
permanent "proposal rejected" lookup: infinite??
459+
read prev block: a lot?? maybe store...
460+
comparison: 4 WU?
461+
encode script: ?
462+
463+
M1: 3 get, 2 create
464+
M2: 1 get, 1 delete, 1 create
465+
M3: 3 get, 1 delete, 2 create, 2 hash
466+
for each coinbase output: search for prior M3 for this sidechain
467+
lookup if M3 was ever rejected or paid in the past
468+
for each prior proposed withdrawl: (included in 1 get+delete+create)
469+
M4: 1 get
470+
+ for every proposed withdraw, 1 get, 1 delete, 1 create, 1 add
471+
v0 needs to read and parse previous block
472+
M5/M6 OP_DRIVECHAIN spends require 2 additional input lookups
473+
for each output: check for duplicate OP_DRIVECHAINs
474+
amount comparison
475+
M6: encode & compare fee amount, 2 hash, counter compare
476+
-->
477+
478+
432479
==Backward compatibility==
433480

434481
As a soft fork, older software will continue to operate without modification. Non-upgraded nodes will see a number of phenomena that they don't understand -- coinbase txns with non-txn data, value accumulating in anyone-can-spend UTXOs for months at a time, and then random amounts leaving these UTXOs in single, infrequent bursts. However, these phenomena don't affect them, or the validity of the money that they receive.

0 commit comments

Comments
 (0)