summaryrefslogtreecommitdiff
path: root/bip-0300.mediawiki
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2023-07-26 20:39:45 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2023-07-26 20:39:45 +0000
commitc2f4825550b5e13df0c8db650610808e1869cefd (patch)
treebcfc3b65b622dbfca7f54caab68a1c5be046703e /bip-0300.mediawiki
parent796c80eb9d78ba5bf64505fab11896c24030e9cf (diff)
downloadbips-c2f4825550b5e13df0c8db650610808e1869cefd.tar.xz
bip-0300: Add some guesstimate weight adjustments
Diffstat (limited to 'bip-0300.mediawiki')
-rw-r--r--bip-0300.mediawiki47
1 files changed, 47 insertions, 0 deletions
diff --git a/bip-0300.mediawiki b/bip-0300.mediawiki
index 0a7315b..ab81c32 100644
--- a/bip-0300.mediawiki
+++ b/bip-0300.mediawiki
@@ -429,6 +429,53 @@ without it, sidechain numbers 0 and 128 would cause the legacy script interprete
If an OP_DRIVECHAIN input is spent, the additional rules for M5 or M6 (see above) must be enforced.
+====Weight adjustments====
+
+To account for the additional drivechain checks, each message adds to the block's weight:
+
+{|class="wikitable"
+! Message !! Additional weight
+|-
+| M1 || 840
+|-
+| M2 || 336
+|-
+| M3 || 848
+|-
+| M4 || ?
+|-
+| M5 || 340
+|-
+| M6 || 352
+|}
+
+<!--
+get: 168 WU for 1 byte
+delete: free?
+create: 168 WU for 33 bytes
+hash: 4 WU??
+search outputs: ?
+permanent "proposal rejected" lookup: infinite??
+read prev block: a lot?? maybe store...
+comparison: 4 WU?
+encode script: ?
+
+M1: 3 get, 2 create
+M2: 1 get, 1 delete, 1 create
+M3: 3 get, 1 delete, 2 create, 2 hash
+ for each coinbase output: search for prior M3 for this sidechain
+ lookup if M3 was ever rejected or paid in the past
+ for each prior proposed withdrawl: (included in 1 get+delete+create)
+M4: 1 get
+ + for every proposed withdraw, 1 get, 1 delete, 1 create, 1 add
+ v0 needs to read and parse previous block
+M5/M6 OP_DRIVECHAIN spends require 2 additional input lookups
+ for each output: check for duplicate OP_DRIVECHAINs
+ amount comparison
+ M6: encode & compare fee amount, 2 hash, counter compare
+-->
+
+
==Backward compatibility==
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.