Skip to content

Instantly share code, notes, and snippets.

View zelig's full-sized avatar

Viktor Trón zelig

View GitHub Profile
@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).

SIGQUIT: quit
PC=0x406337b
goroutine 0 [idle]:
runtime.mach_semaphore_wait(0x1503, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x406051a, 0x40543a0, 0x7fff5fbff108, ...)
/usr/local/Cellar/go/1.4.1/libexec/src/runtime/sys_darwin_amd64.s:412 +0xb
semasleep()
/usr/local/Cellar/go/1.4.1/libexec/src/runtime/os_darwin.c:438 +0x16c
runtime.onM(0x7fff5fbff108)
/usr/local/Cellar/go/1.4.1/libexec/src/runtime/asm_amd64.s:273 +0x9a
@zelig
zelig / sword.md
Created December 1, 2015 12:17
The Ethereum Sword = Swarm On-demand Retrieval Daemon

The Ethereum Sword = Swarm On-demand Retrieval Daemon

With this service enabled, you keep the Ethereum chain data in swarm, so your ethereum node can function as a flexible light client.

Sword leverages the new chain and state access layers to the core, to provide an on-demand retrieval plugin. Perfectly identical to the LES-based light client, SWORD provides integrity protected (merkle proof verified) on-demand access to the ethereum blockchain data. Chain data include blocks, transactions (maybe even block headers), receipts, state and contract storage. This means a fast user-experience that allows you to do anything a full archival node can without major compromise to security yet without ever running the VM or storing any particular part of the chain and state database.

SWORD is completely resistant to local storage or memory failures but requires network connectivity and a healthy swarm network with sufficient provision (enough nodes submitting, storing and serving chain data). On the one hand a

@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:85cc18ce1e373d0ee7ab
Created May 18, 2015 20:52
GPU mining on MacOS. Tried on MacBook Pro Retina with NVIDIA GeForce GT750M. Only reaches a max of 700-900 KH/s which is only 0-15% better than CPU on 8 cores
wget http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/cuda_7.0.29_mac.pkg
sudo installer -pkg cuda_7.0.29_mac.pkg -target /
// once cpp-ethereum 0.9.23 is released on homebrew you do not need to build from source
brew update
brew tap ethereum/ethereum
brew reinstall cpp-ethereum --with-gpu-mining --devel --build-from-source
// or build from source:
// cd cpp-ethereum
// cmake -DETHASHCL=1 -DGUI=0
// make -j8
@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 / 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()