This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From c47d7ce48eaadf0faf45ec53fc0e8adf0017db7b Mon Sep 17 00:00:00 2001 | |
From: Alex Stokes <[email protected]> | |
Date: Wed, 20 Mar 2019 16:50:03 -0700 | |
Subject: [PATCH] Reorder the per-epoch transition to occur at the start of the | |
state transition | |
--- | |
.../beacon/state_machines/forks/serenity/state_transitions.py | 4 ++-- | |
1 file changed, 2 insertions(+), 2 deletions(-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
async def count(delay): | |
# this will block everything :( | |
# time.sleep(2) | |
# will explode the other stuff | |
# raise Exception("hi") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import trio | |
async def child1(nursery): | |
print("from 1") | |
# will cancel the nursery | |
# raise Exception("there") | |
await trio.sleep(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import asyncio | |
import colored | |
host = "127.0.0.1" | |
port = 8080 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import colored | |
import random | |
import trio | |
host = "127.0.0.1" | |
port = 8080 | |
def _mk_msg(_id): | |
return f"query from {_id}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require | |
[types] | |
[precompiles] | |
[registry] | |
[tools]) | |
(defcontract BLSSignatureVerifier | |
(defn ^:public verify [message public-key signature) | |
(let [message-on-curve (precompiles/hash-to-curve message)] | |
(= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import time | |
import requests | |
LH_URL = "http://<host-elided>/consensus/global_votes" | |
MEDALLA_GENESIS_TIME = 1596546008 | |
def _current_epoch(): | |
t = int(time.time()) | |
return (t - MEDALLA_GENESIS_TIME) // 12 // 32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from graphviz import Digraph | |
font_name = "helvetica" | |
node_settings = {"fontname": font_name} | |
edge_settings = {"fontname": font_name} | |
title = "Validator lifecycle on the beacon chain (phase 0 spec)\n\n" | |
dot = Digraph( | |
title, | |
node_attr=node_settings, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[patch] | |
[patch.crates-io] | |
tree_hash = { git = "https://github.com/sigp/lighthouse", branch = "stable" } | |
tree_hash_derive = { git = "https://github.com/sigp/lighthouse", branch = "stable" } | |
eth2_ssz = { git = "https://github.com/sigp/lighthouse", branch = "stable" } | |
eth2_ssz_derive = { git = "https://github.com/sigp/lighthouse", branch = "stable" } | |
eth2_ssz_types = { git = "https://github.com/sigp/lighthouse", branch = "stable" } | |
eth2_hashing = { git = "https://github.com/sigp/lighthouse", branch = "stable" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python3 program to find primitive root | |
# of a given number n | |
from math import sqrt | |
from gmpy2 import is_prime | |
import primefac | |
# Function to find smallest primitive | |
# root of n | |
def findPrimitive(n): |