Skip to content

Instantly share code, notes, and snippets.

@willcl-ark
willcl-ark / flake.nix
Created April 25, 2025 10:53
bitcoin deve flake
{
description = "Bitcoin development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-2022.url = "github:NixOS/nixpkgs?rev=028048884dc9517e548703beb24a11408cc51402"; # For boost 1.81.0, libevent 2.1.12, qrencode 4.1.1, zeromq 4.3.5
nixpkgs-lief.url = "github:NixOS/nixpkgs?rev=47c1824c261a343a6acca36d168a0a86f0e66292"; # lief 0.13.2
nixpkgs-sqlite.url = "github:NixOS/nixpkgs?rev=f597e7e9fcf37d8ed14a12835ede0a7d362314bd"; # sqlite 3.38.5
nixpkgs-fontconfig.url = "github:NixOS/nixpkgs?rev=136a26be29a9daa04e5f15ee7694e9e92e5a028c"; # fontconfig 2.12.6
nixpkgs-freetype.url = "github:NixOS/nixpkgs?rev=fadaef5aedb6b35681248f8c6096083b2efeb284"; # freetype 2.11.0
@willcl-ark
willcl-ark / persistent_worker.md
Created September 10, 2024 09:04
Notes on setting up a persistent worker on Hetzner

Beefy workers

  • Can't use "projects" on Hetzner as they are for cloud only. Therefore just set up servers manually and connect to each, running cirrus-cli in screen

  • Testing TSAN job using 1 AX52 Server

  • Version of containernetworking-plugins on Jammy 22.04 Ubuntu is broken for podman. Workaround:

    curl -O http://archive.ubuntu.com/ubuntu/pool/universe/g/golang-github-containernetworking-plugins/containernetworking-plugins_1.1.1+ds1-3build1_amd64.deb
use std::marker::PhantomData;
use tokio::sync::mpsc;
use anyhow::Result;
// Define a trait for RPC methods
pub trait RpcMethod<C> {
type Input;
type Output;
fn call(client: &C, input: Self::Input) -> Result<Self::Output>;
(define-module (bitcoin-core-local)
#:use-module (guix packages)
#:use-module (guix build-system gnu)
#:use-module (guix build-system trivial)
#:use-module (guix download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix gexp)
#:use-module (gnu packages bash)
#:use-module (gnu packages base)
#:use-module (gnu packages compression))
@willcl-ark
willcl-ark / keybase.md
Created July 1, 2024 08:42
keybase.md

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 whose fingerprint is 67AA 5B46 E7AF 7805 3167 FE34 3B8F 814A 7842 18F8

To claim this, I am signing this object:

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 <[email protected]>
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