[bitcoin-dev] In defense of a configurable LOT if LOT=false is released

Jeremy jlrubin at mit.edu
Mon Mar 1 20:32:34 UTC 2021

The short script* below could function as a cross platform (need only have
python 2 and curl) way to make a LOT=False function like a LOT=true node.
This sort of script was mentioned recently in the ##taproot-activation IRC

It is unclear to me with this sort of script what happens if a LOT=false
but running this script announces a to-be-marked-bad block to a similar
peer that has already marked that block invalid. It could lead to nodes
partitioning themselves from one another, but I am uncertain of the
particulars of invalidate block's relationship to DoS rules.

Therefore it may be a harm reduction, should core release with LOT=false,
to have opt-in configurability natively. Configurability is superior to a
situation where, near to the timeout with LOT=true seeming more likely,
users unable to switch binaries reach for such a convenience script.

The counterargument would be that running a script is still a hoop to jump
through more difficult than a config flag and we don't want user's choosing
consensus rules via config flags. However, it seems more in the spirit of
user choice to make the core release suitable for either preference.

*completely untested, unverified, never even run mind you -- obviously needs
review before actually running it

1         import sys, json, subprocess
 2         from time import sleep
 3         LOTHEIGHT=600000
 4         LOTSTOP= LOTHEIGHT + 2016
 5         FORK="taproot"
 6         credential="blah:blah"
 7         host = ""
 8         contenttype ='content-type:text/plain;'
 9         def make_command(command, args):
10             return json.dumps({"jsonrpc": "1.0",
11             "id":"curltext",
12             "method": command,
13             "params": args})
14         def call(command, args):
15             res = subprocess.run("curl", ["--user", credential,
"--data-binary", make_command(command, args), "-H", contenttype, host])
16             return res.stdout
18         should_sleep = False
19         while True:
20             if should_sleep: sleep(10)
21             should_sleep = True
22             try:
23                 data = json.load(call("getblockchaininfo", []))
24                 possible = True
25                 if data['blocks']  >= LOTHEIGHT and data['blocks'] <
26                     if not
27                         call("invalidateblock", [data["bestblockhash"]])
28                         should_sleep = False
29             except: pass
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210301/6af8007d/attachment.html>

More information about the bitcoin-dev mailing list