Skip to content

Instantly share code, notes, and snippets.

@jamesob
jamesob / bmon.log
Created May 31, 2023 14:15
Mempool is bogus
tx: https://mempool.space/tx/7bea4b346f6143dd824f8db8b739e93e414b29c2b2b9c06c9b2edf395e46fff9
block: https://mempool.space/block/000000000000000000003a3e1ed4bced6c52acb1a684d00607b00944e79ce3aa
10:12:34 james@tacoma src/bmon (?± master 3062ef8) % bmon-infra rg "(7bea4b346f6143dd824f8db8b739e93e414b29c2b2b9c06c9b2edf395e46fff9|000000000000000000003a3e1ed4bced6c52acb1a684d00607b00944e79ce3aa)"
10:13:00.149217 I fscm.remote: connecting to host bitcoin-01; may prompt for credentials
10:13:00.149566 I fscm.remote: connecting to host b-01.slug; may prompt for credentials
10:13:00.149942 I fscm.remote: connecting to host b-02.slug; may prompt for credentials
10:13:00.150279 I fscm.remote: connecting to host b-03.slug; may prompt for credentials
10:13:00.151181 I fscm.remote: connecting to host b-04.slug; may prompt for credentials
10:13:00.151781 I fscm.remote: connecting to host ssd-1.ccl; may prompt for credentials
@jamesob
jamesob / build-err.txt
Created May 28, 2023 14:17
master 7d33ae755de2bff806fe600bdaebedbd7fa67aba
#11 114.6 /usr/bin/ld: libbitcoin_util.a(libbitcoin_util_a-settings.o): in function `util::ReadSettings(fs::path const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, UniValue, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> > >&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)':
#11 114.6 /usr/include/c++/8/bits/fs_ops.h:121: undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&)'
#11 114.6 collect2: error: ld returned 1 exit status
@jamesob
jamesob / observations.txt
Created May 23, 2023 14:47
Header-to-tip observations
In [17]: for h in HeaderToTipEvent.objects.order_by('-header_to_tip_secs')[:50]:
...: print(f'{h.saw_header_at.date()} {h.host.name:<14} {h.host.bitcoin_version:<24} headtotip = {h.header_to_tip_secs:<6.3f}s headtoblock = {h.header_to_block_secs:<6.3f}s blocktotip = {h.block_to_tip_secs:<6.3f}s {h.blockhash} ({h.height})')
...:
2023-05-21 b-04.slug 25.0rc2 headtotip = 67.749s headtoblock = 65.571s blocktotip = 2.178 s 00000000000000000004f0919e965cabf33b76f80ce8d69354edbdca5c7507bf (790720)
2023-05-19 b-04.slug 25.0rc2 headtotip = 47.833s headtoblock = 46.867s blocktotip = 0.966 s 000000000000000000003c3aff2eb3e0022c2c9444acbf591db4cd25bfb91377 (790493)
2023-05-18 b-04.slug 25.0rc2 headtotip = 36.867s headtoblock = 36.725s blocktotip = 0.142 s 000000000000000000007069e5b2d84598c731e6d6f4098c73cc2161c5f03f63 (790376)
2023-05-16 ssd-1.ccl 25.99.0-d7700d3a2647 headtotip = 31.581s headto
npub1ta5sstxzpk7aykejp6cv8eul80m2rjfwvp3rgjw0xgjtp7s3ak5s0c96f7
@jamesob
jamesob / 02_timeouts.txt
Created May 12, 2023 19:01
Block download timeouts
2022-09-30T17:26:52Z [] Timeout downloading block 0000000000000000000573b6110e9e77864ee0832f2ade5f9317b439c3ce5294 from peer=4, disconnecting
2022-10-05T22:29:02.937882Z [] Timeout downloading block 000000000000000000086779ecf494b0595a9b779f501c7e25fb2be0b69907a2 from peer=24, disconnecting
2022-10-06T19:52:47.698534Z Timeout downloading block 000000000000000000016d82a353995e3e713c53319f71361cd02b53cc0fb49e from peer=3, disconnecting
2022-10-06T20:12:10.246876Z Timeout downloading block 0000000000000000000571fbffbdcbae46b16f79e75a77cd1a470981f48d951f from peer=6, disconnecting
2022-10-06T20:58:28.107620Z Timeout downloading block 00000000000000000003fcc1329bec27b69463dde49fb367421d8f139a2e66f5 from peer=5, disconnecting
2022-10-06T21:26:46.746544Z [] Timeout downloading block 000000000000000000069f15b30ce08fa67b43d8c33baf00ab6748c194e0792a from peer=8, disconnecting
2022-10-06T21:26:46.797297Z Timeout downloading block 000000000000000000069f15b30ce08fa67b43d8c33baf00ab6748c194e0792a from peer=14, disconnectin
@jamesob
jamesob / FLU.diff
Created March 21, 2023 00:23
OP_VAULT -> FLU
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp
index 9963be758d..e4395dc329 100644
--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -11,8 +11,10 @@
#include <pubkey.h>
#include <span.h>
#include <script/script.h>
+#include <script/sign.h>
#include <uint256.h>
@jamesob
jamesob / 00_p2p.log
Last active March 19, 2023 04:03
2023-03-17 reorg as seen from 4 desktops
b-03.slug | 2023-03-18T01:46:16.587175Z [] Requesting block 000000000000000000014bdfbf46969d9b1f290ad21f27f263e14881ef595627 from peer=2522
b-03.slug | 2023-03-18T01:46:16.587241Z [] Requesting block 00000000000000000001e34fc5c0db02f3061e9d14df1d2df8c03cb3d72d0218 from peer=2522
b-03.slug | 2023-03-18T01:46:17.819765Z [] received block 000000000000000000014bdfbf46969d9b1f290ad21f27f263e14881ef595627 peer=2522
b-03.slug | 2023-03-18T01:46:18.790264Z [] received block 00000000000000000001e34fc5c0db02f3061e9d14df1d2df8c03cb3d72d0218 peer=2522
b-03.slug | 2023-03-18T01:46:19.264997Z [] UpdateTip: new best=000000000000000000014bdfbf46969d9b1f290ad21f27f263e14881ef595627 height=781277 version=0x2f832000 log2_work=94.064302 tx=815168901 date='2023-03-18T01:41:17Z' progress=0.999999 cache=41.5MiB(220936txo) warning='90 of last 100 blocks have unexpected version'
b-03.slug | 2023-03-18T01:46:19.303297Z [] UpdateTip: new best=00000000000000000001e34fc5c0db02f3061e9d14df1d2df8c03cb3d72d0218 height=781278 v
@jamesob
jamesob / rework.md
Last active March 2, 2023 19:09
AJ/Greg-ish OP_VAULT rework

Required opcodes

  • OP_VAULT: spent to trigger withdrawal
  • OP_VAULT_RECOVER: spent to recover
  • OP_CTV: spent into final withdrawal target

Initial deposit

Output structure

@jamesob
jamesob / bitcoin-printstack.cpp
Last active January 24, 2023 18:11
Bitcoin script debugging
// For debugging bitcoin script execution (in EvalScript)
#include <logging.h>
template <typename T>
void print_bytes(const T& thing, std::string name)
{
std::string bytes;
for (auto c : thing) {
bytes += tfm::format("%02x ", c);
}
@jamesob
jamesob / connect-to-wework.sh
Created October 24, 2022 12:22
How to connect to WeWork's 802.1x wifi network (WeWorkWifi) with NetworkManager on Linux
# Go to wifi.we.co to get your credentials first
% nmcli con add con-name wework type wifi ssid WeWorkWiFi
% nmcli con edit wework
nmcli> set ipv4.method auto
nmcli> set 802-1x.eap peap
nmcli> set 802-1x.identity <YOUR_EMAIL>
nmcli> set 802-1x.phase2-auth mschapv2
nmcli> set wifi-sec.key-mgmt wpa-eap