Skip to content

Instantly share code, notes, and snippets.

View pirapira's full-sized avatar

Yoichi Hirai pirapira

View GitHub Profile
TIMESTAMP
JUMPDEST
BALANCE
DUP1
JUMP
JUMPDEST
BALANCE
DUP1
JUMP
JUMPDEST
Test Case "bcShanghaiLoveHomestead":
100%
==651==T20098: stack [0x700000107000,0x700000187000) size 0x80000; local=0x700000186ea8
==651==T20099: stack [0x70000018a000,0x70000020a000) size 0x80000; local=0x700000209ea8
==651==T20100: stack [0x70000020d000,0x70000028d000) size 0x80000; local=0x70000028cea8
==651==T20101: stack [0x700000290000,0x700000310000) size 0x80000; local=0x70000030fea8
==651==T20102: stack [0x700000313000,0x700000393000) size 0x80000; local=0x700000392ea8
==651==T20103: stack [0x700000396000,0x700000416000) size 0x80000; local=0x700000415ea8
==651==T20104: stack [0x700000419000,0x700000499000) size 0x80000; local=0x700000498ea8
==651==T20105: stack [0x70000049c000,0x70000051c000) size 0x80000; local=0x70000051bea8

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

Welcome

This guide is intended to provide resources for those wanting to help test Metropolis EIPs. The CPP team is currently in the middle of a migration from EthDocs to a documentation site that is more dedicated to CPP-Ethereum so the documentation on creating tests for Ethereum using testeth is scattered. Everything you will need to get started should be compiled below.

Suggested skill sets needed to create and run tests

  1. Ability to compile/build testeth and LLL compiler or run a docker file.
  2. Ability to understand the LLL Ethereum language.
  3. Ability to understand EIPs, particuarly [those that are going to be going into t
[16:44] yh@sri: ~/gopath/src/github.com/ethereum/go-ethereum(master↓2|✚1…)$ git checkout holiman/metro_benchmark_on_karalabe
[16:46] yh@sri: ~/gopath/src/github.com/ethereum/go-ethereum/core/vm(:e07d36f12|…)$ go test -bench BenchmarkPre
<snip>
BenchmarkPrecompiledBn256Add/chfast1-Gas=0-4 20000 90297 ns/op
BenchmarkPrecompiledBn256Add/chfast2-Gas=0-4 20000 98101 ns/op
[15:22] yh@sri: ~/src/parity(metropolis-update|✔)$ git remote add tim https://github.com/tcsiwula/parity
[15:22] yh@sri: ~/src/parity(metropolis-update|✔)$ git fetch tim
[15:22] yh@sri: ~/src/parity(metropolis-update|✔)$ git checkout tims_benchmarks
[15:22] yh@sri: ~/src/parity(tims_benchmarks|✔)$ rustup override set nightly
[15:23] yh@sri: ~/src/parity(tims_benchmarks|✔)$ cargo bench -p ethcore
<snip>
test bn_128_add ... bench: 14,527 ns/iter (+/- 413)
{
"randomStatetest645" : {
"_info" : {
"comment" : "",
"filledwith" : "cpp-1.3.0+commit.0b2b4ec2.Linux.g++",
"source" : "/home/wins/Ethereum/tests/src/GeneralStateTestsFiller/stRandom/randomStatetest645Filler.json"
},
"env" : {
"currentCoinbase" : "0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"currentDifficulty" : "0x20000",
{
"uncleBlockAtBlock3AfterBlock3" : {
"genesisBlockHeader" : {
"bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
"difficulty" : "131072",
"extraData" : "0x42",
"gasLimit" : "3141592",
"gasUsed" : "0",
"number" : "0",
// This code does not compile yet.
// Should Bamboo support this kind of nesting contracts, which represent substates and a superstate?
contract Alive(address hotWallet, address vaultKey, address recoveryKey) {
case(void destroy()) {
if (sender(msg) != recoveryKey) abort;
return then become Destroyed();
}
case(void recover(address _newHotWallet)) {
if (sender(msg) != recoveryKey) abort;
// Based on http://www.blunderingcode.com/ether-vaults/
contract Vault(address hotwallet, address vaultKey, address recoveryKey) {
case(void unvault(uint256 amount)) {
if (sender(msg) != vaultKey) abort;
uint256 unvaultPeriod = 60 * 60 * 24 * 7 * 2; // two weeks
if (now(block) + unvaultPeriod < now(block)) abort;
return then become UnVaulting(now(block) + unvaultPeriod, amount, hotwallet, vaultKey, recoveryKey);
}
case(void recover(address _newHotWallet)) {