public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [bitcoin-dev] In defense of a configurable LOT if LOT=false is released
@ 2021-03-01 20:32 Jeremy
  0 siblings, 0 replies; only message in thread
From: Jeremy @ 2021-03-01 20:32 UTC (permalink / raw)
  To: Bitcoin development mailing list

[-- Attachment #1: Type: text/plain, Size: 2542 bytes --]

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
channel.

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 = "http://127.0.0.1:8332"
 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
17
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'] <
LOTSTOP:
26                     if not
data['softforks'][FORK]['statistics']['possible']:
27                         call("invalidateblock", [data["bestblockhash"]])
28                         should_sleep = False
29             except: pass

[-- Attachment #2: Type: text/html, Size: 5752 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-01 20:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01 20:32 [bitcoin-dev] In defense of a configurable LOT if LOT=false is released Jeremy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox