Skip to content

Instantly share code, notes, and snippets.

will@ubuntu in ~/src/bitcoin (505e3de) [$?] : C v16.0.6-clang : 🐍 3.8.16
₿ /home/will/src/bitcoin/src/bitcoin-cli getmempoolinfo
{
"loaded": true,
"size": 138992,
"bytes": 48314670,
"usage": 295850976,
"total_fee": 2.22768977,
"maxmempool": 300000000,
"mempoolminfee": 0.00001000,
@willcl-ark
willcl-ark / xor-blocks.py
Last active August 3, 2023 15:22
xor a Bitcoin Core blocks directory
#!/usr/bin/env python3
import argparse
import logging
import os
import random
import traceback
from functools import partial
from multiprocessing import Pool, cpu_count
@willcl-ark
willcl-ark / core_log.diff
Created June 28, 2023 09:06
bitcoin core log patch
commit 39e9f43014e9aa9383cc792015e91774fa5b792b
Author: willcl-ark <will@256k1.dev>
Date: Thu Jun 15 09:08:05 2023 +0100
RPC: add 'log' rpc to set single
diff --git a/src/rpc/node.cpp b/src/rpc/node.cpp
index 3828401642..4f1986695b 100644
--- a/src/rpc/node.cpp
+++ b/src/rpc/node.cpp

This was written in response to bitcoin/bitcoin#27578 and any other number of occurrences of the topic.

“Standardness policy” is a term for a transaction that would be consensus-legal, but our node doesn’t want to relay for various reasons. Clearly if it’s consensus valid we want to accept it to not split the network if a miner chooses a “weird” transaction to mine.

There are N motivations for policy that I know of:

  1. Anti-DoS: Only “cheap” things to validate get flooded to the network
  2. Security: Certain types of transactions may mess up certain systems for no good reason
  3. Upgrade hooks: We leave some things “forbidden” such that if we find a use for them later we don’t “confiscate” funds by refusing to relay e.g., a spend or pre-signed transaction
  4. Pro-decentralization: Make it simple/cheap for miners to build blocks that pay well
#!/usr/bin/env python3
"""
A script to check that generated out files which use special compilation units
do not contain any disallowed sections. See #18553 for additional context.
Special instructions include:
SSE42
SSE41
@willcl-ark
willcl-ark / will-clark-LPE.md
Created October 14, 2021 13:33
will-clark-LPE response

Will Clark - Protocol Engineer Take Home Question

Consider the following protocol spec:

Request format:

PACKET := HEADER | BODY

HEADER := LENGTH | TYPE
@willcl-ark
willcl-ark / git_aliases_PRs.txt
Created April 23, 2020 08:52
git aliases to checkout and remove PRs easily
# Add this section to your global ~/.gitconfig file
[alias]
pr = "!f() { git fetch -fu ${2:-$(git remote |grep ^upstream || echo origin)} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
pr-clean = "!git for-each-ref refs/heads/pr/* --format=\"%(refname)\" | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
spr = "!f() { git fetch -fu ${2:-$(git remote |grep ^upstream || echo origin)} refs/pull-requests/$1/from:pr/$1 && git checkout pr/$1; }; f"
"""lightning mesh proxy.
Usage:
proxy.py MY_PUBKEY REMOTE_PUBKEY REMOTE_GID
Arguments:
MY_PUBKEY my node pubkey
REMOTE_PUBKEY the pubkey of the remote node
REMOTE_GID the GID of the remote node
"""

Keybase proof

I hereby claim:

  • I am willcl-ark on github.
  • I am willcl_ark (https://keybase.io/willcl_ark) on keybase.
  • I have a public key ASDI5n7rvhxIhPw85s8Dk3rqN4_8kz7dzW6J7fZKknHnRQo

To claim this, I am signing this object: