From: Jeremy <jlrubin@mit.edu>
To: Bitcoin development mailing list <bitcoin-dev@lists.linuxfoundation.org>
Subject: [bitcoin-dev] In defense of a configurable LOT if LOT=false is released
Date: Mon, 1 Mar 2021 12:32:34 -0800 [thread overview]
Message-ID: <CAD5xwhidE-cnNe_g=7PvxUtp2=_RCGfOSadYgtx8FO6Tj634Hw@mail.gmail.com> (raw)
[-- 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 --]
reply other threads:[~2021-03-01 20:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAD5xwhidE-cnNe_g=7PvxUtp2=_RCGfOSadYgtx8FO6Tj634Hw@mail.gmail.com' \
--to=jlrubin@mit.edu \
--cc=bitcoin-dev@lists.linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox