Skip to content

Instantly share code, notes, and snippets.

View LarryRuane's full-sized avatar

Larry Ruane LarryRuane

View GitHub Profile
@LarryRuane
LarryRuane / witness-bytes.py
Created March 22, 2023 17:16
calculate total amount of chain witness data
#!/usr/bin/env python3
from bitcoinrpc.authproxy import AuthServiceProxy
api = AuthServiceProxy("http://lmr:lmr@127.0.0.1:8332")
info = api.getblockchaininfo()
tip_height = info['blocks']
print("tip height", tip_height)
witness = 0
for i in range(0, tip_height+1):
blockhash = api.getblockhash(i)
b = api.getblock(blockhash)
#include <iostream>
#include <string.h>
int line;
class String {
public:
char* m_buffer;
size_t m_size;
#include <iostream>
using namespace std;
class X {
public:
int i;
// ordinary cons X y(5):
X(int x) : i(x) { cout << "constructor " << 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

#!/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)
@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:
@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 / 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,

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 / 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