Skip to content

Instantly share code, notes, and snippets.

View LarryRuane's full-sized avatar

Larry Ruane LarryRuane

View GitHub Profile
@LarryRuane
LarryRuane / zcash-debugging.md
Last active July 9, 2021 21:23
zcash debugging tips and tricks

debugging cheat sheet

recommended ~/.gdbinit settings

set print pretty
set height 0
set print elements unlimited
set history save on

I discovered the Bitcoin Core project through my full-time position at the Electric Coin Company, creators of Zcash, a code-fork of Bitcoin Core. Upon discovering a small bug in Zcash in 2019, I found that the bug also existed in Bitcoin Core; the fix became my first PR. I immediately fell in love with the development community, and since then have been contributing review and a few small PRs on my own time, while continuing full-time with ECC. I was accepted to the 2020 Chaincode Residency program in New York, which was canceled, but I did participate in the Chaincode study group. My goal is to gradually move to working on Bitcoin Core full-time.

It's well-know that Bitcoin Core is in crucial need of PR review, and this grant will allow me to spend one day of each week (20%) reviewing and testing PRs, while continuing 80% with ECC. I especially plan to take advantage of the weekly Bitcoin Core Review Club. I'll wo

@LarryRuane
LarryRuane / bitcoin-core-debugging.md
Last active March 27, 2023 12:59
Some tips and tricks for debugging Bitcoin Core

Using debuggers with Bitcoin Core

Please also refer to Fabian Jahr's excellent documentation and video. In this document, I'll cover only some of what his document does in slightly greater detail, while trying not to duplicate too much, and focused on gdb and Linux.

Video version of (most of) this document: https://vimeo.com/576956296/df0b66fbfc NOTE if you watch the video: Near the end, I had problems attaching to

@LarryRuane
LarryRuane / gist:45f2316f99c84b8f83e7c1e5e697fffd
Created July 28, 2021 19:47
absently DM after bitcoin core review 2021-7-28, but he was no longer online
absently>
Thought experiment, if economic exchange is better off by destroying 1 bitcoin, then does it follow that destroying half of everyone's bitcoin balance is beneficial? I'd argue no but the "destroying stores of wealth results in prosperity" argument says yes
12:40 PM
← absently left #bitcoin-core-pr-reviews (~absently@185.212.170.140)
1:44 PM <larryruane> Larry Ruane
Hi absently, I think you're exactly right, destroying half of everyone's balance would not create prosperity... it would have no effect, other than doubling the value of each bitcoin ... so the USD bitcoin price would double from 40k (or whatever it is now) to 80k, and the price of things in units of bitcoin would reduce by half ... But this is because *everyone's* bitcoin balance is affected equally (is multiplied by the same constant, 0.5), so it's a simple scaling effect... It could be disruptive if it this change was unexpected but that's a second-order effect.
What I was trying to say is that if I

The Brink grant beginning on 11 June 2021 allowed me to reduce my commitment to my full-time job with The Electric Coin Company (ECC) from 40 to 32 hours per week, freeing 8 hours per week to dedicate to the advancement of Bitcoin, especially Bitcoin Core. As I did not make a request to work on a specific project, most of my efforts have been contributing to PR review.

Most of my time has involved reviewing the Review Club PR for the week. I hosted Review Club once, during which I demonstrated (in a video meeting) how use of the standard debugger, gdb, can be helpful in PR review (I had routinely been doing this myself.) This session was recorded and will be (or has been) used in an educational series that Adam Jonas (Chaincode Labs) is creating to onboard new Bitcoin Core developers.

@LarryRuane
LarryRuane / bgrant2022.md
Last active August 27, 2022 15:30
brink full time grant application

Dear Brink Board,

Thanks to 20% support from Brink, I've been very fortunate to work part-time on Bitcoin Core engineering, mostly review, for almost a year. These are some of the accomplishments during this time:

  • biweekly calls with John Newbery until he stepped away, during which we discussed code review best practices, how to host review club, Bitcoin Core design philosophy, thread safety, book recommendations (both ways), suggestions for PRs to review and specifics of some of those, release engineering (version numbers, tagging), debugging, and many other topics
  • hosted Review Club three times (14707,
@LarryRuane
LarryRuane / static_assert.c
Last active August 27, 2022 15:29
example static assert implemention
#define static_assert(c) do { int _x = 1/((int)c); } while (0)
int main() {
static_assert(sizeof(int) == 4);
static_assert(sizeof(int) < 4);
return 0;
}
/* output:
$ gcc t.c
@LarryRuane
LarryRuane / debug-logging.diff
Created October 25, 2022 19:38
exclude "rand" logging category to make functional test debug.log files easier to read
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -102,6 +102,7 @@ class TestNode():
"-debug",
"-debugexclude=libevent",
"-debugexclude=leveldb",
+ "-debugexclude=rand",
"-uacomment=testnode%d" % i,
]
if use_valgrind:
#!/usr/bin/env python3
# show heights and timestamps of empty blocks, most recent first (so if using a pruned node,
# this will stop when we reach the start of the prune window)
from bitcoinrpc.authproxy import AuthServiceProxy
import json
from datetime import datetime
api = AuthServiceProxy("http://lmr:lmr@127.0.0.1:8332")
latest_height = api.getblockcount()
for i in range(latest_height, 1, -1):
bhash = api.getblockhash(i)

CIA Torture Scandal Prosecutions

Is anyone in prison for the CIA torture scandal?

No one has been convicted or imprisoned for the CIA torture scandal. The Senate Intelligence Committee's report on the CIA's use of enhanced interrogation techniques, which were widely considered to be torture, was released in December 2014. The report detailed the CIA's use of waterboarding and other harsh methods on terrorism suspects in the years following the 9/11 attacks. However, no criminal charges have been brought against anyone involved in the program, and the Department of Justice has not pursued any prosecutions. Some human rights groups and lawmakers have called for those responsible to be held accountable, but to date, no one has been charged or convicted for their role in the CIA's enhanced interrogation program.


But wasn't the whistleblower who exposed the scandal put in prison?

A CIA officer named John Kiriakou was convicted in 2012 of violating the Espionage Act for disclosing classified in