Skip to content

Instantly share code, notes, and snippets.

View chfast's full-sized avatar

Paweł Bylica chfast

View GitHub Profile
########## BAD BLOCK #########
Chain config: {ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: <nil> Engine: ethash}
Number: 5708548
Hash: 0xa382e502e982ee89d300f839b61a38209f702f24ad1696056c2a9d2d97e43a07
&{[] 1 21000 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [] [191 119 99 221 143 139 143 177 235 233 157 219 136 52 21 78 94 26 159 20 149 39 239 118 179 155 210 78 73 104 25 92] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 21000}
&{[] 1 42000 [0 0 0 0 0
@chfast
chfast / loader.html
Created May 22, 2018 11:38
WASM browser loader
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h1>WASM loader</h1>
<pre id="log">Log:
</pre>
<script>
log = document.getElementById('log');
@chfast
chfast / p2p_daemon.md
Created March 12, 2018 01:47
P2P Daemon

DevP2P / libp2p Daemon

This node comes directly from ethereum-js team meeting dusing EthCC, but the idea described here lives longer.

Base P2P layer as a separate process

Instead of having the base layer of the P2P network stack implemented as a library (like currently DevP2P) it should be moved to its own process running on the same machine with specified Inter-Process Communiocation (IPC) for accessing it.

@chfast
chfast / ethereum_client_modular_design.md
Last active January 26, 2018 16:27
Ethereum Client Modular Design

Ethereum Client Modular Design

@chfast
chfast / uninitialized.md
Created January 16, 2018 13:26
How to explicity uninitialize variables in C++

How to explicity uninitialize variables in C++

struct uninitialized_t
{
    template<typename T>
    operator T() const noexcept
    {
 char data alignas(T)[sizeof(T)];
@chfast
chfast / json-rpc-proxy-server-names.md
Last active December 21, 2017 19:00
Looking for project name for JSON-RPC Proxy Server

JSON-RPC Proxy Server

JSON-RPC Proxy Server extends JSON-RPC servers capabilities by providing additional request-response transport protocols. The basic use case is to add HTTP / WebSocket connectivity to servers available only by Unix Domain Sockets or Windows Named Pipes.

Proposed project names

  • dopple (from Doppelgänger)
  • surpass
from http.server import HTTPServer, BaseHTTPRequestHandler
import json
class HTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.end_headers()
@chfast
chfast / ethash_lazy_dag.cpp
Created September 19, 2017 18:28
A prototype of Ethash lazy DAG initialization
#include <array>
#include <atomic>
#include <chrono>
#include <iostream>
#include <random>
#include <thread>
#include <vector>
struct item
{
=================================================================
==2259==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 64 byte(s) in 2 object(s) allocated from:
#0 0x7f9dade76532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
#1 0x1c2ca48 in boost::phoenix::new_eval::result<boost::phoenix::new_eval (boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::phoenix::detail::target<boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<0u, 0u, (boost::multiprecision::cpp_integer_type)1, (boost::multiprecision::cpp_int_check_type)0, std::allocator<unsigned long long> >, (boost::multiprecision::expression_template_option)1> > >, 0l> const&, boost::phoenix::actor<boost::spirit::argument<0> > const&, boost::phoenix::vector2<boost::phoenix::vector4<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::assign, boost::proto::argsns_::list2<boost::proto::exprns_::e
m 23:57:44|ethminer Got work package: #20393907
ℹ 23:57:44|cudaminer0 set work; seed: #cb5d57db, target: #0000000225c1
m 23:57:44|ethminer Mining on #20393907… : 20.97MH/s [A1+0:R0+0:F0]
m 23:57:45|ethminer Mining on #20393907… : 26.43MH/s [A1+0:R0+0:F0]
m 23:57:45|ethminer Mining on #20393907… : 27.31MH/s [A1+0:R0+0:F0]
m 23:57:46|ethminer Mining on #20393907… : 25.49MH/s [A1+0:R0+0:F0]
m 23:57:47|ethminer Mining on #20393907… : 26.66MH/s [A1+0:R0+0:F0]
m 23:57:47|ethminer Mining on #20393907… : 25.87MH/s [A1+0:R0+0:F0]
m 23:57:48|ethminer Mining on #20393907… : 25.49MH/s [A1+0:R0+0:F0]
ℹ 23:57:48|ethminer Solution found; Submitting to http://eth-eu.dwarfpool.com:80/0x55700844689b34718c20defdddf68410e3d6cc93/clevo ...