Skip to content

Instantly share code, notes, and snippets.

View fjl's full-sized avatar
💭
prog ramming

Felix Lange fjl

💭
prog ramming
View GitHub Profile
@fjl
fjl / keybase.md
Created August 9, 2016 15:04
keybase.md

Keybase proof

I hereby claim:

  • I am fjl on github.
  • I am fjl (https://keybase.io/fjl) on keybase.
  • I have a public key ASCg5SUIjNC8QbEaAU_bwf0nKeRQ2dXvfR8kHOu0DsZ4Ago

To claim this, I am signing this object:

https://github.com/fjl/EIPs/blob/EIP-8/EIPS/eip-8.md

Pros/Cons of EIP-8 in the Context of Protocol Upgrades

Positives:

  • If both sides support a newer version of any of the protocols, it will be enabled.
  • Packet decoding is simple, clients know how many RLP list elements are defined to be meaningful for a given version and process only that many elements.
  • Downgrade attacks are not possible.

This document is a cross-implementation proposal that outlines how we can achieve a smooth transition from RLPx V4 to RLPx V5.

The changes in RLPx V5 are as follows:

  1. Chunked transfers are used to break up devp2p messages, avoiding head of line blocking when multiple subprotocols share the same TCP connection. They can also be used to transfer multiple packets belonging to the same subprotocol at the same time.
@fjl
fjl / ecbench.txt
Last active October 10, 2015 01:07
~/s/go-ethereum >> ./build/env.sh go test ./crypto/secp256k1 -count 100 -run - -bench Recover
PASS
BenchmarkRecoverRandomKey-8 10000 180614 ns/op
BenchmarkRecoverRandomKey-8 10000 181670 ns/op
BenchmarkRecoverRandomKey-8 10000 181151 ns/op
BenchmarkRecoverRandomKey-8 10000 181454 ns/op
BenchmarkRecoverRandomKey-8 10000 180784 ns/op
BenchmarkRecoverRandomKey-8 10000 181952 ns/op
BenchmarkRecoverRandomKey-8 10000 182198 ns/op
BenchmarkRecoverRandomKey-8 10000 181652 ns/op
emit_attachment(SI = #sync_info{db = Db}, DocId, Filename, Type, Content) ->
?LOG_INFO("storing attachment ~s/~s/~s (~s, ~p bytes)", [
SI#sync_info.user,
DocId,
Filename,
Type,
byte_size(Content)
]),
case couch_db:open_doc(Db, DocId, [attachments]) of
{ok, Doc} ->
-module(stacktrace_filter).
-compile(export_all).
t() ->
try
sensitive_data_function()
catch
Error:Reason ->
{Error, Reason, erlang:get_stacktrace()}
end.
@fjl
fjl / mock.lisp
Created May 1, 2013 00:29
Quick experiment after a discussion at the Berlin Lispers Meetup
(defpackage #:mock
(:use :cl)
(:export
#:mock-labels
#:call-mocked-function
#:mock-call-args
#:mock-call-return-values
#:mocked-function-called-p
#:mocked-function-calls))
@fjl
fjl / Main.cs
Created November 15, 2012 18:20
detect foreground window switch in C#
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
namespace ShellEventsTest
{
class Program
{
static void Main(string[] args)
{
@fjl
fjl / index.html
Created February 19, 2012 11:41
game
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Yeah, baby, uh!</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
</head>
<body>
<canvas id="canvas" width="200" height="200"></canvas>
<script src="script.js" type="text/javascript"></script>
@fjl
fjl / brew-install-jack-1.9.6
Created April 16, 2011 18:38
Output of brew install -v jack
fjl@pankunchi:~/» brew install -v jack
==> Downloading http://www.grame.fr/~letz/jack-1.9.6.tar.bz2
File already downloaded and cached to /Users/fjl/Library/Caches/Homebrew
/usr/bin/tar xf /Users/fjl/Library/Caches/Homebrew/jack-1.9.6.tar.bz2
==> Downloading patches
/usr/bin/curl -f#LA Homebrew 0.8 (Ruby 1.8.7-174; Mac OS X 10.6.7) https://gist.github.com/raw/636194/jack-1.9.6_homebrew.patch -o 001-homebrew.diff
######################################################################## 100.0%
==> Patching
/usr/bin/patch -f -p1 -i 001-homebrew.diff
patching file common/wscript