Skip to content

Instantly share code, notes, and snippets.

View zelig's full-sized avatar

Viktor Trón zelig

View GitHub Profile
@zelig
zelig / chunk.go
Last active April 27, 2018 08:42
chunk refactor proposal
type Address []byte
// LocalStore just implements a combined memory cache and disk Store
// it only stores values on disk if they are Marshalable
type LocalStore interface {
Get(ref Address) (Chunk, error)
Put(ch Chunk) (func() error, error)
}
@zelig
zelig / gist:e5bf48c90cc57682fceba8e5f04763ad
Created August 16, 2017 08:19
discovery deadlock stack trace
This file has been truncated, but you can view the full file.
goroutine 0 [idle]:
runtime.futex(0x10d7170, 0x0, 0x0, 0x0, 0xffffffff00000000, 0xffffffff, 0x0, 0x0, 0x7ffe88726450, 0x41431b, ...)
/usr/local/go/src/runtime/sys_linux_amd64.s:422 +0x21
runtime.futexsleep(0x10d7170, 0x0, 0xffffffffffffffff)
/usr/local/go/src/runtime/os_linux.go:45 +0x62
runtime.notesleep(0x10d7170)
/usr/local/go/src/runtime/lock_futex.go:145 +0x6b
runtime.stopm()
/usr/local/go/src/runtime/proc.go:1650 +0xad
@zelig
zelig / bmt.txt
Created April 20, 2017 11:21
bmt benchmarks
tron@nirname:~/work/go-ethereum$ go test -v -cpu 8 ./bmt -bench . -run no
BenchmarkSHA3_4k-8 100000 13977 ns/op 512 B/op 3 allocs/op
BenchmarkSHA3_2k-8 200000 7311 ns/op 512 B/op 3 allocs/op
BenchmarkSHA3_1k-8 300000 3859 ns/op 512 B/op 3 allocs/op
BenchmarkSHA3_512b-8 1000000 2108 ns/op 512 B/op 3 allocs/op
BenchmarkSHA3_256b-8 1000000 1311 ns/op 512 B/op 3 allocs/op
BenchmarkSHA3_128b-8 2000000 891 ns/op 512 B/op 3 allocs/op
BenchmarkBMTBaseline_4k-8 30000 45670 ns/op 69077 B/op 392 allocs/op
BenchmarkBMTBaseline_2k-8 50000
@zelig
zelig / dump.go
Last active April 7, 2017 14:39
dumper
func (s *DbStore) Dump() {
//Iterates over the database and checks that there are no faulty chunks
it := s.db.NewIterator()
startPosition := []byte{kpIndex}
it.Seek(startPosition)
var key []byte
var total int
for it.Valid() {
key = it.Key()
@zelig
zelig / dbstats.go
Last active April 7, 2017 14:00
db stats script
package main
import (
"bufio"
"fmt"
"log"
"os"
// "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/common"
@zelig
zelig / swarm.md
Last active August 31, 2017 21:48
The Ethereum Swarm project: timeline of accomplishments and roadmap

The development of the distributed mass storage subsystem for Ethereum named Swarm was kicked off in October 2014, shortly before Devcon 0 in Berlin, where we presented the design principles, the basic network and protocol architecture as well as the requirements that we aimed to achieve. With the preliminary design finalized by the end of 2014, implementation in Go language began in 2015.

In 2015, we built the foundations of Swarm, consisting of the subsystems for distributing arbitrarily large files across the network with the possibility of subsequent efficient retrieval and

@zelig
zelig / enodes.txt
Created December 15, 2016 12:50
swarm test cluster enodes
enode://9ce417169fe509edd1bec381dacdae65ef16f395135c4ad79f8286a263ad58226be3ae0b1dc619edaa2c5420c2aed4bb22571fdac0453a37e2bfee5efe51c67c@13.74.157.139:30399
enode://d6f8fce0d91e4fc22debc8d00543408d2a200eef7ff9484a73402e5baa3d5a563ce83e7c57b77931d768ff129519471fb96c7562df1869081c186dca4550dd8b@13.74.157.139:30400
enode://2b22c2d26d8ecc8e43a1fdb4e5768222e6ae136bd98259c4b2d630fafad33baf331e97c4a0edb886ae61dcdc2652a8af780d158b0b3460f3719ec040df3c0cf0@13.74.157.139:30401
enode://72d1453047a0ec58b35b3994fcfb77c5e86b555075d629493986302c764e382b4e6aae679405122af2108184dae65da3fac0110855c50bd014941e6dccbe8c64@13.74.157.139:30402
enode://0a93bd6a8ce52be02a688a1a3126fd39b8e51572dec403b68073575fc97f635cd44ea4183767ed19cd4c4e68d49a156a847acec27fd590bedc62947e098b8a0f@13.74.157.139:30403
enode://855be7c00e5c05b46eb813ef877062704e5ad8165fe2a8efe703cdd73a81144cf524b6e12dcc1d5b10a8a49fa17ed45042a6407a9b0a3184b4c1f0e11fa1d0ce@13.74.157.139:30404
enode://0029fc11219b90e4ed4d7b8805f5bc4b9b53c9ebf69f21230630ed6d5ec3d672617a8ef340
@zelig
zelig / p2ptesting.md
Last active March 1, 2024 12:46
p2p network similation, testing and monitoring framework
@zelig
zelig / pss.md
Last active July 8, 2023 02:49
pss

PSS = bzz whispered

pss (bzz whispered) is a swarm network service offering incentivised internode messaging using kademlia based deterministic routing.

phase 0 comes with priorities and an easy to use api exposed to RPC. you can subscribe to messages and peers using geths new pub/sub (available via websockets and ipc).

Swarm kademlia routing implements an efficient unicast address based messaging system. While whisper's architecture offers a nice trade-off between efficiency and anonimity, it is lacking the case when strong anonimity is not required, but predictably low latency transfer is. Public chatrooms, or convo between nodes that do not mind leaking this fact (the content is always safe due to end-to-end encryption).

@zelig
zelig / Whisper-Spec.md
Last active October 2, 2016 05:32
Whisper-Spec.md

Overview

Whisper is a pure identity-based messaging system. Whisper provides a low-level (non-application-specific) but easily-accessible API without being based upon or influenced by the low-level hardware attributes and characteristics. Peer-to-peer communication between nodes running Whisper clients uses the underlying ÐΞVp2p Wire Protocol. Whisper is not designed to provide a connection oriented system, nor for simply delivering data between a pair of particular network endpoints. Whisper is a new protocol designed expressly for a new paradigm of application development. It is designed from the ground up for easy and efficient multi-casting and broadcasting, and also for low-level partially-asynchronous communications. It is designed to be a building block in next generation ÐApps which require large-scale many-to-many data-discovery, signal negotiation and modest transmissions with an absolute minimum of fuss and the expectation that one has a very reasonable assurance of complete privacy. At its