Skip to content

Instantly share code, notes, and snippets.

Avatar

Danny Ryan djrtwo

  • Ctrl^T
  • New Orleans
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@djrtwo
djrtwo / dump_sanity_tests0.5.1.py
Created Apr 17, 2019
dump sanity tests from v0.5.1
View dump_sanity_tests0.5.1.py
import os
import sys
import build.phase0.spec as spec
from tests.phase0.helpers import (
create_genesis_state,
)
from tests.phase0.conftest import (
overwrite_spec_config,
@djrtwo
djrtwo / state_test_gen.py
Created Apr 17, 2019
tempory helper file used to generate state tests in v0.5.1
View state_test_gen.py
import build.phase0.spec as spec
from build.phase0.spec import (
hash_tree_root,
)
from build.phase0.utils.jsonize import jsonize
CONFIG_FIELDS = [
# Misc
"SHARD_COUNT",
View dump_sanity_tests.py
import os
import sys
import build.phase0.spec as spec
from tests.phase0.helpers import (
create_genesis_state,
)
from tests.phase0.conftest import (
overwrite_spec_config,
@djrtwo
djrtwo / sanity_check_tests.yaml
Last active Mar 14, 2019
sample v0.5.0 tests
View sanity_check_tests.yaml
title: Sanity tests
summary: Basic sanity checks from phase 0 spec pythonization. All tests are run with
`verify_signatures` as set to False.
test_suite: beacon_state
fork: tchaikovsky
version: v0.5.0
test_cases:
- name: test_empty_block_transition
config: {SHARD_COUNT: 8, TARGET_COMMITTEE_SIZE: 4, MAX_BALANCE_CHURN_QUOTIENT: 32,
MAX_INDICES_PER_SLASHABLE_VOTE: 4096, MAX_EXIT_DEQUEUES_PER_EPOCH: 4, SHUFFLE_ROUND_COUNT: 90,
@djrtwo
djrtwo / yaml_gen.py
Last active Mar 12, 2019
stub for state tests
View yaml_gen.py
import yaml
from sanity_check import (
create_genesis_state,
test_empty_block_transition,
)
def generate_yaml_test(pre_state, blocks, post_state, config, fields, root=False):
pass
@djrtwo
djrtwo / block_benchmarks-py_beacon_chain_v2.1.csv
Created Sep 27, 2018
Block benchmarks in python beacon chain v2.1
View block_benchmarks-py_beacon_chain_v2.1.csv
num_attestations validators_per_attestation total_validators total_deposits block_process_seconds crystallized_state_bytes active_state_bytes block_bytes
2 244 31250 1000000 0.1017 4056416 4494 562
16 305 312500 10000000 1.0099 40074336 7324 3392
16 3051 3125000 100000000 10.1837 400074336 12812 8880
View eth-tester-error-01.txt
@pytest.fixture
def base_tester():
> return EthereumTester(PyEVMBackend())
tests/conftest.py:246:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
venv/lib/python3.6/site-packages/eth_tester/backends/pyevm/main.py:262: in __init__
self.reset_to_genesis()
venv/lib/python3.6/site-packages/eth_tester/backends/pyevm/main.py:293: in reset_to_genesis
self.account_keys, self.chain = setup_tester_chain()
@djrtwo
djrtwo / casper_runtime_bytecode_v0.2.0.hex
Created May 16, 2018
Casper Runtime Byte code for v0.2.0 release. `CASPER_CODE` in EIP 1011
View casper_runtime_bytecode_v0.2.0.hex
0x600035601c52740100000000000000000000000000000000000000006020526f7fffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff8000000000000000000000000000000060605274012a05f1fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffed5fa0e000000000000000000000000000000000060a0526316d5c53d60005114156103105761010060046101403734156100b557600080fd5b606051600435806040519013585780919012156100d157600080fd5b50606051602435806040519013585780919012156100ee57600080fd5b506060516044358060405190135857809190121561010b57600080fd5b50606435602051811061011d57600080fd5b50608435602051811061012f57600080fd5b5060605160e4358060405190135857809190121561014c57600080fd5b506015541561015a57600080fd5b6101006101405112600061014051131661017357600080fd5b600061016051121561018457600080fd5b600261018051121561019557600080fd5b60006101e05112156101a657600080fd5b60006102005112156101b757600080fd5b600061022051136101c757600080fd5b60016015556101405160165561016051601755610180516018556101e051601b5561020051601c5561022051601d55600060a051601654
@djrtwo
djrtwo / casper_abi_v0.2.0.json
Created May 16, 2018
Casper Contract ABI for release v0.2.0
View casper_abi_v0.2.0.json
[{'name': 'Deposit', 'inputs': [{'type': 'address', 'name': '_from', 'indexed': True}, {'type': 'int128', 'name': '_validator_index', 'indexed': True}, {'type': 'address', 'name': '_validation_address', 'indexed': False}, {'type': 'int128', 'name': '_start_dyn', 'indexed': False}, {'type': 'int128', 'name': '_amount', 'indexed': False}], 'anonymous': False, 'type': 'event'}, {'name': 'Vote', 'inputs': [{'type': 'address', 'name': '_from', 'indexed': True}, {'type': 'int128', 'name': '_validator_index', 'indexed': True}, {'type': 'bytes32', 'name': '_target_hash', 'indexed': True}, {'type': 'int128', 'name': '_target_epoch', 'indexed': False}, {'type': 'int128', 'name': '_source_epoch', 'indexed': False}], 'anonymous': False, 'type': 'event'}, {'name': 'Logout', 'inputs': [{'type': 'address', 'name': '_from', 'indexed': True}, {'type': 'int128', 'name': '_validator_index', 'indexed': True}, {'type': 'int128', 'name': '_end_dyn', 'indexed': False}], 'anonymous': False, 'type': 'event'}, {'name': 'Withdraw', 'in