Compare commits

..

39 Commits

Author SHA1 Message Date
obscuren
c8fc4cebe6 version 0.9.17 2015-05-08 17:24:41 +02:00
Jeffrey Wilcke
0214cbe0fb Merge pull request #863 from karalabe/ordered-block-download
eth/downloader: prioritize block fetch based on chain position, cap memo...
2015-05-08 08:19:53 -07:00
Jeffrey Wilcke
7c678554b5 Merge pull request #885 from fjl/p2p-fixes
p2p: more last-minute fixes
2015-05-08 07:47:56 -07:00
Péter Szilágyi
edad47bf0e eth/downloader: fix leftover state between syncs 2015-05-08 17:39:03 +03:00
Felix Lange
d4f0a67323 p2p: drop connections with no matching protocols 2015-05-08 16:09:55 +02:00
Felix Lange
e45d9bb29d cmd/utils: bump default maxpeers to 25
This should improve ethereum block propagation times since
we're not not broadcasting blocks to 100% of peers.
2015-05-08 16:09:55 +02:00
Felix Lange
9c0f36c46d p2p: use maxDialingConns instead of maxAcceptConns as dial limit 2015-05-08 16:09:55 +02:00
Felix Lange
914e57e49b p2p: fix disconnect at capacity
With the introduction of static/trusted nodes, the peer count
can go above MaxPeers. Update the capacity check to handle this.
While here, decouple the trusted nodes check from the handshake
by passing a function instead.
2015-05-08 16:09:54 +02:00
Jeffrey Wilcke
23454dcfcb Merge pull request #840 from karalabe/throttled-dialing
p2p: throttled handshakes
2015-05-08 06:53:40 -07:00
Péter Szilágyi
bd5720f480 eth, eth/downloader: handle sync errors a bit more gracefully 2015-05-08 15:22:48 +03:00
Jeffrey Wilcke
f819ac7158 Merge pull request #882 from zsfelfoldi/develop
Otto.ToValue concurrency error fixed
2015-05-08 04:54:22 -07:00
Jeffrey Wilcke
15bfae52d2 Merge pull request #876 from obscuren/jsre_fixes
jsre, cmd/geth: updated web3.js and altered settimeout
2015-05-08 04:39:33 -07:00
zsfelfoldi
d7dabce732 ToVal serialization fix 2015-05-08 13:29:48 +02:00
obscuren
f6e71b5749 updated ethereum.js 2015-05-08 13:05:20 +02:00
obscuren
351d6b0d44 jsre, cmd/geth: updated web3.js and altered settimeout 2015-05-08 13:05:20 +02:00
Jeffrey Wilcke
03473d48c1 Merge pull request #875 from Gustav-Simonsson/test_updates
Test updates
2015-05-08 03:50:14 -07:00
Jeffrey Wilcke
45c070fc8b Merge pull request #833 from ethersphere/frontier/solidity
solidity compiler and contract metadocs integration
2015-05-08 03:43:31 -07:00
zsfelfoldi
1de1359e3b Otto.ToValue concurrency error fixed 2015-05-08 12:27:35 +02:00
Jeffrey Wilcke
637b2415d9 Merge pull request #864 from obscuren/filter_changes
xeth, core, event/filter, rpc: new block and transaction filters
2015-05-08 02:56:55 -07:00
Jeffrey Wilcke
69aac4d531 Merge pull request #877 from Gustav-Simonsson/update_ethash_godep
Update ethash deps (more build fixes, tests)
2015-05-08 02:19:50 -07:00
Péter Szilágyi
9d188f73b5 eth, eth/downloader: make synchronize thread safe 2015-05-07 21:07:20 +03:00
Gustav Simonsson
3593662b0c Update ethash deps (more build fixes, tests) 2015-05-07 19:39:55 +02:00
obscuren
60b5a94428 xeth: getTransactionByHash, try pool if db fails 2015-05-07 18:23:24 +02:00
obscuren
dcfecebe1f core: get transaction by hash from transaction pool 2015-05-07 18:22:57 +02:00
obscuren
258a7b9a93 xeth: check proper queue for pending transaction filter 2015-05-07 17:20:57 +02:00
obscuren
b3c9b66f29 rpc: eth_transactionFilter => eth_newPendingTransactionFilter 2015-05-07 14:44:32 +02:00
obscuren
7e160a677d xeth, core, event/filter, rpc: new block and transaction filters 2015-05-07 14:44:32 +02:00
Péter Szilágyi
8735e5addd p2p: increase the handshake timeout in the tests 2015-05-07 15:30:56 +03:00
Péter Szilágyi
4d5a719f25 cmd, eth, p2p: introduce pending peer cli arg, add tests 2015-05-07 15:30:56 +03:00
Péter Szilágyi
af93217775 p2p: reduce the concurrent handshakes to 10/10 in/out 2015-05-07 15:22:09 +03:00
Péter Szilágyi
2060bc8bac p2p: fix dial throttling race condition 2015-05-07 15:22:08 +03:00
Péter Szilágyi
29fef349ef p2p: fix a dialing race in the throttler 2015-05-07 15:22:08 +03:00
Péter Szilágyi
3953bf0031 p2p: limit the outbound dialing too 2015-05-07 15:22:08 +03:00
Péter Szilágyi
43901c9282 eth/downloader: fix priority queue reset, add throttling test 2015-05-07 14:40:50 +03:00
Gustav Simonsson
79eb40fc9f Add bcTotalDifficultyTest and unskip now working tx tests 2015-05-07 13:03:22 +02:00
zelig
009b221692 solidity compiler and contract metadocs integration
* common/compiler: solidity compiler + tests
* rpc: eth_compilers, eth_compileSolidity + tests
* fix natspec test using keystore API, notice exp dynamically changes addr, cleanup
* resolver implements registrars and needs to create reg contract (temp)
* xeth: solidity compiler. expose getter Solc() and paths setter SetSolc(solcPath)
* ethereumApi: implement compiler related RPC calls using XEth - json struct tests
* admin: make use of XEth.SetSolc to allow runtime setting of compiler paths
* cli: command line flags solc to set custom solc bin path
* js admin api with new features debug and contractInfo modules
* wiki is the doc https://github.com/ethereum/go-ethereum/wiki/Contracts-and-Transactions
2015-05-07 12:58:21 +02:00
Gustav Simonsson
2b716aec54 Update JSON test files 2015-05-07 12:44:29 +02:00
Péter Szilágyi
45f8304f3c eth/downloader: fix expiration not running while fetching 2015-05-07 12:59:19 +03:00
Péter Szilágyi
4800c94392 eth/downloader: prioritize block fetch based on chain position, cap memory use 2015-05-07 10:57:34 +03:00
107 changed files with 12966 additions and 6019 deletions

8
Godeps/Godeps.json generated
View File

@@ -17,8 +17,8 @@
},
{
"ImportPath": "github.com/ethereum/ethash",
"Comment": "v23.1-195-g4d50db9",
"Rev": "4d50db90d8bb5f2fae357570366cb8c657a4ddfc"
"Comment": "v23.1-204-g0401fdf",
"Rev": "0401fdf56a3bc8679f9560e542c3d1cf83020efe"
},
{
"ImportPath": "github.com/howeyc/fsnotify",
@@ -98,6 +98,10 @@
"Comment": "v0.1.0-3-g27c4092",
"Rev": "27c40922c40b43fe04554d8223a402af3ea333f3"
},
{
"ImportPath": "gopkg.in/karalabe/cookiejar.v2/collections/prque",
"Rev": "0b2e270613f5d7ba262a5749b9e32270131497a2"
},
{
"ImportPath": "gopkg.in/qml.v1/cdata",
"Rev": "1116cb9cd8dee23f8d444ded354eb53122739f99"

View File

@@ -1,5 +1,16 @@
package ethash
/*
-mno-stack-arg-probe disables stack probing which avoids the function
__chkstk_ms being linked. this avoids a clash of this symbol as we also
separately link the secp256k1 lib which ends up defining this symbol
1. https://gcc.gnu.org/onlinedocs/gccint/Stack-Checking.html
2. https://groups.google.com/forum/#!msg/golang-dev/v1bziURSQ4k/88fXuJ24e-gJ
3. https://groups.google.com/forum/#!topic/golang-nuts/VNP6Mwz_B6o
*/
/*
#cgo CFLAGS: -std=gnu99 -Wall
#cgo windows CFLAGS: -mno-stack-arg-probe
@@ -10,7 +21,6 @@ package ethash
#include "src/libethash/io.c"
#ifdef _WIN32
# include "src/libethash/util_win32.c"
# include "src/libethash/io_win32.c"
# include "src/libethash/mmap_win32.c"
#else

View File

@@ -280,7 +280,7 @@ ethash_h256_t ethash_get_seedhash(uint64_t block_number)
return ret;
}
int ethash_quick_check_difficulty(
bool ethash_quick_check_difficulty(
ethash_h256_t const* header_hash,
uint64_t const nonce,
ethash_h256_t const* mix_hash,

View File

@@ -47,7 +47,7 @@ static inline void ethash_h256_reset(ethash_h256_t* hash)
}
// Returns if hash is less than or equal to difficulty
static inline int ethash_check_difficulty(
static inline bool ethash_check_difficulty(
ethash_h256_t const* hash,
ethash_h256_t const* difficulty
)
@@ -59,10 +59,10 @@ static inline int ethash_check_difficulty(
}
return ethash_h256_get(hash, i) < ethash_h256_get(difficulty, i);
}
return 1;
return true;
}
int ethash_quick_check_difficulty(
bool ethash_quick_check_difficulty(
ethash_h256_t const* header_hash,
uint64_t const nonce,
ethash_h256_t const* mix_hash,

View File

@@ -34,11 +34,12 @@
extern "C" {
#endif
// Maximum size for mutable part of DAG file name
// 6 is for "full-R", the suffix of the filename
// 10 is for maximum number of digits of a uint32_t (for REVISION)
// 1 is for _ and 16 is for the first 16 hex digits for first 8 bytes of
// 1 is for - and 16 is for the first 16 hex digits for first 8 bytes of
// the seedhash and last 1 is for the null terminating character
// Reference: https://github.com/ethereum/wiki/wiki/Ethash-DAG
#define DAG_MUTABLE_NAME_MAX_SIZE (10 + 1 + 16 + 1)
#define DAG_MUTABLE_NAME_MAX_SIZE (6 + 10 + 1 + 16 + 1)
/// Possible return values of @see ethash_io_prepare
enum ethash_io_rc {
ETHASH_IO_FAIL = 0, ///< There has been an IO failure
@@ -176,7 +177,7 @@ static inline bool ethash_io_mutable_name(
#if LITTLE_ENDIAN == BYTE_ORDER
hash = ethash_swap_u64(hash);
#endif
return snprintf(output, DAG_MUTABLE_NAME_MAX_SIZE, "%u_%016" PRIx64, revision, hash) >= 0;
return snprintf(output, DAG_MUTABLE_NAME_MAX_SIZE, "full-R%u-%016" PRIx64, revision, hash) >= 0;
}
#ifdef __cplusplus

View File

@@ -25,7 +25,7 @@
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <Shlobj.h>
#include <shlobj.h>
FILE* ethash_fopen(char const* file_name, char const* mode)
{

View File

@@ -26,11 +26,11 @@
extern "C" {
#endif
//#ifdef _MSC_VER
#ifdef _MSC_VER
void debugf(char const* str, ...);
//#else
//#define debugf printf
//#endif
#else
#define debugf printf
#endif
static inline uint32_t min_u32(uint32_t a, uint32_t b)
{

View File

@@ -205,10 +205,10 @@ BOOST_AUTO_TEST_CASE(test_ethash_io_mutable_name) {
// should have at least 8 bytes provided since this is what we test :)
ethash_h256_t seed1 = ethash_h256_static_init(0, 10, 65, 255, 34, 55, 22, 8);
ethash_io_mutable_name(1, &seed1, mutable_name);
BOOST_REQUIRE_EQUAL(0, strcmp(mutable_name, "1_000a41ff22371608"));
BOOST_REQUIRE_EQUAL(0, strcmp(mutable_name, "full-R1-000a41ff22371608"));
ethash_h256_t seed2 = ethash_h256_static_init(0, 0, 0, 0, 0, 0, 0, 0);
ethash_io_mutable_name(44, &seed2, mutable_name);
BOOST_REQUIRE_EQUAL(0, strcmp(mutable_name, "44_0000000000000000"));
BOOST_REQUIRE_EQUAL(0, strcmp(mutable_name, "full-R44-0000000000000000"));
}
BOOST_AUTO_TEST_CASE(test_ethash_dir_creation) {
@@ -599,16 +599,49 @@ BOOST_AUTO_TEST_CASE(test_incomplete_dag_file) {
fs::remove_all("./test_ethash_directory/");
}
BOOST_AUTO_TEST_CASE(test_block_verification) {
BOOST_AUTO_TEST_CASE(test_block22_verification) {
// from POC-9 testnet, epoch 0
ethash_light_t light = ethash_light_new(22);
ethash_h256_t seedhash = stringToBlockhash("372eca2454ead349c3df0ab5d00b0b706b23e49d469387db91811cee0358fc6d");
BOOST_ASSERT(light);
ethash_return_value_t ret = ethash_light_compute(
light,
seedhash,
0x495732e0ed7a801c
0x495732e0ed7a801cU
);
BOOST_REQUIRE_EQUAL(blockhashToHexString(&ret.result), "00000b184f1fdd88bfd94c86c39e65db0c36144d5e43f745f722196e730cb614");
ethash_h256_t difficulty = ethash_h256_static_init(0x2, 0x5, 0x40);
BOOST_REQUIRE(ethash_check_difficulty(&ret.result, &difficulty));
ethash_light_delete(light);
}
BOOST_AUTO_TEST_CASE(test_block30001_verification) {
// from POC-9 testnet, epoch 1
ethash_light_t light = ethash_light_new(30001);
ethash_h256_t seedhash = stringToBlockhash("7e44356ee3441623bc72a683fd3708fdf75e971bbe294f33e539eedad4b92b34");
BOOST_ASSERT(light);
ethash_return_value_t ret = ethash_light_compute(
light,
seedhash,
0x318df1c8adef7e5eU
);
ethash_h256_t difficulty = ethash_h256_static_init(0x17, 0x62, 0xff);
BOOST_REQUIRE(ethash_check_difficulty(&ret.result, &difficulty));
ethash_light_delete(light);
}
BOOST_AUTO_TEST_CASE(test_block60000_verification) {
// from POC-9 testnet, epoch 2
ethash_light_t light = ethash_light_new(60000);
ethash_h256_t seedhash = stringToBlockhash("5fc898f16035bf5ac9c6d9077ae1e3d5fc1ecc3c9fd5bee8bb00e810fdacbaa0");
BOOST_ASSERT(light);
ethash_return_value_t ret = ethash_light_compute(
light,
seedhash,
0x50377003e5d830caU
);
ethash_h256_t difficulty = ethash_h256_static_init(0x25, 0xa6, 0x1e);
BOOST_REQUIRE(ethash_check_difficulty(&ret.result, &difficulty));
ethash_light_delete(light);
}
@@ -617,7 +650,7 @@ BOOST_AUTO_TEST_CASE(test_block_verification) {
// Uncomment and run on your own machine if you want to confirm
// it works fine.
#if 0
static int lef_cb(unsigned _progress)
static int progress_cb(unsigned _progress)
{
printf("CREATING DAG. PROGRESS: %u\n", _progress);
fflush(stdout);
@@ -627,7 +660,7 @@ static int lef_cb(unsigned _progress)
BOOST_AUTO_TEST_CASE(full_dag_test) {
ethash_light_t light = ethash_light_new(55);
BOOST_ASSERT(light);
ethash_full_t full = ethash_full_new(light, lef_cb);
ethash_full_t full = ethash_full_new(light, progress_cb);
BOOST_ASSERT(full);
ethash_light_delete(light);
ethash_full_delete(full);

View File

@@ -0,0 +1,44 @@
// CookieJar - A contestant's algorithm toolbox
// Copyright (c) 2013 Peter Szilagyi. All rights reserved.
//
// CookieJar is dual licensed: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// The toolbox is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// Alternatively, the CookieJar toolbox may be used in accordance with the terms
// and conditions contained in a signed written agreement between you and the
// author(s).
package prque_test
import (
"fmt"
"gopkg.in/karalabe/cookiejar.v2/collections/prque"
)
// Insert some data into a priority queue and pop them out in prioritized order.
func Example_usage() {
// Define some data to push into the priority queue
prio := []float32{77.7, 22.2, 44.4, 55.5, 11.1, 88.8, 33.3, 99.9, 0.0, 66.6}
data := []string{"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}
// Create the priority queue and insert the prioritized data
pq := prque.New()
for i := 0; i < len(data); i++ {
pq.Push(data[i], prio[i])
}
// Pop out the data and print them
for !pq.Empty() {
val, prio := pq.Pop()
fmt.Printf("%.1f:%s ", prio, val)
}
// Output:
// 99.9:seven 88.8:five 77.7:zero 66.6:nine 55.5:three 44.4:two 33.3:six 22.2:one 11.1:four 0.0:eight
}

View File

@@ -0,0 +1,75 @@
// CookieJar - A contestant's algorithm toolbox
// Copyright (c) 2013 Peter Szilagyi. All rights reserved.
//
// CookieJar is dual licensed: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// The toolbox is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// Alternatively, the CookieJar toolbox may be used in accordance with the terms
// and conditions contained in a signed written agreement between you and the
// author(s).
// Package prque implements a priority queue data structure supporting arbitrary
// value types and float priorities.
//
// The reasoning behind using floats for the priorities vs. ints or interfaces
// was larger flexibility without sacrificing too much performance or code
// complexity.
//
// If you would like to use a min-priority queue, simply negate the priorities.
//
// Internally the queue is based on the standard heap package working on a
// sortable version of the block based stack.
package prque
import (
"container/heap"
)
// Priority queue data structure.
type Prque struct {
cont *sstack
}
// Creates a new priority queue.
func New() *Prque {
return &Prque{newSstack()}
}
// Pushes a value with a given priority into the queue, expanding if necessary.
func (p *Prque) Push(data interface{}, priority float32) {
heap.Push(p.cont, &item{data, priority})
}
// Pops the value with the greates priority off the stack and returns it.
// Currently no shrinking is done.
func (p *Prque) Pop() (interface{}, float32) {
item := heap.Pop(p.cont).(*item)
return item.value, item.priority
}
// Pops only the item from the queue, dropping the associated priority value.
func (p *Prque) PopItem() interface{} {
return heap.Pop(p.cont).(*item).value
}
// Checks whether the priority queue is empty.
func (p *Prque) Empty() bool {
return p.cont.Len() == 0
}
// Returns the number of element in the priority queue.
func (p *Prque) Size() int {
return p.cont.Len()
}
// Clears the contents of the priority queue.
func (p *Prque) Reset() {
*p = *New()
}

View File

@@ -0,0 +1,139 @@
// CookieJar - A contestant's algorithm toolbox
// Copyright (c) 2013 Peter Szilagyi. All rights reserved.
//
// CookieJar is dual licensed: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// The toolbox is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// Alternatively, the CookieJar toolbox may be used in accordance with the terms
// and conditions contained in a signed written agreement between you and the
// author(s).
package prque
import (
"math/rand"
"testing"
)
func TestPrque(t *testing.T) {
// Generate a batch of random data and a specific priority order
size := 16 * blockSize
prio := rand.Perm(size)
data := make([]int, size)
for i := 0; i < size; i++ {
data[i] = rand.Int()
}
queue := New()
for rep := 0; rep < 2; rep++ {
// Fill a priority queue with the above data
for i := 0; i < size; i++ {
queue.Push(data[i], float32(prio[i]))
if queue.Size() != i+1 {
t.Errorf("queue size mismatch: have %v, want %v.", queue.Size(), i+1)
}
}
// Create a map the values to the priorities for easier verification
dict := make(map[float32]int)
for i := 0; i < size; i++ {
dict[float32(prio[i])] = data[i]
}
// Pop out the elements in priority order and verify them
prevPrio := float32(size + 1)
for !queue.Empty() {
val, prio := queue.Pop()
if prio > prevPrio {
t.Errorf("invalid priority order: %v after %v.", prio, prevPrio)
}
prevPrio = prio
if val != dict[prio] {
t.Errorf("push/pop mismatch: have %v, want %v.", val, dict[prio])
}
delete(dict, prio)
}
}
}
func TestReset(t *testing.T) {
// Generate a batch of random data and a specific priority order
size := 16 * blockSize
prio := rand.Perm(size)
data := make([]int, size)
for i := 0; i < size; i++ {
data[i] = rand.Int()
}
queue := New()
for rep := 0; rep < 2; rep++ {
// Fill a priority queue with the above data
for i := 0; i < size; i++ {
queue.Push(data[i], float32(prio[i]))
if queue.Size() != i+1 {
t.Errorf("queue size mismatch: have %v, want %v.", queue.Size(), i+1)
}
}
// Create a map the values to the priorities for easier verification
dict := make(map[float32]int)
for i := 0; i < size; i++ {
dict[float32(prio[i])] = data[i]
}
// Pop out half the elements in priority order and verify them
prevPrio := float32(size + 1)
for i := 0; i < size/2; i++ {
val, prio := queue.Pop()
if prio > prevPrio {
t.Errorf("invalid priority order: %v after %v.", prio, prevPrio)
}
prevPrio = prio
if val != dict[prio] {
t.Errorf("push/pop mismatch: have %v, want %v.", val, dict[prio])
}
delete(dict, prio)
}
// Reset and ensure it's empty
queue.Reset()
if !queue.Empty() {
t.Errorf("priority queue not empty after reset: %v", queue)
}
}
}
func BenchmarkPush(b *testing.B) {
// Create some initial data
data := make([]int, b.N)
prio := make([]float32, b.N)
for i := 0; i < len(data); i++ {
data[i] = rand.Int()
prio[i] = rand.Float32()
}
// Execute the benchmark
b.ResetTimer()
queue := New()
for i := 0; i < len(data); i++ {
queue.Push(data[i], prio[i])
}
}
func BenchmarkPop(b *testing.B) {
// Create some initial data
data := make([]int, b.N)
prio := make([]float32, b.N)
for i := 0; i < len(data); i++ {
data[i] = rand.Int()
prio[i] = rand.Float32()
}
queue := New()
for i := 0; i < len(data); i++ {
queue.Push(data[i], prio[i])
}
// Execute the benchmark
b.ResetTimer()
for !queue.Empty() {
queue.Pop()
}
}

View File

@@ -0,0 +1,100 @@
// CookieJar - A contestant's algorithm toolbox
// Copyright (c) 2013 Peter Szilagyi. All rights reserved.
//
// CookieJar is dual licensed: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// The toolbox is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// Alternatively, the CookieJar toolbox may be used in accordance with the terms
// and conditions contained in a signed written agreement between you and the
// author(s).
package prque
// The size of a block of data
const blockSize = 4096
// A prioritized item in the sorted stack.
type item struct {
value interface{}
priority float32
}
// Internal sortable stack data structure. Implements the Push and Pop ops for
// the stack (heap) functionality and the Len, Less and Swap methods for the
// sortability requirements of the heaps.
type sstack struct {
size int
capacity int
offset int
blocks [][]*item
active []*item
}
// Creates a new, empty stack.
func newSstack() *sstack {
result := new(sstack)
result.active = make([]*item, blockSize)
result.blocks = [][]*item{result.active}
result.capacity = blockSize
return result
}
// Pushes a value onto the stack, expanding it if necessary. Required by
// heap.Interface.
func (s *sstack) Push(data interface{}) {
if s.size == s.capacity {
s.active = make([]*item, blockSize)
s.blocks = append(s.blocks, s.active)
s.capacity += blockSize
s.offset = 0
} else if s.offset == blockSize {
s.active = s.blocks[s.size/blockSize]
s.offset = 0
}
s.active[s.offset] = data.(*item)
s.offset++
s.size++
}
// Pops a value off the stack and returns it. Currently no shrinking is done.
// Required by heap.Interface.
func (s *sstack) Pop() (res interface{}) {
s.size--
s.offset--
if s.offset < 0 {
s.offset = blockSize - 1
s.active = s.blocks[s.size/blockSize]
}
res, s.active[s.offset] = s.active[s.offset], nil
return
}
// Returns the length of the stack. Required by sort.Interface.
func (s *sstack) Len() int {
return s.size
}
// Compares the priority of two elements of the stack (higher is first).
// Required by sort.Interface.
func (s *sstack) Less(i, j int) bool {
return s.blocks[i/blockSize][i%blockSize].priority > s.blocks[j/blockSize][j%blockSize].priority
}
// Swaps two elements in the stack. Required by sort.Interface.
func (s *sstack) Swap(i, j int) {
ib, io, jb, jo := i/blockSize, i%blockSize, j/blockSize, j%blockSize
s.blocks[ib][io], s.blocks[jb][jo] = s.blocks[jb][jo], s.blocks[ib][io]
}
// Resets the stack, effectively clearing its contents.
func (s *sstack) Reset() {
*s = *newSstack()
}

View File

@@ -0,0 +1,109 @@
// CookieJar - A contestant's algorithm toolbox
// Copyright (c) 2013 Peter Szilagyi. All rights reserved.
//
// CookieJar is dual licensed: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// The toolbox is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// Alternatively, the CookieJar toolbox may be used in accordance with the terms
// and conditions contained in a signed written agreement between you and the
// author(s).
package prque
import (
"math/rand"
"sort"
"testing"
)
func TestSstack(t *testing.T) {
// Create some initial data
size := 16 * blockSize
data := make([]*item, size)
for i := 0; i < size; i++ {
data[i] = &item{rand.Int(), rand.Float32()}
}
stack := newSstack()
for rep := 0; rep < 2; rep++ {
// Push all the data into the stack, pop out every second
secs := []*item{}
for i := 0; i < size; i++ {
stack.Push(data[i])
if i%2 == 0 {
secs = append(secs, stack.Pop().(*item))
}
}
rest := []*item{}
for stack.Len() > 0 {
rest = append(rest, stack.Pop().(*item))
}
// Make sure the contents of the resulting slices are ok
for i := 0; i < size; i++ {
if i%2 == 0 && data[i] != secs[i/2] {
t.Errorf("push/pop mismatch: have %v, want %v.", secs[i/2], data[i])
}
if i%2 == 1 && data[i] != rest[len(rest)-i/2-1] {
t.Errorf("push/pop mismatch: have %v, want %v.", rest[len(rest)-i/2-1], data[i])
}
}
}
}
func TestSstackSort(t *testing.T) {
// Create some initial data
size := 16 * blockSize
data := make([]*item, size)
for i := 0; i < size; i++ {
data[i] = &item{rand.Int(), float32(i)}
}
// Push all the data into the stack
stack := newSstack()
for _, val := range data {
stack.Push(val)
}
// Sort and pop the stack contents (should reverse the order)
sort.Sort(stack)
for _, val := range data {
out := stack.Pop()
if out != val {
t.Errorf("push/pop mismatch after sort: have %v, want %v.", out, val)
}
}
}
func TestSstackReset(t *testing.T) {
// Create some initial data
size := 16 * blockSize
data := make([]*item, size)
for i := 0; i < size; i++ {
data[i] = &item{rand.Int(), rand.Float32()}
}
stack := newSstack()
for rep := 0; rep < 2; rep++ {
// Push all the data into the stack, pop out every second
secs := []*item{}
for i := 0; i < size; i++ {
stack.Push(data[i])
if i%2 == 0 {
secs = append(secs, stack.Pop().(*item))
}
}
// Reset and verify both pulled and stack contents
stack.Reset()
if stack.Len() != 0 {
t.Errorf("stack not empty after reset: %v", stack)
}
for i := 0; i < size; i++ {
if i%2 == 0 && data[i] != secs[i/2] {
t.Errorf("push/pop mismatch: have %v, want %v.", secs[i/2], data[i])
}
}
}
}

View File

@@ -1,16 +1,22 @@
package main
import (
"encoding/json"
"errors"
"fmt"
"math/big"
"strconv"
"time"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/compiler"
"github.com/ethereum/go-ethereum/common/natspec"
"github.com/ethereum/go-ethereum/common/resolver"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc"
@@ -43,6 +49,19 @@ func (js *jsre) adminBindings() {
admin.Set("export", js.exportChain)
admin.Set("verbosity", js.verbosity)
admin.Set("progress", js.downloadProgress)
admin.Set("setSolc", js.setSolc)
admin.Set("contractInfo", struct{}{})
t, _ = admin.Get("contractInfo")
cinfo := t.Object()
// newRegistry officially not documented temporary option
cinfo.Set("start", js.startNatSpec)
cinfo.Set("stop", js.stopNatSpec)
cinfo.Set("newRegistry", js.newRegistry)
cinfo.Set("get", js.getContractInfo)
cinfo.Set("register", js.register)
cinfo.Set("registerUrl", js.registerUrl)
// cinfo.Set("verify", js.verify)
admin.Set("miner", struct{}{})
t, _ = admin.Get("miner")
@@ -55,14 +74,21 @@ func (js *jsre) adminBindings() {
admin.Set("debug", struct{}{})
t, _ = admin.Get("debug")
debug := t.Object()
js.re.Set("sleep", js.sleep)
debug.Set("backtrace", js.backtrace)
debug.Set("printBlock", js.printBlock)
debug.Set("dumpBlock", js.dumpBlock)
debug.Set("getBlockRlp", js.getBlockRlp)
debug.Set("setHead", js.setHead)
debug.Set("processBlock", js.debugBlock)
// undocumented temporary
debug.Set("waitForBlocks", js.waitForBlocks)
}
// generic helper to getBlock by Number/Height or Hex depending on autodetected input
// if argument is missing the current block is returned
// if block is not found or there is problem with decoding
// the appropriate value is returned and block is guaranteed to be nil
func (js *jsre) getBlock(call otto.FunctionCall) (*types.Block, error) {
var block *types.Block
if len(call.ArgumentList) > 0 {
@@ -75,10 +101,14 @@ func (js *jsre) getBlock(call otto.FunctionCall) (*types.Block, error) {
} else {
return nil, errors.New("invalid argument for dump. Either hex string or number")
}
return block, nil
} else {
block = js.ethereum.ChainManager().CurrentBlock()
}
return nil, errors.New("requires block number or block hash as argument")
if block == nil {
return nil, errors.New("block not found")
}
return block, nil
}
func (js *jsre) pendingTransactions(call otto.FunctionCall) otto.Value {
@@ -152,11 +182,6 @@ func (js *jsre) debugBlock(call otto.FunctionCall) otto.Value {
return otto.UndefinedValue()
}
if block == nil {
fmt.Println("block not found")
return otto.UndefinedValue()
}
old := vm.Debug
vm.Debug = true
_, err = js.ethereum.BlockProcessor().RetryProcess(block)
@@ -175,11 +200,6 @@ func (js *jsre) setHead(call otto.FunctionCall) otto.Value {
return otto.UndefinedValue()
}
if block == nil {
fmt.Println("block not found")
return otto.UndefinedValue()
}
js.ethereum.ChainManager().SetHead(block)
return otto.UndefinedValue()
}
@@ -196,12 +216,6 @@ func (js *jsre) getBlockRlp(call otto.FunctionCall) otto.Value {
fmt.Println(err)
return otto.UndefinedValue()
}
if block == nil {
fmt.Println("block not found")
return otto.UndefinedValue()
}
encoded, _ := rlp.EncodeToBytes(block)
return js.re.ToVal(fmt.Sprintf("%x", encoded))
}
@@ -255,11 +269,13 @@ func (js *jsre) startMining(call otto.FunctionCall) otto.Value {
return otto.FalseValue()
}
// threads now ignored
err = js.ethereum.StartMining()
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
return otto.TrueValue()
}
@@ -298,9 +314,8 @@ func (js *jsre) startRPC(call otto.FunctionCall) otto.Value {
xeth := xeth.New(js.ethereum, nil)
err = rpc.Start(xeth, config)
if err != nil {
fmt.Printf(err.Error())
fmt.Println(err)
return otto.FalseValue()
}
@@ -345,7 +360,8 @@ func (js *jsre) unlock(call otto.FunctionCall) otto.Value {
fmt.Println("Please enter a passphrase now.")
passphrase, err = readPassword("Passphrase: ", true)
if err != nil {
utils.Fatalf("%v", err)
fmt.Println(err)
return otto.FalseValue()
}
} else {
passphrase, err = arg.ToString()
@@ -371,14 +387,17 @@ func (js *jsre) newAccount(call otto.FunctionCall) otto.Value {
fmt.Println("Please enter a passphrase now.")
auth, err := readPassword("Passphrase: ", true)
if err != nil {
utils.Fatalf("%v", err)
fmt.Println(err)
return otto.FalseValue()
}
confirm, err := readPassword("Repeat Passphrase: ", false)
if err != nil {
utils.Fatalf("%v", err)
fmt.Println(err)
return otto.FalseValue()
}
if auth != confirm {
utils.Fatalf("Passphrases did not match.")
fmt.Println("Passphrases did not match.")
return otto.FalseValue()
}
passphrase = auth
} else {
@@ -394,7 +413,7 @@ func (js *jsre) newAccount(call otto.FunctionCall) otto.Value {
fmt.Printf("Could not create the account: %v", err)
return otto.UndefinedValue()
}
return js.re.ToVal("0x" + common.Bytes2Hex(acct.Address))
return js.re.ToVal(common.ToHex(acct.Address))
}
func (js *jsre) nodeInfo(call otto.FunctionCall) otto.Value {
@@ -407,7 +426,7 @@ func (js *jsre) peers(call otto.FunctionCall) otto.Value {
func (js *jsre) importChain(call otto.FunctionCall) otto.Value {
if len(call.ArgumentList) == 0 {
fmt.Println("err: require file name")
fmt.Println("require file name. admin.importChain(filename)")
return otto.FalseValue()
}
fn, err := call.Argument(0).ToString()
@@ -424,7 +443,7 @@ func (js *jsre) importChain(call otto.FunctionCall) otto.Value {
func (js *jsre) exportChain(call otto.FunctionCall) otto.Value {
if len(call.ArgumentList) == 0 {
fmt.Println("err: require file name")
fmt.Println("require file name: admin.exportChain(filename)")
return otto.FalseValue()
}
@@ -441,23 +460,9 @@ func (js *jsre) exportChain(call otto.FunctionCall) otto.Value {
}
func (js *jsre) printBlock(call otto.FunctionCall) otto.Value {
var block *types.Block
if len(call.ArgumentList) > 0 {
if call.Argument(0).IsNumber() {
num, _ := call.Argument(0).ToInteger()
block = js.ethereum.ChainManager().GetBlockByNumber(uint64(num))
} else if call.Argument(0).IsString() {
hash, _ := call.Argument(0).ToString()
block = js.ethereum.ChainManager().GetBlock(common.HexToHash(hash))
} else {
fmt.Println("invalid argument for dump. Either hex string or number")
}
} else {
block = js.ethereum.ChainManager().CurrentBlock()
}
if block == nil {
fmt.Println("block not found")
block, err := js.getBlock(call)
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
@@ -467,30 +472,249 @@ func (js *jsre) printBlock(call otto.FunctionCall) otto.Value {
}
func (js *jsre) dumpBlock(call otto.FunctionCall) otto.Value {
var block *types.Block
if len(call.ArgumentList) > 0 {
if call.Argument(0).IsNumber() {
num, _ := call.Argument(0).ToInteger()
block = js.ethereum.ChainManager().GetBlockByNumber(uint64(num))
} else if call.Argument(0).IsString() {
hash, _ := call.Argument(0).ToString()
block = js.ethereum.ChainManager().GetBlock(common.HexToHash(hash))
} else {
fmt.Println("invalid argument for dump. Either hex string or number")
}
} else {
block = js.ethereum.ChainManager().CurrentBlock()
}
if block == nil {
fmt.Println("block not found")
block, err := js.getBlock(call)
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
statedb := state.New(block.Root(), js.ethereum.StateDb())
dump := statedb.RawDump()
return js.re.ToVal(dump)
}
func (js *jsre) waitForBlocks(call otto.FunctionCall) otto.Value {
if len(call.ArgumentList) > 2 {
fmt.Println("requires 0, 1 or 2 arguments: admin.debug.waitForBlock(minHeight, timeout)")
return otto.FalseValue()
}
var n, timeout int64
var timer <-chan time.Time
var height *big.Int
var err error
args := len(call.ArgumentList)
if args == 2 {
timeout, err = call.Argument(1).ToInteger()
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
timer = time.NewTimer(time.Duration(timeout) * time.Second).C
}
if args >= 1 {
n, err = call.Argument(0).ToInteger()
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
height = big.NewInt(n)
}
if args == 0 {
height = js.xeth.CurrentBlock().Number()
height.Add(height, common.Big1)
}
wait := js.wait
js.wait <- height
select {
case <-timer:
// if times out make sure the xeth loop does not block
go func() {
select {
case wait <- nil:
case <-wait:
}
}()
return otto.UndefinedValue()
case height = <-wait:
}
return js.re.ToVal(height.Uint64())
}
func (js *jsre) sleep(call otto.FunctionCall) otto.Value {
sec, err := call.Argument(0).ToInteger()
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
time.Sleep(time.Duration(sec) * time.Second)
return otto.UndefinedValue()
}
func (js *jsre) setSolc(call otto.FunctionCall) otto.Value {
if len(call.ArgumentList) != 1 {
fmt.Println("needs 1 argument: admin.contractInfo.setSolc(solcPath)")
return otto.FalseValue()
}
solcPath, err := call.Argument(0).ToString()
if err != nil {
return otto.FalseValue()
}
solc, err := js.xeth.SetSolc(solcPath)
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
fmt.Println(solc.Info())
return otto.TrueValue()
}
func (js *jsre) register(call otto.FunctionCall) otto.Value {
if len(call.ArgumentList) != 4 {
fmt.Println("requires 4 arguments: admin.contractInfo.register(fromaddress, contractaddress, contract, filename)")
return otto.UndefinedValue()
}
sender, err := call.Argument(0).ToString()
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
address, err := call.Argument(1).ToString()
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
raw, err := call.Argument(2).Export()
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
jsonraw, err := json.Marshal(raw)
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
var contract compiler.Contract
err = json.Unmarshal(jsonraw, &contract)
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
filename, err := call.Argument(3).ToString()
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
contenthash, err := compiler.ExtractInfo(&contract, filename)
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
// sender and contract address are passed as hex strings
codeb := js.xeth.CodeAtBytes(address)
codehash := common.BytesToHash(crypto.Sha3(codeb))
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
registry := resolver.New(js.xeth)
_, err = registry.RegisterContentHash(common.HexToAddress(sender), codehash, contenthash)
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
return js.re.ToVal(contenthash.Hex())
}
func (js *jsre) registerUrl(call otto.FunctionCall) otto.Value {
if len(call.ArgumentList) != 3 {
fmt.Println("requires 3 arguments: admin.contractInfo.register(fromaddress, contenthash, filename)")
return otto.FalseValue()
}
sender, err := call.Argument(0).ToString()
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
contenthash, err := call.Argument(1).ToString()
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
url, err := call.Argument(2).ToString()
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
registry := resolver.New(js.xeth)
_, err = registry.RegisterUrl(common.HexToAddress(sender), common.HexToHash(contenthash), url)
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
return otto.TrueValue()
}
func (js *jsre) getContractInfo(call otto.FunctionCall) otto.Value {
if len(call.ArgumentList) != 1 {
fmt.Println("requires 1 argument: admin.contractInfo.register(contractaddress)")
return otto.FalseValue()
}
addr, err := call.Argument(0).ToString()
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
infoDoc, err := natspec.FetchDocsForContract(addr, js.xeth, ds)
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
var info compiler.ContractInfo
err = json.Unmarshal(infoDoc, &info)
if err != nil {
fmt.Println(err)
return otto.UndefinedValue()
}
return js.re.ToVal(info)
}
func (js *jsre) startNatSpec(call otto.FunctionCall) otto.Value {
js.ethereum.NatSpec = true
return otto.TrueValue()
}
func (js *jsre) stopNatSpec(call otto.FunctionCall) otto.Value {
js.ethereum.NatSpec = false
return otto.TrueValue()
}
func (js *jsre) newRegistry(call otto.FunctionCall) otto.Value {
if len(call.ArgumentList) != 1 {
fmt.Println("requires 1 argument: admin.contractInfo.newRegistry(adminaddress)")
return otto.FalseValue()
}
addr, err := call.Argument(0).ToString()
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
registry := resolver.New(js.xeth)
err = registry.CreateContracts(common.HexToAddress(addr))
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
return otto.TrueValue()
}
// internal transaction type which will allow us to resend transactions using `eth.resend`

1
cmd/geth/info_test.json Normal file
View File

@@ -0,0 +1 @@
{"code":"605280600c6000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa114602e57005b60376004356041565b8060005260206000f35b6000600782029050604d565b91905056","info":{"abiDefinition":[{"constant":false,"inputs":[{"name":"a","type":"uint256"}],"name":"multiply","outputs":[{"name":"d","type":"uint256"}],"type":"function"}],"compilerVersion":"0.9.13","developerDoc":{"methods":{}},"language":"Solidity","languageVersion":"0","source":"contract test {\n /// @notice Will multiply `a` by 7.\n function multiply(uint a) returns(uint d) {\n return a * 7;\n }\n}\n","userDoc":{"methods":{"multiply(uint256)":{"notice":"Will multiply `a` by 7."}}}}}

View File

@@ -20,6 +20,7 @@ package main
import (
"bufio"
"fmt"
"math/big"
"os"
"path"
"strings"
@@ -62,19 +63,26 @@ type jsre struct {
re *re.JSRE
ethereum *eth.Ethereum
xeth *xeth.XEth
wait chan *big.Int
ps1 string
atexit func()
corsDomain string
prompter
}
func newJSRE(ethereum *eth.Ethereum, libPath string, interactive bool, corsDomain string) *jsre {
func newJSRE(ethereum *eth.Ethereum, libPath, solcPath, corsDomain string, interactive bool, f xeth.Frontend) *jsre {
js := &jsre{ethereum: ethereum, ps1: "> "}
// set default cors domain used by startRpc from CLI flag
js.corsDomain = corsDomain
js.xeth = xeth.New(ethereum, js)
if f == nil {
f = js
}
js.xeth = xeth.New(ethereum, f)
js.wait = js.xeth.UpdateState()
// update state in separare forever blocks
js.xeth.SetSolc(solcPath)
js.re = re.New(libPath)
js.apiBindings()
js.apiBindings(f)
js.adminBindings()
if !liner.TerminalSupported() || !interactive {
@@ -87,18 +95,17 @@ func newJSRE(ethereum *eth.Ethereum, libPath string, interactive bool, corsDomai
js.atexit = func() {
js.withHistory(func(hist *os.File) { hist.Truncate(0); lr.WriteHistory(hist) })
lr.Close()
close(js.wait)
}
}
return js
}
func (js *jsre) apiBindings() {
ethApi := rpc.NewEthereumApi(js.xeth)
//js.re.Bind("jeth", rpc.NewJeth(ethApi, js.re.ToVal))
func (js *jsre) apiBindings(f xeth.Frontend) {
xe := xeth.New(js.ethereum, f)
ethApi := rpc.NewEthereumApi(xe)
jeth := rpc.NewJeth(ethApi, js.re.ToVal, js.re)
//js.re.Bind("jeth", jeth)
js.re.Set("jeth", struct{}{})
t, _ := js.re.Get("jeth")
jethObj := t.Object()
@@ -110,12 +117,6 @@ func (js *jsre) apiBindings() {
utils.Fatalf("Error loading bignumber.js: %v", err)
}
// we need to declare a dummy setTimeout. Otto does not support it
_, err = js.re.Eval("setTimeout = function(cb, delay) {};")
if err != nil {
utils.Fatalf("Error defining setTimeout: %v", err)
}
err = js.re.Compile("ethereum.js", re.Ethereum_JS)
if err != nil {
utils.Fatalf("Error loading ethereum.js: %v", err)
@@ -143,13 +144,13 @@ var net = web3.net;
js.re.Eval(globalRegistrar + "registrar = new GlobalRegistrar(\"" + globalRegistrarAddr + "\");")
}
var ds, _ = docserver.New(utils.JSpathFlag.String())
var ds, _ = docserver.New("/")
func (self *jsre) ConfirmTransaction(tx string) bool {
if self.ethereum.NatSpec {
notice := natspec.GetNotice(self.xeth, tx, ds)
fmt.Println(notice)
answer, _ := self.Prompt("Confirm Transaction\n[y/n] ")
answer, _ := self.Prompt("Confirm Transaction [y/n]")
return strings.HasPrefix(strings.Trim(answer, " "), "y")
} else {
return true

View File

@@ -6,60 +6,132 @@ import (
"os"
"path"
"path/filepath"
"testing"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"regexp"
"runtime"
"strconv"
"testing"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/compiler"
"github.com/ethereum/go-ethereum/common/docserver"
"github.com/ethereum/go-ethereum/common/natspec"
"github.com/ethereum/go-ethereum/common/resolver"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
)
var port = 30300
const (
testSolcPath = ""
func testJEthRE(t *testing.T) (*jsre, *eth.Ethereum) {
testKey = "e6fab74a43941f82d89cb7faa408e227cdad3153c4720e540e855c19b15e6674"
testAddress = "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
testBalance = "10000000000000000000"
)
var (
testGenesis = `{"` + testAddress[2:] + `": {"balance": "` + testBalance + `"}}`
)
type testjethre struct {
*jsre
stateDb *state.StateDB
lastConfirm string
ds *docserver.DocServer
}
func (self *testjethre) UnlockAccount(acc []byte) bool {
err := self.ethereum.AccountManager().Unlock(acc, "")
if err != nil {
panic("unable to unlock")
}
return true
}
func (self *testjethre) ConfirmTransaction(tx string) bool {
if self.ethereum.NatSpec {
self.lastConfirm = natspec.GetNotice(self.xeth, tx, self.ds)
}
return true
}
func testJEthRE(t *testing.T) (string, *testjethre, *eth.Ethereum) {
tmp, err := ioutil.TempDir("", "geth-test")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(tmp)
ks := crypto.NewKeyStorePlain(filepath.Join(tmp, "keys"))
// set up mock genesis with balance on the testAddress
core.GenesisData = []byte(testGenesis)
ks := crypto.NewKeyStorePassphrase(filepath.Join(tmp, "keys"))
am := accounts.NewManager(ks)
ethereum, err := eth.New(&eth.Config{
DataDir: tmp,
AccountManager: accounts.NewManager(ks),
AccountManager: am,
MaxPeers: 0,
Name: "test",
})
if err != nil {
t.Fatal("%v", err)
}
keyb, err := crypto.HexToECDSA(testKey)
if err != nil {
t.Fatal(err)
}
key := crypto.NewKeyFromECDSA(keyb)
err = ks.StoreKey(key, "")
if err != nil {
t.Fatal(err)
}
err = am.Unlock(key.Address, "")
if err != nil {
t.Fatal(err)
}
assetPath := path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "cmd", "mist", "assets", "ext")
repl := newJSRE(ethereum, assetPath, false, "")
return repl, ethereum
ds, err := docserver.New("/")
if err != nil {
t.Errorf("Error creating DocServer: %v", err)
}
tf := &testjethre{ds: ds, stateDb: ethereum.ChainManager().State().Copy()}
repl := newJSRE(ethereum, assetPath, testSolcPath, "", false, tf)
tf.jsre = repl
return tmp, tf, ethereum
}
// this line below is needed for transaction to be applied to the state in testing
// the heavy lifing is done in XEth.ApplyTestTxs
// this is fragile, overwriting xeth will result in
// process leaking since xeth loops cannot quit safely
// should be replaced by proper mining with testDAG for easy full integration tests
// txc, self.xeth = self.xeth.ApplyTestTxs(self.xeth.repl.stateDb, coinbase, txc)
func TestNodeInfo(t *testing.T) {
repl, ethereum := testJEthRE(t)
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err)
}
defer ethereum.Stop()
defer os.RemoveAll(tmp)
want := `{"DiscPort":0,"IP":"0.0.0.0","ListenAddr":"","Name":"test","NodeID":"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","NodeUrl":"enode://00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000@0.0.0.0:0","TCPPort":0,"Td":"0"}`
checkEvalJSON(t, repl, `admin.nodeInfo()`, want)
}
func TestAccounts(t *testing.T) {
repl, ethereum := testJEthRE(t)
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err)
}
defer ethereum.Stop()
defer os.RemoveAll(tmp)
checkEvalJSON(t, repl, `eth.accounts`, `[]`)
checkEvalJSON(t, repl, `eth.coinbase`, `"0x"`)
checkEvalJSON(t, repl, `eth.accounts`, `["`+testAddress+`"]`)
checkEvalJSON(t, repl, `eth.coinbase`, `"`+testAddress+`"`)
val, err := repl.re.Run(`admin.newAccount("password")`)
if err != nil {
@@ -70,17 +142,18 @@ func TestAccounts(t *testing.T) {
t.Errorf("address not hex: %q", addr)
}
checkEvalJSON(t, repl, `eth.accounts`, `["`+addr+`"]`)
checkEvalJSON(t, repl, `eth.coinbase`, `"`+addr+`"`)
// skip until order fixed #824
// checkEvalJSON(t, repl, `eth.accounts`, `["`+testAddress+`", "`+addr+`"]`)
// checkEvalJSON(t, repl, `eth.coinbase`, `"`+testAddress+`"`)
}
func TestBlockChain(t *testing.T) {
repl, ethereum := testJEthRE(t)
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err)
}
defer ethereum.Stop()
defer os.RemoveAll(tmp)
// get current block dump before export/import.
val, err := repl.re.Run("JSON.stringify(admin.debug.dumpBlock())")
if err != nil {
@@ -89,12 +162,12 @@ func TestBlockChain(t *testing.T) {
beforeExport := val.String()
// do the export
tmp, err := ioutil.TempDir("", "geth-test-export")
extmp, err := ioutil.TempDir("", "geth-test-export")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(tmp)
tmpfile := filepath.Join(tmp, "export.chain")
defer os.RemoveAll(extmp)
tmpfile := filepath.Join(extmp, "export.chain")
tmpfileq := strconv.Quote(tmpfile)
checkEvalJSON(t, repl, `admin.export(`+tmpfileq+`)`, `true`)
@@ -108,27 +181,143 @@ func TestBlockChain(t *testing.T) {
}
func TestMining(t *testing.T) {
repl, ethereum := testJEthRE(t)
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Fatalf("error starting ethereum: %v", err)
}
defer ethereum.Stop()
defer os.RemoveAll(tmp)
checkEvalJSON(t, repl, `eth.mining`, `false`)
}
func TestRPC(t *testing.T) {
repl, ethereum := testJEthRE(t)
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Errorf("error starting ethereum: %v", err)
return
}
defer ethereum.Stop()
defer os.RemoveAll(tmp)
checkEvalJSON(t, repl, `admin.startRPC("127.0.0.1", 5004)`, `true`)
}
func checkEvalJSON(t *testing.T, re *jsre, expr, want string) error {
func TestCheckTestAccountBalance(t *testing.T) {
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Errorf("error starting ethereum: %v", err)
return
}
defer ethereum.Stop()
defer os.RemoveAll(tmp)
repl.re.Run(`primary = "` + testAddress + `"`)
checkEvalJSON(t, repl, `eth.getBalance(primary)`, `"`+testBalance+`"`)
}
func TestContract(t *testing.T) {
tmp, repl, ethereum := testJEthRE(t)
if err := ethereum.Start(); err != nil {
t.Errorf("error starting ethereum: %v", err)
return
}
defer ethereum.Stop()
defer os.RemoveAll(tmp)
var txc uint64
coinbase := common.HexToAddress(testAddress)
resolver.New(repl.xeth).CreateContracts(coinbase)
source := `contract test {\n` +
" /// @notice Will multiply `a` by 7." + `\n` +
` function multiply(uint a) returns(uint d) {\n` +
` return a * 7;\n` +
` }\n` +
`}\n`
checkEvalJSON(t, repl, `admin.contractInfo.stop()`, `true`)
contractInfo, err := ioutil.ReadFile("info_test.json")
if err != nil {
t.Fatalf("%v", err)
}
checkEvalJSON(t, repl, `primary = eth.accounts[0]`, `"`+testAddress+`"`)
checkEvalJSON(t, repl, `source = "`+source+`"`, `"`+source+`"`)
_, err = compiler.New("")
if err != nil {
t.Logf("solc not found: skipping compiler test")
info, err := ioutil.ReadFile("info_test.json")
if err != nil {
t.Fatalf("%v", err)
}
_, err = repl.re.Run(`contract = JSON.parse(` + strconv.Quote(string(info)) + `)`)
if err != nil {
t.Errorf("%v", err)
}
} else {
checkEvalJSON(t, repl, `contract = eth.compile.solidity(source)`, string(contractInfo))
}
checkEvalJSON(t, repl, `contract.code`, `"605280600c6000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa114602e57005b60376004356041565b8060005260206000f35b6000600782029050604d565b91905056"`)
checkEvalJSON(
t, repl,
`contractaddress = eth.sendTransaction({from: primary, data: contract.code })`,
`"0x5dcaace5982778b409c524873b319667eba5d074"`,
)
callSetup := `abiDef = JSON.parse('[{"constant":false,"inputs":[{"name":"a","type":"uint256"}],"name":"multiply","outputs":[{"name":"d","type":"uint256"}],"type":"function"}]');
Multiply7 = eth.contract(abiDef);
multiply7 = new Multiply7(contractaddress);
`
_, err = repl.re.Run(callSetup)
if err != nil {
t.Errorf("unexpected error registering, got %v", err)
}
// updatespec
// why is this sometimes failing?
// checkEvalJSON(t, repl, `multiply7.multiply.call(6)`, `42`)
expNotice := ""
if repl.lastConfirm != expNotice {
t.Errorf("incorrect confirmation message: expected %v, got %v", expNotice, repl.lastConfirm)
}
// why 0?
checkEvalJSON(t, repl, `eth.getBlock("pending", true).transactions.length`, `0`)
txc, repl.xeth = repl.xeth.ApplyTestTxs(repl.stateDb, coinbase, txc)
checkEvalJSON(t, repl, `admin.contractInfo.start()`, `true`)
checkEvalJSON(t, repl, `multiply7.multiply.sendTransaction(6, { from: primary, gas: "1000000", gasPrice: "100000" })`, `undefined`)
expNotice = `About to submit transaction (no NatSpec info found for contract: content hash not found for '0x4a6c99e127191d2ee302e42182c338344b39a37a47cdbb17ab0f26b6802eb4d1'): {"params":[{"to":"0x5dcaace5982778b409c524873b319667eba5d074","data": "0xc6888fa10000000000000000000000000000000000000000000000000000000000000006"}]}`
if repl.lastConfirm != expNotice {
t.Errorf("incorrect confirmation message: expected %v, got %v", expNotice, repl.lastConfirm)
}
checkEvalJSON(t, repl, `filename = "/tmp/info.json"`, `"/tmp/info.json"`)
checkEvalJSON(t, repl, `contenthash = admin.contractInfo.register(primary, contractaddress, contract, filename)`, `"0x57e577316ccee6514797d9de9823af2004fdfe22bcfb6e39bbb8f92f57dcc421"`)
checkEvalJSON(t, repl, `admin.contractInfo.registerUrl(primary, contenthash, "file://"+filename)`, `true`)
if err != nil {
t.Errorf("unexpected error registering, got %v", err)
}
checkEvalJSON(t, repl, `admin.contractInfo.start()`, `true`)
// update state
txc, repl.xeth = repl.xeth.ApplyTestTxs(repl.stateDb, coinbase, txc)
checkEvalJSON(t, repl, `multiply7.multiply.sendTransaction(6, { from: primary, gas: "1000000", gasPrice: "100000" })`, `undefined`)
expNotice = "Will multiply 6 by 7."
if repl.lastConfirm != expNotice {
t.Errorf("incorrect confirmation message: expected %v, got %v", expNotice, repl.lastConfirm)
}
}
func checkEvalJSON(t *testing.T, re *testjethre, expr, want string) error {
val, err := re.re.Run("JSON.stringify(" + expr + ")")
if err == nil && val.String() != want {
err = fmt.Errorf("Output mismatch for `%s`:\ngot: %s\nwant: %s", expr, val.String(), want)

View File

@@ -51,7 +51,7 @@ import _ "net/http/pprof"
const (
ClientIdentifier = "Geth"
Version = "0.9.16"
Version = "0.9.17"
)
var (
@@ -242,6 +242,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.JSpathFlag,
utils.ListenPortFlag,
utils.MaxPeersFlag,
utils.MaxPendingPeersFlag,
utils.EtherbaseFlag,
utils.MinerThreadsFlag,
utils.MiningEnabledFlag,
@@ -265,6 +266,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.LogJSONFlag,
utils.PProfEanbledFlag,
utils.PProfPortFlag,
utils.SolcPathFlag,
}
app.Before = func(ctx *cli.Context) error {
if ctx.GlobalBool(utils.PProfEanbledFlag.Name) {
@@ -320,7 +322,14 @@ func console(ctx *cli.Context) {
}
startEth(ctx, ethereum)
repl := newJSRE(ethereum, ctx.String(utils.JSpathFlag.Name), true, ctx.GlobalString(utils.RPCCORSDomainFlag.Name))
repl := newJSRE(
ethereum,
ctx.String(utils.JSpathFlag.Name),
ctx.String(utils.SolcPathFlag.Name),
ctx.GlobalString(utils.RPCCORSDomainFlag.Name),
true,
nil,
)
repl.interactive()
ethereum.Stop()
@@ -335,7 +344,14 @@ func execJSFiles(ctx *cli.Context) {
}
startEth(ctx, ethereum)
repl := newJSRE(ethereum, ctx.String(utils.JSpathFlag.Name), false, ctx.GlobalString(utils.RPCCORSDomainFlag.Name))
repl := newJSRE(
ethereum,
ctx.String(utils.JSpathFlag.Name),
ctx.String(utils.SolcPathFlag.Name),
ctx.GlobalString(utils.RPCCORSDomainFlag.Name),
false,
nil,
)
for _, file := range ctx.Args() {
repl.exec(file)
}
@@ -362,6 +378,7 @@ func unlockAccount(ctx *cli.Context, am *accounts.Manager, account string) (pass
func startEth(ctx *cli.Context, eth *eth.Ethereum) {
// Start Ethereum itself
utils.StartEthereum(eth)
am := eth.AccountManager()

View File

@@ -75,6 +75,7 @@ func init() {
utils.LogFileFlag,
utils.LogLevelFlag,
utils.MaxPeersFlag,
utils.MaxPendingPeersFlag,
utils.MinerThreadsFlag,
utils.NATFlag,
utils.NodeKeyFileFlag,

View File

@@ -95,19 +95,10 @@ func initDataDir(Datadir string) {
}
}
func exit(err error) {
status := 0
if err != nil {
fmt.Fprintln(os.Stderr, "Fatal:", err)
status = 1
}
logger.Flush()
os.Exit(status)
}
// Fatalf formats a message to standard output and exits the program.
func Fatalf(format string, args ...interface{}) {
fmt.Fprintf(os.Stderr, "Fatal: "+format+"\n", args...)
fmt.Fprintf(os.Stdout, "Fatal: "+format+"\n", args...)
logger.Flush()
os.Exit(1)
}
@@ -115,7 +106,7 @@ func Fatalf(format string, args ...interface{}) {
func StartEthereum(ethereum *eth.Ethereum) {
glog.V(logger.Info).Infoln("Starting ", ethereum.Name())
if err := ethereum.Start(); err != nil {
exit(err)
Fatalf("Error starting Ethereum: %v", err)
}
RegisterInterrupt(func(sig os.Signal) {
ethereum.Stop()

View File

@@ -195,7 +195,12 @@ var (
MaxPeersFlag = cli.IntFlag{
Name: "maxpeers",
Usage: "Maximum number of network peers (network disabled if set to 0)",
Value: 16,
Value: 25,
}
MaxPendingPeersFlag = cli.IntFlag{
Name: "maxpendpeers",
Usage: "Maximum number of pending connection attempts (defaults used if set to 0)",
Value: 0,
}
ListenPortFlag = cli.IntFlag{
Name: "port",
@@ -224,11 +229,17 @@ var (
Name: "shh",
Usage: "Enable whisper",
}
// ATM the url is left to the user and deployment to
JSpathFlag = cli.StringFlag{
Name: "jspath",
Usage: "JS library path to be used with console and js subcommands",
Value: ".",
}
SolcPathFlag = cli.StringFlag{
Name: "solc",
Usage: "solidity compiler to be used",
Value: "solc",
}
)
func GetNAT(ctx *cli.Context) nat.Interface {
@@ -286,6 +297,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
AccountManager: GetAccountManager(ctx),
VmDebug: ctx.GlobalBool(VMDebugFlag.Name),
MaxPeers: ctx.GlobalInt(MaxPeersFlag.Name),
MaxPendingPeers: ctx.GlobalInt(MaxPendingPeersFlag.Name),
Port: ctx.GlobalString(ListenPortFlag.Name),
NAT: GetNAT(ctx),
NatSpec: ctx.GlobalBool(NatspecEnabledFlag.Name),
@@ -294,6 +306,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
Dial: true,
BootNodes: ctx.GlobalString(BootnodesFlag.Name),
}
}
func GetChain(ctx *cli.Context) (*core.ChainManager, common.Database, common.Database) {

187
common/compiler/solidity.go Normal file
View File

@@ -0,0 +1,187 @@
package compiler
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
"regexp"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
)
const (
flair = "Christian <c@ethdev.com> and Lefteris <lefteris@ethdev.com> (c) 2014-2015"
languageVersion = "0"
)
var (
versionRegExp = regexp.MustCompile("[0-9]+.[0-9]+.[0-9]+")
params = []string{
"--binary", // Request to output the contract in binary (hexadecimal).
"file", //
"--json-abi", // Request to output the contract's JSON ABI interface.
"file", //
"--natspec-user", // Request to output the contract's Natspec user documentation.
"file", //
"--natspec-dev", // Request to output the contract's Natspec developer documentation.
"file",
}
)
type Contract struct {
Code string `json:"code"`
Info ContractInfo `json:"info"`
}
type ContractInfo struct {
Source string `json:"source"`
Language string `json:"language"`
LanguageVersion string `json:"languageVersion"`
CompilerVersion string `json:"compilerVersion"`
AbiDefinition interface{} `json:"abiDefinition"`
UserDoc interface{} `json:"userDoc"`
DeveloperDoc interface{} `json:"developerDoc"`
}
type Solidity struct {
solcPath string
version string
}
func New(solcPath string) (sol *Solidity, err error) {
// set default solc
if len(solcPath) == 0 {
solcPath = "solc"
}
solcPath, err = exec.LookPath(solcPath)
if err != nil {
return
}
cmd := exec.Command(solcPath, "--version")
var out bytes.Buffer
cmd.Stdout = &out
err = cmd.Run()
if err != nil {
return
}
version := versionRegExp.FindString(out.String())
sol = &Solidity{
solcPath: solcPath,
version: version,
}
glog.V(logger.Info).Infoln(sol.Info())
return
}
func (sol *Solidity) Info() string {
return fmt.Sprintf("solc v%s\nSolidity Compiler: %s\n%s", sol.version, sol.solcPath, flair)
}
func (sol *Solidity) Compile(source string) (contract *Contract, err error) {
if len(source) == 0 {
err = fmt.Errorf("empty source")
return
}
wd, err := ioutil.TempDir("", "solc")
if err != nil {
return
}
defer os.RemoveAll(wd)
in := strings.NewReader(source)
var out bytes.Buffer
// cwd set to temp dir
cmd := exec.Command(sol.solcPath, params...)
cmd.Dir = wd
cmd.Stdin = in
cmd.Stdout = &out
err = cmd.Run()
if err != nil {
err = fmt.Errorf("solc error: %v", err)
return
}
matches, _ := filepath.Glob(wd + "/*.binary")
if len(matches) < 1 {
err = fmt.Errorf("solc error: missing code output")
return
}
if len(matches) > 1 {
err = fmt.Errorf("multi-contract sources are not supported")
return
}
_, file := filepath.Split(matches[0])
base := strings.Split(file, ".")[0]
codeFile := path.Join(wd, base+".binary")
abiDefinitionFile := path.Join(wd, base+".abi")
userDocFile := path.Join(wd, base+".docuser")
developerDocFile := path.Join(wd, base+".docdev")
code, err := ioutil.ReadFile(codeFile)
if err != nil {
err = fmt.Errorf("error reading compiler output for code: %v", err)
return
}
abiDefinitionJson, err := ioutil.ReadFile(abiDefinitionFile)
if err != nil {
err = fmt.Errorf("error reading compiler output for abiDefinition: %v", err)
return
}
var abiDefinition interface{}
err = json.Unmarshal(abiDefinitionJson, &abiDefinition)
userDocJson, err := ioutil.ReadFile(userDocFile)
if err != nil {
err = fmt.Errorf("error reading compiler output for userDoc: %v", err)
return
}
var userDoc interface{}
err = json.Unmarshal(userDocJson, &userDoc)
developerDocJson, err := ioutil.ReadFile(developerDocFile)
if err != nil {
err = fmt.Errorf("error reading compiler output for developerDoc: %v", err)
return
}
var developerDoc interface{}
err = json.Unmarshal(developerDocJson, &developerDoc)
contract = &Contract{
Code: string(code),
Info: ContractInfo{
Source: source,
Language: "Solidity",
LanguageVersion: languageVersion,
CompilerVersion: sol.version,
AbiDefinition: abiDefinition,
UserDoc: userDoc,
DeveloperDoc: developerDoc,
},
}
return
}
func ExtractInfo(contract *Contract, filename string) (contenthash common.Hash, err error) {
contractInfo, err := json.Marshal(contract.Info)
if err != nil {
return
}
contenthash = common.BytesToHash(crypto.Sha3(contractInfo))
err = ioutil.WriteFile(filename, contractInfo, 0600)
return
}

View File

@@ -0,0 +1,89 @@
package compiler
import (
"encoding/json"
"io/ioutil"
"os"
"testing"
"github.com/ethereum/go-ethereum/common"
)
var (
source = `
contract test {
/// @notice Will multiply ` + "`a`" + ` by 7.
function multiply(uint a) returns(uint d) {
return a * 7;
}
}
`
code = "605280600c6000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa114602e57005b60376004356041565b8060005260206000f35b6000600782029050604d565b91905056"
info = `{"source":"\ncontract test {\n /// @notice Will multiply ` + "`a`" + ` by 7.\n function multiply(uint a) returns(uint d) {\n return a * 7;\n }\n}\n","language":"Solidity","languageVersion":"0","compilerVersion":"0.9.13","abiDefinition":[{"constant":false,"inputs":[{"name":"a","type":"uint256"}],"name":"multiply","outputs":[{"name":"d","type":"uint256"}],"type":"function"}],"userDoc":{"methods":{"multiply(uint256)":{"notice":"Will multiply ` + "`a`" + ` by 7."}}},"developerDoc":{"methods":{}}}`
infohash = common.HexToHash("0xfdb031637e8a1c1891143f8d129ebc7f7c4e4b41ecad8c85abe1756190f74204")
)
func TestCompiler(t *testing.T) {
sol, err := New("")
if err != nil {
t.Skip("no solc installed")
}
contract, err := sol.Compile(source)
if err != nil {
t.Errorf("error compiling source. result %v: %v", contract, err)
return
}
if contract.Code != code {
t.Errorf("wrong code, expected\n%s, got\n%s", code, contract.Code)
}
}
func TestCompileError(t *testing.T) {
sol, err := New("")
if err != nil {
t.Skip("no solc installed")
}
contract, err := sol.Compile(source[2:])
if err == nil {
t.Errorf("error expected compiling source. got none. result %v", contract)
return
}
}
func TestNoCompiler(t *testing.T) {
_, err := New("/path/to/solc")
if err != nil {
t.Log("solidity quits with error: %v", err)
} else {
t.Errorf("no solc installed, but got no error")
}
}
func TestExtractInfo(t *testing.T) {
var cinfo ContractInfo
err := json.Unmarshal([]byte(info), &cinfo)
if err != nil {
t.Errorf("%v", err)
}
contract := &Contract{
Code: "",
Info: cinfo,
}
filename := "/tmp/solctest.info.json"
os.Remove(filename)
cinfohash, err := ExtractInfo(contract, filename)
if err != nil {
t.Errorf("%v", err)
}
got, err := ioutil.ReadFile(filename)
if err != nil {
t.Errorf("%v", err)
}
if string(got) != info {
t.Errorf("incorrect info.json extracted, expected:\n%s\ngot\n%s", info, string(got))
}
if cinfohash != infohash {
t.Errorf("content hash for info is incorrect. expected %v, got %v", infohash.Hex(), cinfohash.Hex())
}
}

View File

@@ -17,118 +17,119 @@ import (
type abi2method map[[8]byte]*method
type NatSpec struct {
jsvm *otto.Otto
userDocJson, abiDocJson []byte
userDoc userDoc
tx, data string
// abiDoc abiDoc
}
func getFallbackNotice(comment, tx string) string {
return "About to submit transaction (" + comment + "): " + tx
jsvm *otto.Otto
abiDocJson []byte
userDoc userDoc
tx, data string
}
// main entry point for to get natspec notice for a transaction
// the implementation is frontend friendly in that it always gives back
// a notice that is safe to display
// :FIXME: the second return value is an error, which can be used to fine-tune bahaviour
func GetNotice(xeth *xeth.XEth, tx string, http *docserver.DocServer) (notice string) {
ns, err := New(xeth, tx, http)
if err != nil {
if ns == nil {
return getFallbackNotice("no NatSpec info found for contract", tx)
return getFallbackNotice(fmt.Sprintf("no NatSpec info found for contract: %v", err), tx)
} else {
return getFallbackNotice("invalid NatSpec info", tx)
return getFallbackNotice(fmt.Sprintf("invalid NatSpec info: %v", err), tx)
}
}
notice, err2 := ns.Notice()
if err2 != nil {
return getFallbackNotice("NatSpec notice error \""+err2.Error()+"\"", tx)
notice, err = ns.Notice()
if err != nil {
return getFallbackNotice(fmt.Sprintf("NatSpec notice error: %v", err), tx)
}
return
}
func New(xeth *xeth.XEth, tx string, http *docserver.DocServer) (self *NatSpec, err error) {
func getFallbackNotice(comment, tx string) string {
return fmt.Sprintf("About to submit transaction (%s): %s", comment, tx)
}
type transaction struct {
To string `json:"to"`
Data string `json:"data"`
}
type jsonTx struct {
Params []transaction `json:"params"`
}
type contractInfo struct {
Source string `json:"source"`
Language string `json:"language"`
Version string `json:"compilerVersion"`
AbiDefinition json.RawMessage `json:"abiDefinition"`
UserDoc userDoc `json:"userDoc"`
DeveloperDoc json.RawMessage `json:"developerDoc"`
}
func New(xeth *xeth.XEth, jsontx string, http *docserver.DocServer) (self *NatSpec, err error) {
// extract contract address from tx
var obj map[string]json.RawMessage
err = json.Unmarshal([]byte(tx), &obj)
var tx jsonTx
err = json.Unmarshal([]byte(jsontx), &tx)
if err != nil {
return
}
var tmp []map[string]string
err = json.Unmarshal(obj["params"], &tmp)
t := tx.Params[0]
contractAddress := t.To
content, err := FetchDocsForContract(contractAddress, xeth, http)
if err != nil {
return
}
contractAddress := tmp[0]["to"]
self, err = NewWithDocs(content, jsontx, t.Data)
return
}
// also called by admin.contractInfo.get
func FetchDocsForContract(contractAddress string, xeth *xeth.XEth, http *docserver.DocServer) (content []byte, err error) {
// retrieve contract hash from state
if !xeth.IsContract(contractAddress) {
err = fmt.Errorf("NatSpec error: contract not found")
codehex := xeth.CodeAt(contractAddress)
codeb := xeth.CodeAtBytes(contractAddress)
if codehex == "0x" {
err = fmt.Errorf("contract (%v) not found", contractAddress)
return
}
codehex := xeth.CodeAt(contractAddress)
codeHash := common.BytesToHash(crypto.Sha3(common.Hex2Bytes(codehex[2:])))
// parse out host/domain
codehash := common.BytesToHash(crypto.Sha3(codeb))
// set up nameresolver with natspecreg + urlhint contract addresses
res := resolver.New(
xeth,
resolver.URLHintContractAddress,
resolver.HashRegContractAddress,
)
res := resolver.New(xeth)
// resolve host via HashReg/UrlHint Resolver
uri, hash, err := res.KeyToUrl(codeHash)
uri, hash, err := res.KeyToUrl(codehash)
if err != nil {
return
}
// get content via http client and authenticate content using hash
content, err := http.GetAuthContent(uri, hash)
content, err = http.GetAuthContent(uri, hash)
if err != nil {
return
}
// get abi, userdoc
var obj2 map[string]json.RawMessage
err = json.Unmarshal(content, &obj2)
if err != nil {
return
}
abi := []byte(obj2["abi"])
userdoc := []byte(obj2["userdoc"])
self, err = NewWithDocs(abi, userdoc, tx)
return
}
func NewWithDocs(abiDocJson, userDocJson []byte, tx string) (self *NatSpec, err error) {
func NewWithDocs(infoDoc []byte, tx string, data string) (self *NatSpec, err error) {
var obj map[string]json.RawMessage
err = json.Unmarshal([]byte(tx), &obj)
var contract contractInfo
err = json.Unmarshal(infoDoc, &contract)
if err != nil {
return
}
var tmp []map[string]string
err = json.Unmarshal(obj["params"], &tmp)
if err != nil {
return
}
data := tmp[0]["data"]
self = &NatSpec{
jsvm: otto.New(),
abiDocJson: abiDocJson,
userDocJson: userDocJson,
tx: tx,
data: data,
jsvm: otto.New(),
abiDocJson: []byte(contract.AbiDefinition),
userDoc: contract.UserDoc,
tx: tx,
data: data,
}
// load and require natspec js (but it is meant to be protected environment)
@@ -137,13 +138,6 @@ func NewWithDocs(abiDocJson, userDocJson []byte, tx string) (self *NatSpec, err
return
}
_, err = self.jsvm.Run("var natspec = require('natspec');")
if err != nil {
return
}
err = json.Unmarshal(userDocJson, &self.userDoc)
// err = parseAbiJson(abiDocJson, &self.abiDoc)
return
}

View File

@@ -1,8 +1,8 @@
package natspec
import (
"fmt"
"io/ioutil"
"math/big"
"os"
"testing"
@@ -14,39 +14,26 @@ import (
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/rpc"
xe "github.com/ethereum/go-ethereum/xeth"
)
type testFrontend struct {
t *testing.T
ethereum *eth.Ethereum
xeth *xe.XEth
api *rpc.EthereumApi
coinbase string
stateDb *state.StateDB
txc uint64
lastConfirm string
makeNatSpec bool
}
const (
testAccount = "e273f01c99144c438695e10f24926dc1f9fbf62d"
testBalance = "1000000000000"
testBalance = "10000000000000000000"
testFileName = "long_file_name_for_testing_registration_of_URLs_longer_than_32_bytes.content"
testNotice = "Register key `utils.toHex(_key)` <- content `utils.toHex(_content)`"
testExpNotice = "Register key 0xadd1a7d961cff0242089674ec2ef6fca671ab15e1fe80e38859fc815b98d88ab <- content 0xb3a2dea218de5d8bbe6c4645aadbf67b5ab00ecb1a9ec95dbdad6a0eed3e41a7"
testExpNotice2 = `About to submit transaction (NatSpec notice error: abi key does not match any method): {"params":[{"to":"%s","data": "0x31e12c20"}]}`
testExpNotice3 = `About to submit transaction (no NatSpec info found for contract: content hash not found for '0x1392c62d05b2d149e22a339c531157ae06b44d39a674cce500064b12b9aeb019'): {"params":[{"to":"%s","data": "0x300a3bbfb3a2dea218de5d8bbe6c4645aadbf67b5ab00ecb1a9ec95dbdad6a0eed3e41a7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066696c653a2f2f2f746573742e636f6e74656e74"}]}`
)
const testFileName = "long_file_name_for_testing_registration_of_URLs_longer_than_32_bytes.content"
const testNotice = "Register key `utils.toHex(_key)` <- content `utils.toHex(_content)`"
const testExpNotice = "Register key 0xadd1a7d961cff0242089674ec2ef6fca671ab15e1fe80e38859fc815b98d88ab <- content 0xc00d5bcc872e17813df6ec5c646bb281a6e2d3b454c2c400c78192adf3344af9"
const testExpNotice2 = `About to submit transaction (NatSpec notice error "abi key does not match any method"): {"id":6,"jsonrpc":"2.0","method":"eth_transact","params":[{"from":"0xe273f01c99144c438695e10f24926dc1f9fbf62d","to":"0xb737b91f8e95cf756766fc7c62c9a8ff58470381","value":"100000000000","gas":"100000","gasPrice":"100000","data":"0x31e12c20"}]}`
const testExpNotice3 = `About to submit transaction (no NatSpec info found for contract): {"id":6,"jsonrpc":"2.0","method":"eth_transact","params":[{"from":"0xe273f01c99144c438695e10f24926dc1f9fbf62d","to":"0x8b839ad85686967a4f418eccc81962eaee314ac3","value":"100000000000","gas":"100000","gasPrice":"100000","data":"0x300a3bbfc00d5bcc872e17813df6ec5c646bb281a6e2d3b454c2c400c78192adf3344af900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000"}]}`
const testUserDoc = `
const (
testUserDoc = `
{
"source": "...",
"language": "Solidity",
"languageVersion": 1,
"methods": {
"register(uint256,uint256)": {
"notice": "` + testNotice + `"
@@ -60,8 +47,7 @@ const testUserDoc = `
]
}
`
const testABI = `
testAbiDefinition = `
[{
"name": "register",
"constant": false,
@@ -77,70 +63,81 @@ const testABI = `
}]
`
const testDocs = `
testContractInfo = `
{
"userdoc": ` + testUserDoc + `,
"abi": ` + testABI + `
"userDoc": ` + testUserDoc + `,
"abiDefinition": ` + testAbiDefinition + `
}
`
)
func (f *testFrontend) UnlockAccount(acc []byte) bool {
f.t.Logf("Unlocking account %v\n", common.Bytes2Hex(acc))
f.ethereum.AccountManager().Unlock(acc, "password")
type testFrontend struct {
t *testing.T
// resolver *resolver.Resolver
ethereum *eth.Ethereum
xeth *xe.XEth
coinbase common.Address
stateDb *state.StateDB
txc uint64
lastConfirm string
wantNatSpec bool
}
func (self *testFrontend) UnlockAccount(acc []byte) bool {
self.ethereum.AccountManager().Unlock(acc, "password")
return true
}
func (f *testFrontend) ConfirmTransaction(tx string) bool {
//f.t.Logf("ConfirmTransaction called tx = %v", tx)
if f.makeNatSpec {
func (self *testFrontend) ConfirmTransaction(tx string) bool {
if self.wantNatSpec {
ds, err := docserver.New("/tmp/")
if err != nil {
f.t.Errorf("Error creating DocServer: %v", err)
self.t.Errorf("Error creating DocServer: %v", err)
}
f.lastConfirm = GetNotice(f.xeth, tx, ds)
self.lastConfirm = GetNotice(self.xeth, tx, ds)
}
return true
}
var port = 30300
func testEth(t *testing.T) (ethereum *eth.Ethereum, err error) {
os.RemoveAll("/tmp/eth-natspec/")
err = os.MkdirAll("/tmp/eth-natspec/keys/e273f01c99144c438695e10f24926dc1f9fbf62d/", os.ModePerm)
if err != nil {
t.Errorf("%v", err)
return
}
err = os.MkdirAll("/tmp/eth-natspec/data", os.ModePerm)
if err != nil {
t.Errorf("%v", err)
return
}
ks := crypto.NewKeyStorePlain("/tmp/eth-natspec/keys")
ioutil.WriteFile("/tmp/eth-natspec/keys/e273f01c99144c438695e10f24926dc1f9fbf62d/e273f01c99144c438695e10f24926dc1f9fbf62d",
[]byte(`{"Id":"RhRXD+fNRKS4jx+7ZfEsNA==","Address":"4nPwHJkUTEOGleEPJJJtwfn79i0=","PrivateKey":"h4ACVpe74uIvi5Cg/2tX/Yrm2xdr3J7QoMbMtNX2CNc="}`), os.ModePerm)
port++
os.RemoveAll("/tmp/eth-natspec/")
err = os.MkdirAll("/tmp/eth-natspec/keys", os.ModePerm)
if err != nil {
panic(err)
}
// create a testAddress
ks := crypto.NewKeyStorePassphrase("/tmp/eth-natspec/keys")
am := accounts.NewManager(ks)
testAccount, err := am.NewAccount("password")
if err != nil {
panic(err)
}
testAddress := common.Bytes2Hex(testAccount.Address)
// set up mock genesis with balance on the testAddress
core.GenesisData = []byte(`{
"` + testAddress + `": {"balance": "` + testBalance + `"}
}`)
// only use minimalistic stack with no networking
ethereum, err = eth.New(&eth.Config{
DataDir: "/tmp/eth-natspec",
AccountManager: accounts.NewManager(ks),
Name: "test",
AccountManager: am,
MaxPeers: 0,
})
if err != nil {
t.Errorf("%v", err)
return
panic(err)
}
return
}
func testInit(t *testing.T) (self *testFrontend) {
core.GenesisData = []byte(`{
"` + testAccount + `": {"balance": "` + testBalance + `"}
}`)
// initialise and start minimal ethereum stack
ethereum, err := testEth(t)
if err != nil {
t.Errorf("error creating ethereum: %v", err)
@@ -152,190 +149,95 @@ func testInit(t *testing.T) (self *testFrontend) {
return
}
// mock frontend
self = &testFrontend{t: t, ethereum: ethereum}
self.xeth = xe.New(ethereum, self)
self.api = rpc.NewEthereumApi(self.xeth)
addr := self.xeth.Coinbase()
addr, _ := ethereum.Etherbase()
self.coinbase = addr
if addr != "0x"+testAccount {
t.Errorf("CoinBase %v does not match TestAccount 0x%v", addr, testAccount)
}
t.Logf("CoinBase is %v", addr)
balance := self.xeth.BalanceAt(testAccount)
/*if balance != core.TestBalance {
t.Errorf("Balance %v does not match TestBalance %v", balance, core.TestBalance)
}*/
t.Logf("Balance is %v", balance)
self.stateDb = self.ethereum.ChainManager().State().Copy()
// initialise the registry contracts
// self.resolver.CreateContracts(addr)
resolver.New(self.xeth).CreateContracts(addr)
self.applyTxs()
// t.Logf("HashReg contract registered at %v", resolver.HashRegContractAddress)
// t.Logf("URLHint contract registered at %v", resolver.UrlHintContractAddress)
return
}
func (self *testFrontend) insertTx(addr, contract, fnsig string, args []string) {
//cb := common.HexToAddress(self.coinbase)
//coinbase := self.ethereum.ChainManager().State().GetStateObject(cb)
hash := common.Bytes2Hex(crypto.Sha3([]byte(fnsig)))
data := "0x" + hash[0:8]
for _, arg := range args {
data = data + common.Bytes2Hex(common.Hex2BytesFixed(arg, 32))
}
self.t.Logf("Tx data: %v", data)
jsontx := `
[{
"from": "` + addr + `",
"to": "` + contract + `",
"value": "100000000000",
"gas": "100000",
"gasPrice": "100000",
"data": "` + data + `"
}]
`
req := &rpc.RpcRequest{
Jsonrpc: "2.0",
Method: "eth_transact",
Params: []byte(jsontx),
Id: 6,
}
var reply interface{}
err0 := self.api.GetRequestReply(req, &reply)
if err0 != nil {
self.t.Errorf("GetRequestReply error: %v", err0)
}
//self.xeth.Transact(addr, contract, "100000000000", "100000", "100000", data)
}
// this is needed for transaction to be applied to the state in testing
// the heavy lifing is done in XEth.ApplyTestTxs
// this is fragile,
// and does process leaking since xeth loops cannot quit safely
// should be replaced by proper mining with testDAG for easy full integration tests
func (self *testFrontend) applyTxs() {
cb := common.HexToAddress(self.coinbase)
block := self.ethereum.ChainManager().NewBlock(cb)
coinbase := self.stateDb.GetStateObject(cb)
coinbase.SetGasPool(big.NewInt(10000000))
txs := self.ethereum.TxPool().GetQueuedTransactions()
for i := 0; i < len(txs); i++ {
for _, tx := range txs {
//self.t.Logf("%v %v %v", i, tx.Nonce(), self.txc)
if tx.Nonce() == self.txc {
_, gas, err := core.ApplyMessage(core.NewEnv(self.stateDb, self.ethereum.ChainManager(), tx, block), tx, coinbase)
//self.ethereum.TxPool().RemoveSet([]*types.Transaction{tx})
self.t.Logf("ApplyMessage: gas %v err %v", gas, err)
self.txc++
}
}
}
//self.ethereum.TxPool().RemoveSet(txs)
self.xeth = self.xeth.WithState(self.stateDb)
}
func (self *testFrontend) registerURL(hash common.Hash, url string) {
hashHex := common.Bytes2Hex(hash[:])
urlBytes := []byte(url)
var bb bool = true
var cnt byte
for bb {
bb = len(urlBytes) > 0
urlb := urlBytes
if len(urlb) > 32 {
urlb = urlb[:32]
}
urlHex := common.Bytes2Hex(urlb)
self.insertTx(self.coinbase, resolver.URLHintContractAddress, "register(uint256,uint8,uint256)", []string{hashHex, common.Bytes2Hex([]byte{cnt}), urlHex})
if len(urlBytes) > 32 {
urlBytes = urlBytes[32:]
} else {
urlBytes = nil
}
cnt++
}
}
func (self *testFrontend) setOwner() {
self.insertTx(self.coinbase, resolver.HashRegContractAddress, "setowner()", []string{})
/*owner := self.xeth.StorageAt("0x"+resolver.HashRegContractAddress, "0x0000000000000000000000000000000000000000000000000000000000000000")
self.t.Logf("owner = %v", owner)
if owner != self.coinbase {
self.t.Errorf("setowner() unsuccessful, owner != coinbase")
}*/
}
func (self *testFrontend) registerNatSpec(codehash, dochash common.Hash) {
codeHex := common.Bytes2Hex(codehash[:])
docHex := common.Bytes2Hex(dochash[:])
self.insertTx(self.coinbase, resolver.HashRegContractAddress, "register(uint256,uint256)", []string{codeHex, docHex})
}
func (self *testFrontend) testResolver() *resolver.Resolver {
return resolver.New(self.xeth, resolver.URLHintContractAddress, resolver.HashRegContractAddress)
self.txc, self.xeth = self.xeth.ApplyTestTxs(self.stateDb, self.coinbase, self.txc)
return
}
// end to end test
func TestNatspecE2E(t *testing.T) {
t.Skip()
// t.Skip()
tf := testInit(t)
defer tf.ethereum.Stop()
resolver.CreateContracts(tf.xeth, testAccount)
t.Logf("URLHint contract registered at %v", resolver.URLHintContractAddress)
t.Logf("HashReg contract registered at %v", resolver.HashRegContractAddress)
tf.applyTxs()
// create a contractInfo file (mock cloud-deployed contract metadocs)
// incidentally this is the info for the registry contract itself
ioutil.WriteFile("/tmp/"+testFileName, []byte(testContractInfo), os.ModePerm)
dochash := common.BytesToHash(crypto.Sha3([]byte(testContractInfo)))
ioutil.WriteFile("/tmp/"+testFileName, []byte(testDocs), os.ModePerm)
dochash := common.BytesToHash(crypto.Sha3([]byte(testDocs)))
// take the codehash for the contract we wanna test
// codehex := tf.xeth.CodeAt(resolver.HashRegContractAddress)
codeb := tf.xeth.CodeAtBytes(resolver.HashRegContractAddress)
codehash := common.BytesToHash(crypto.Sha3(codeb))
codehex := tf.xeth.CodeAt(resolver.HashRegContractAddress)
codehash := common.BytesToHash(crypto.Sha3(common.Hex2Bytes(codehex[2:])))
tf.setOwner()
tf.registerNatSpec(codehash, dochash)
tf.registerURL(dochash, "file:///"+testFileName)
tf.applyTxs()
chash, err := tf.testResolver().KeyToContentHash(codehash)
// use resolver to register codehash->dochash->url
registry := resolver.New(tf.xeth)
_, err := registry.Register(tf.coinbase, codehash, dochash, "file:///"+testFileName)
if err != nil {
t.Errorf("Can't find content hash")
t.Errorf("error registering: %v", err)
}
t.Logf("chash = %x err = %v", chash, err)
url, err2 := tf.testResolver().ContentHashToUrl(dochash)
if err2 != nil {
t.Errorf("Can't find URL hint")
}
t.Logf("url = %v err = %v", url, err2)
// apply txs to the state
tf.applyTxs()
// NatSpec info for register method of HashReg contract installed
// now using the same transactions to check confirm messages
tf.makeNatSpec = true
tf.registerNatSpec(codehash, dochash)
t.Logf("Confirm message: %v\n", tf.lastConfirm)
tf.wantNatSpec = true // this is set so now the backend uses natspec confirmation
_, err = registry.RegisterContentHash(tf.coinbase, codehash, dochash)
if err != nil {
t.Errorf("error calling contract registry: %v", err)
}
if tf.lastConfirm != testExpNotice {
t.Errorf("Wrong confirm message, expected '%v', got '%v'", testExpNotice, tf.lastConfirm)
t.Errorf("Wrong confirm message. expected '%v', got '%v'", testExpNotice, tf.lastConfirm)
}
tf.setOwner()
t.Logf("Confirm message for unknown method: %v\n", tf.lastConfirm)
if tf.lastConfirm != testExpNotice2 {
t.Errorf("Wrong confirm message, expected '%v', got '%v'", testExpNotice2, tf.lastConfirm)
// test unknown method
exp := fmt.Sprintf(testExpNotice2, resolver.HashRegContractAddress)
_, err = registry.SetOwner(tf.coinbase)
if err != nil {
t.Errorf("error setting owner: %v", err)
}
tf.registerURL(dochash, "file:///test.content")
t.Logf("Confirm message for unknown contract: %v\n", tf.lastConfirm)
if tf.lastConfirm != testExpNotice3 {
t.Errorf("Wrong confirm message, expected '%v', got '%v'", testExpNotice3, tf.lastConfirm)
if tf.lastConfirm != exp {
t.Errorf("Wrong confirm message, expected '%v', got '%v'", exp, tf.lastConfirm)
}
// test unknown contract
exp = fmt.Sprintf(testExpNotice3, resolver.UrlHintContractAddress)
_, err = registry.RegisterUrl(tf.coinbase, dochash, "file:///test.content")
if err != nil {
t.Errorf("error registering: %v", err)
}
if tf.lastConfirm != exp {
t.Errorf("Wrong confirm message, expected '%v', got '%v'", exp, tf.lastConfirm)
}
}

View File

@@ -4,70 +4,65 @@ import (
"testing"
)
func makeUserdoc(desc string) []byte {
func makeInfoDoc(desc string) []byte {
return []byte(`
{
"source": "...",
"source": "contract test { }",
"language": "Solidity",
"languageVersion": 1,
"methods": {
"multiply(uint256)": {
"notice": "` + desc + `"
"compilerVersion": "1",
"userDoc": {
"methods": {
"multiply(uint256)": {
"notice": "` + desc + `"
},
"balance(address)": {
"notice": "` + "`(balanceInmGAV / 1000).fixed(0,3)`" + ` GAV is the total funds available to ` + "`who.address()`." + `"
}
},
"balance(address)": {
"notice": "` + "`(balanceInmGAV / 1000).fixed(0,3)`" + ` GAV is the total funds available to ` + "`who.address()`." + `"
}
"invariants": [
{ "notice": "The sum total amount of GAV in the system is 1 million." }
],
"construction": [
{ "notice": "Endows ` + "`message.caller.address()`" + ` with 1m GAV." }
]
},
"invariants": [
{ "notice": "The sum total amount of GAV in the system is 1 million." }
],
"construction": [
{ "notice": "Endows ` + "`message.caller.address()`" + ` with 1m GAV." }
]
}
`)
"abiDefinition": [{
"name": "multiply",
"constant": false,
"type": "function",
"inputs": [{
"name": "a",
"type": "uint256"
}],
"outputs": [{
"name": "d",
"type": "uint256"
}]
}]
}`)
}
var data = "0xc6888fa1000000000000000000000000000000000000000000000000000000000000007a"
var tx = `
{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
"to": "0x8521742d3f456bd237e312d6e30724960f72517a",
"data": "0xc6888fa1000000000000000000000000000000000000000000000000000000000000007a"
}],
"id": 6
}
`
var abi = []byte(`
[{
"name": "multiply",
"constant": false,
"type": "function",
"inputs": [{
"name": "a",
"type": "uint256"
}],
"outputs": [{
"name": "d",
"type": "uint256"
}]
}]
`)
func TestNotice(t *testing.T) {
desc := "Will multiply `a` by 7 and return `a * 7`."
expected := "Will multiply 122 by 7 and return 854."
userdoc := makeUserdoc(desc)
ns, err := NewWithDocs(abi, userdoc, tx)
infodoc := makeInfoDoc(desc)
ns, err := NewWithDocs(infodoc, tx, data)
if err != nil {
t.Errorf("New: error: %v", err)
return
}
notice, err := ns.Notice()
@@ -78,8 +73,6 @@ func TestNotice(t *testing.T) {
if notice != expected {
t.Errorf("incorrect notice. expected %v, got %v", expected, notice)
} else {
t.Logf("returned notice \"%v\"", notice)
}
}
@@ -87,10 +80,10 @@ func TestNotice(t *testing.T) {
func TestMissingMethod(t *testing.T) {
desc := "Will multiply `a` by 7 and return `a * 7`."
userdoc := makeUserdoc(desc)
expected := "natspec.js error evaluating expression: Natspec evaluation failed, method does not exist"
ns, err := NewWithDocs(abi, userdoc, tx)
infodoc := makeInfoDoc(desc)
ns, err := NewWithDocs(infodoc, tx, data)
if err != nil {
t.Errorf("New: error: %v", err)
}
@@ -113,9 +106,8 @@ func TestInvalidDesc(t *testing.T) {
desc := "Will multiply 122 by \"7\" and return 854."
expected := "invalid character '7' after object key:value pair"
userdoc := makeUserdoc(desc)
_, err := NewWithDocs(abi, userdoc, tx)
infodoc := makeInfoDoc(desc)
_, err := NewWithDocs(infodoc, tx, data)
if err == nil {
t.Errorf("expected error, got nothing", err)
} else {
@@ -131,9 +123,8 @@ func TestWrongInputParams(t *testing.T) {
desc := "Will multiply `e` by 7 and return `a * 7`."
expected := "natspec.js error evaluating expression: Natspec evaluation failed, wrong input params"
userdoc := makeUserdoc(desc)
ns, err := NewWithDocs(abi, userdoc, tx)
infodoc := makeInfoDoc(desc)
ns, err := NewWithDocs(infodoc, tx, data)
if err != nil {
t.Errorf("New: error: %v", err)
}

View File

@@ -6,7 +6,8 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
xe "github.com/ethereum/go-ethereum/xeth"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
)
/*
@@ -18,50 +19,152 @@ The resolver is meant to be called by the roundtripper transport implementation
of a url scheme
*/
// contract addresses will be hardcoded after they're created
var URLHintContractAddress string = "0000000000000000000000000000000000000000000000000000000000001234"
var HashRegContractAddress string = "0000000000000000000000000000000000000000000000000000000000005678"
// // contract addresses will be hardcoded after they're created
var UrlHintContractAddress, HashRegContractAddress string
func CreateContracts(xeth *xe.XEth, addr string) {
var err error
URLHintContractAddress, err = xeth.Transact(addr, "", "", "100000000000", "1000000", "100000", ContractCodeURLhint)
if err != nil {
panic(err)
}
HashRegContractAddress, err = xeth.Transact(addr, "", "", "100000000000", "1000000", "100000", ContractCodeHashReg)
if err != nil {
panic(err)
}
const (
txValue = "0"
txGas = "100000"
txGasPrice = "1000000000000"
)
func abi(s string) string {
return common.ToHex(crypto.Sha3([]byte(s))[:4])
}
type Resolver struct {
backend Backend
urlHintContractAddress string
hashRegContractAddress string
}
var (
registerContentHashAbi = abi("register(uint256,uint256)")
registerUrlAbi = abi("register(uint256,uint8,uint256)")
setOwnerAbi = abi("setowner()")
)
type Backend interface {
StorageAt(string, string) string
Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceStr, codeStr string) (string, error)
}
func New(eth Backend, uhca, nrca string) *Resolver {
return &Resolver{eth, uhca, nrca}
type Resolver struct {
backend Backend
}
func (self *Resolver) KeyToContentHash(khash common.Hash) (chash common.Hash, err error) {
// look up in hashReg
key := storageAddress(storageMapping(storageIdx2Addr(1), khash[:]))
hash := self.backend.StorageAt(self.hashRegContractAddress, key)
func New(eth Backend) *Resolver {
return &Resolver{eth}
}
if hash == "0x0" || len(hash) < 3 {
err = fmt.Errorf("GetHashReg: content hash not found")
// for testing and play temporarily
// ideally the HashReg and UrlHint contracts should be in the genesis block
// if we got build-in support for natspec/contract info
// there should be only one of these officially endorsed
// addresses as constants
// TODO: could get around this with namereg, check
func (self *Resolver) CreateContracts(addr common.Address) (err error) {
HashRegContractAddress, err = self.backend.Transact(addr.Hex(), "", "", txValue, txGas, txGasPrice, ContractCodeHashReg)
if err != nil {
return
}
UrlHintContractAddress, err = self.backend.Transact(addr.Hex(), "", "", txValue, txGas, txGasPrice, ContractCodeURLhint)
glog.V(logger.Detail).Infof("HashReg @ %v\nUrlHint @ %v\n", HashRegContractAddress, UrlHintContractAddress)
return
}
// called as first step in the registration process on HashReg
func (self *Resolver) SetOwner(address common.Address) (txh string, err error) {
return self.backend.Transact(
address.Hex(),
HashRegContractAddress,
"", txValue, txGas, txGasPrice,
setOwnerAbi,
)
}
// registers some content hash to a key/code hash
// e.g., the contract Info combined Json Doc's ContentHash
// to CodeHash of a contract or hash of a domain
// kept
func (self *Resolver) RegisterContentHash(address common.Address, codehash, dochash common.Hash) (txh string, err error) {
_, err = self.SetOwner(address)
if err != nil {
return
}
codehex := common.Bytes2Hex(codehash[:])
dochex := common.Bytes2Hex(dochash[:])
data := registerContentHashAbi + codehex + dochex
return self.backend.Transact(
address.Hex(),
HashRegContractAddress,
"", txValue, txGas, txGasPrice,
data,
)
}
// registers a url to a content hash so that the content can be fetched
// address is used as sender for the transaction and will be the owner of a new
// registry entry on first time use
// FIXME: silently doing nothing if sender is not the owner
// note that with content addressed storage, this step is no longer necessary
// it could be purely
func (self *Resolver) RegisterUrl(address common.Address, hash common.Hash, url string) (txh string, err error) {
hashHex := common.Bytes2Hex(hash[:])
var urlHex string
urlb := []byte(url)
var cnt byte
n := len(urlb)
for n > 0 {
if n > 32 {
n = 32
}
urlHex = common.Bytes2Hex(urlb[:n])
urlb = urlb[n:]
n = len(urlb)
bcnt := make([]byte, 32)
bcnt[31] = cnt
data := registerUrlAbi +
hashHex +
common.Bytes2Hex(bcnt) +
common.Bytes2Hex(common.Hex2BytesFixed(urlHex, 32))
txh, err = self.backend.Transact(
address.Hex(),
UrlHintContractAddress,
"", txValue, txGas, txGasPrice,
data,
)
if err != nil {
return
}
cnt++
}
return
}
func (self *Resolver) Register(address common.Address, codehash, dochash common.Hash, url string) (txh string, err error) {
_, err = self.RegisterContentHash(address, codehash, dochash)
if err != nil {
return
}
return self.RegisterUrl(address, dochash, url)
}
// resolution is costless non-transactional
// implemented as direct retrieval from db
func (self *Resolver) KeyToContentHash(khash common.Hash) (chash common.Hash, err error) {
// look up in hashReg
at := common.Bytes2Hex(common.FromHex(HashRegContractAddress))
key := storageAddress(storageMapping(storageIdx2Addr(1), khash[:]))
hash := self.backend.StorageAt(at, key)
if hash == "0x0" || len(hash) < 3 {
err = fmt.Errorf("content hash not found for '%v'", khash.Hex())
return
}
copy(chash[:], common.Hex2BytesFixed(hash[2:], 32))
return
}
// retrieves the url-hint for the content hash -
// if we use content addressed storage, this step is no longer necessary
func (self *Resolver) ContentHashToUrl(chash common.Hash) (uri string, err error) {
// look up in URL reg
var str string = " "
@@ -69,7 +172,7 @@ func (self *Resolver) ContentHashToUrl(chash common.Hash) (uri string, err error
for len(str) > 0 {
mapaddr := storageMapping(storageIdx2Addr(1), chash[:])
key := storageAddress(storageFixedArray(mapaddr, storageIdx2Addr(idx)))
hex := self.backend.StorageAt(self.urlHintContractAddress, key)
hex := self.backend.StorageAt(UrlHintContractAddress, key)
str = string(common.Hex2Bytes(hex[2:]))
l := len(str)
for (l > 0) && (str[l-1] == 0) {
@@ -81,7 +184,7 @@ func (self *Resolver) ContentHashToUrl(chash common.Hash) (uri string, err error
}
if len(uri) == 0 {
err = fmt.Errorf("GetURLhint: URL hint not found")
err = fmt.Errorf("GetURLhint: URL hint not found for '%v'", chash.Hex())
}
return
}
@@ -106,7 +209,8 @@ func storageMapping(addr, key []byte) []byte {
data := make([]byte, 64)
copy(data[0:32], key[0:32])
copy(data[32:64], addr[0:32])
return crypto.Sha3(data)
sha := crypto.Sha3(data)
return sha
}
func storageFixedArray(addr, idx []byte) []byte {

View File

@@ -20,6 +20,8 @@ var (
)
func NewTestBackend() *testBackend {
HashRegContractAddress = common.BigToAddress(common.Big0).Hex()[2:]
UrlHintContractAddress = common.BigToAddress(common.Big1).Hex()[2:]
self := &testBackend{}
self.contracts = make(map[string](map[string]string))
@@ -27,14 +29,13 @@ func NewTestBackend() *testBackend {
key := storageAddress(storageMapping(storageIdx2Addr(1), codehash[:]))
self.contracts[HashRegContractAddress][key] = hash.Hex()
self.contracts[URLHintContractAddress] = make(map[string]string)
self.contracts[UrlHintContractAddress] = make(map[string]string)
mapaddr := storageMapping(storageIdx2Addr(1), hash[:])
key = storageAddress(storageFixedArray(mapaddr, storageIdx2Addr(0)))
self.contracts[URLHintContractAddress][key] = common.ToHex([]byte(url))
self.contracts[UrlHintContractAddress][key] = common.ToHex([]byte(url))
key = storageAddress(storageFixedArray(mapaddr, storageIdx2Addr(1)))
self.contracts[URLHintContractAddress][key] = "0x00"
self.contracts[UrlHintContractAddress][key] = "0x00"
return self
}
@@ -47,42 +48,46 @@ func (self *testBackend) StorageAt(ca, sa string) (res string) {
return
}
func (self *testBackend) Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceStr, codeStr string) (string, error) {
return "", nil
}
func TestKeyToContentHash(t *testing.T) {
b := NewTestBackend()
res := New(b, URLHintContractAddress, HashRegContractAddress)
res := New(b)
got, err := res.KeyToContentHash(codehash)
if err != nil {
t.Errorf("expected no error, got %v", err)
} else {
if got != hash {
t.Errorf("incorrect result, expected %x, got %x: ", hash.Hex(), got.Hex())
t.Errorf("incorrect result, expected '%v', got '%v'", hash.Hex(), got.Hex())
}
}
}
func TestContentHashToUrl(t *testing.T) {
b := NewTestBackend()
res := New(b, URLHintContractAddress, HashRegContractAddress)
res := New(b)
got, err := res.ContentHashToUrl(hash)
if err != nil {
t.Errorf("expected no error, got %v", err)
} else {
if string(got) != url {
t.Errorf("incorrect result, expected %v, got %s: ", url, string(got))
if got != url {
t.Errorf("incorrect result, expected '%v', got '%s'", url, got)
}
}
}
func TestKeyToUrl(t *testing.T) {
b := NewTestBackend()
res := New(b, URLHintContractAddress, HashRegContractAddress)
res := New(b)
got, _, err := res.KeyToUrl(codehash)
if err != nil {
t.Errorf("expected no error, got %v", err)
} else {
if string(got) != url {
t.Errorf("incorrect result, expected %v, got %s: ", url, string(got))
if got != url {
t.Errorf("incorrect result, expected \n'%s', got \n'%s'", url, got)
}
}
}

View File

@@ -66,7 +66,6 @@ func CalcGasLimit(parent *types.Block) *big.Int {
result := new(big.Int).Add(previous, curInt)
result.Div(result, big.NewInt(1024))
return common.BigMax(params.GenesisGasLimit, result)
}
@@ -161,7 +160,8 @@ func (self *ChainManager) Td() *big.Int {
}
func (self *ChainManager) GasLimit() *big.Int {
return self.currentGasLimit
// return self.currentGasLimit
return self.currentBlock.GasLimit()
}
func (self *ChainManager) LastBlockHash() common.Hash {
@@ -280,7 +280,6 @@ func (bc *ChainManager) NewBlock(coinbase common.Address) *types.Block {
header.Difficulty = CalcDifficulty(block.Header(), parent.Header())
header.Number = new(big.Int).Add(parent.Header().Number, common.Big1)
header.GasLimit = CalcGasLimit(parent)
}
return block

View File

@@ -22,9 +22,9 @@ type Filter struct {
max int
topics [][]common.Hash
BlockCallback func(*types.Block, state.Logs)
PendingCallback func(*types.Transaction)
LogsCallback func(state.Logs)
BlockCallback func(*types.Block, state.Logs)
TransactionCallback func(*types.Transaction)
LogsCallback func(state.Logs)
}
// Create a new filter which uses a bloom filter on blocks to figure out whether a particular block

View File

@@ -138,9 +138,12 @@ func (c *StateObject) setAddr(addr []byte, value interface{}) {
}
func (self *StateObject) GetStorage(key *big.Int) *common.Value {
fmt.Printf("%v: get %v %v", self.address.Hex(), key)
return self.GetState(common.BytesToHash(key.Bytes()))
}
func (self *StateObject) SetStorage(key *big.Int, value *common.Value) {
fmt.Printf("%v: set %v -> %v", self.address.Hex(), key, value)
self.SetState(common.BytesToHash(key.Bytes()), value)
}

View File

@@ -204,6 +204,27 @@ func (self *TxPool) AddTransactions(txs []*types.Transaction) {
}
}
// GetTransaction allows you to check the pending and queued transaction in the
// transaction pool.
// It has two stategies, first check the pool (map) then check the queue
func (tp *TxPool) GetTransaction(hash common.Hash) *types.Transaction {
// check the txs first
if tx, ok := tp.txs[hash]; ok {
return tx
}
// check queue
for _, txs := range tp.queue {
for _, tx := range txs {
if tx.Hash() == hash {
return tx
}
}
}
return nil
}
func (self *TxPool) GetTransactions() (txs types.Transactions) {
self.mu.RLock()
defer self.mu.RUnlock()

View File

@@ -60,8 +60,9 @@ type Config struct {
VmDebug bool
NatSpec bool
MaxPeers int
Port string
MaxPeers int
MaxPendingPeers int
Port string
// Space-separated list of discovery node URLs
BootNodes string
@@ -280,16 +281,17 @@ func New(config *Config) (*Ethereum, error) {
protocols = append(protocols, eth.whisper.Protocol())
}
eth.net = &p2p.Server{
PrivateKey: netprv,
Name: config.Name,
MaxPeers: config.MaxPeers,
Protocols: protocols,
NAT: config.NAT,
NoDial: !config.Dial,
BootstrapNodes: config.parseBootNodes(),
StaticNodes: config.parseNodes(staticNodes),
TrustedNodes: config.parseNodes(trustedNodes),
NodeDatabase: nodeDb,
PrivateKey: netprv,
Name: config.Name,
MaxPeers: config.MaxPeers,
MaxPendingPeers: config.MaxPendingPeers,
Protocols: protocols,
NAT: config.NAT,
NoDial: !config.Dial,
BootstrapNodes: config.parseBootNodes(),
StaticNodes: config.parseNodes(staticNodes),
TrustedNodes: config.parseNodes(trustedNodes),
NodeDatabase: nodeDb,
}
if len(config.Port) > 0 {
eth.net.ListenAddr = ":" + config.Port

View File

@@ -11,11 +11,10 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"gopkg.in/fatih/set.v0"
)
const (
maxBlockFetch = 256 // Amount of max blocks to be fetched per chunk
maxBlockFetch = 128 // Amount of max blocks to be fetched per chunk
peerCountTimeout = 12 * time.Second // Amount of time it takes for the peer handler to ignore minDesiredPeerCount
hashTtl = 20 * time.Second // The amount of time it takes for a hash request to time out
)
@@ -25,12 +24,12 @@ var (
blockTtl = 20 * time.Second // The amount of time it takes for a block request to time out
errLowTd = errors.New("peer's TD is too low")
errBusy = errors.New("busy")
ErrBusy = errors.New("busy")
errUnknownPeer = errors.New("peer's unknown or unhealthy")
ErrBadPeer = errors.New("action from bad peer ignored")
errBadPeer = errors.New("action from bad peer ignored")
errNoPeers = errors.New("no peers to keep download active")
errPendingQueue = errors.New("pending items in queue")
errTimeout = errors.New("timeout")
ErrTimeout = errors.New("timeout")
errEmptyHashSet = errors.New("empty hash set by peer")
errPeersUnavailable = errors.New("no peers available or all peers tried for block download process")
errAlreadyInPool = errors.New("hash already in pool")
@@ -69,8 +68,7 @@ type Downloader struct {
getBlock getBlockFn
// Status
fetchingHashes int32
downloadingBlocks int32
synchronising int32
// Channels
newPeerCh chan *peer
@@ -80,7 +78,7 @@ type Downloader struct {
func New(hasBlock hashCheckFn, getBlock getBlockFn) *Downloader {
downloader := &Downloader{
queue: newqueue(),
queue: newQueue(),
peers: make(peers),
hasBlock: hasBlock,
getBlock: getBlock,
@@ -93,7 +91,7 @@ func New(hasBlock hashCheckFn, getBlock getBlockFn) *Downloader {
}
func (d *Downloader) Stats() (current int, max int) {
return d.queue.blockHashes.Size(), d.queue.fetchPool.Size() + d.queue.hashPool.Size()
return d.queue.Size()
}
func (d *Downloader) RegisterPeer(id string, hash common.Hash, getHashes hashFetcherFn, getBlocks blockFetcherFn) error {
@@ -111,7 +109,7 @@ func (d *Downloader) RegisterPeer(id string, hash common.Hash, getHashes hashFet
return nil
}
// UnregisterPeer unregister's a peer. This will prevent any action from the specified peer.
// UnregisterPeer unregisters a peer. This will prevent any action from the specified peer.
func (d *Downloader) UnregisterPeer(id string) {
d.mu.Lock()
defer d.mu.Unlock()
@@ -121,104 +119,58 @@ func (d *Downloader) UnregisterPeer(id string) {
delete(d.peers, id)
}
// SynchroniseWithPeer will select the peer and use it for synchronising. If an empty string is given
// it will use the best peer possible and synchronise if it's TD is higher than our own. If any of the
// Synchronise will select the peer and use it for synchronising. If an empty string is given
// it will use the best peer possible and synchronize if it's TD is higher than our own. If any of the
// checks fail an error will be returned. This method is synchronous
func (d *Downloader) Synchronise(id string, hash common.Hash) error {
// Make sure it's doing neither. Once done we can restart the
// downloading process if the TD is higher. For now just get on
// with whatever is going on. This prevents unecessary switching.
if d.isBusy() {
return errBusy
// Make sure only one goroutine is ever allowed past this point at once
if !atomic.CompareAndSwapInt32(&d.synchronising, 0, 1) {
return ErrBusy
}
defer atomic.StoreInt32(&d.synchronising, 0)
// When a synchronisation attempt is made while the queue stil
// contains items we abort the sync attempt
if d.queue.size() > 0 {
// Abort if the queue still contains some leftover data
if _, cached := d.queue.Size(); cached > 0 && d.queue.GetHeadBlock() != nil {
return errPendingQueue
}
// Reset the queue to clean any internal leftover state
d.queue.Reset()
// Fetch the peer using the id or throw an error if the peer couldn't be found
// Retrieve the origin peer and initiate the downloading process
p := d.peers[id]
if p == nil {
return errUnknownPeer
}
// Get the hash from the peer and initiate the downloading progress.
err := d.getFromPeer(p, hash, false)
if err != nil {
return err
}
return nil
}
// Done lets the downloader know that whatever previous hashes were taken
// are processed. If the block count reaches zero and done is called
// we reset the queue for the next batch of incoming hashes and blocks.
func (d *Downloader) Done() {
d.queue.mu.Lock()
defer d.queue.mu.Unlock()
if len(d.queue.blocks) == 0 {
d.queue.resetNoTS()
}
return d.getFromPeer(p, hash, false)
}
// TakeBlocks takes blocks from the queue and yields them to the blockTaker handler
// it's possible it yields no blocks
func (d *Downloader) TakeBlocks() types.Blocks {
d.queue.mu.Lock()
defer d.queue.mu.Unlock()
var blocks types.Blocks
if len(d.queue.blocks) > 0 {
// Make sure the parent hash is known
if d.queue.blocks[0] != nil && !d.hasBlock(d.queue.blocks[0].ParentHash()) {
return nil
}
for _, block := range d.queue.blocks {
if block == nil {
break
}
blocks = append(blocks, block)
}
d.queue.blockOffset += len(blocks)
// delete the blocks from the slice and let them be garbage collected
// without this slice trick the blocks would stay in memory until nil
// would be assigned to d.queue.blocks
copy(d.queue.blocks, d.queue.blocks[len(blocks):])
for k, n := len(d.queue.blocks)-len(blocks), len(d.queue.blocks); k < n; k++ {
d.queue.blocks[k] = nil
}
d.queue.blocks = d.queue.blocks[:len(d.queue.blocks)-len(blocks)]
//d.queue.blocks = d.queue.blocks[len(blocks):]
if len(d.queue.blocks) == 0 {
d.queue.blocks = nil
}
// Check that there are blocks available and its parents are known
head := d.queue.GetHeadBlock()
if head == nil || !d.hasBlock(head.ParentHash()) {
return nil
}
return blocks
// Retrieve a full batch of blocks
return d.queue.TakeBlocks(head)
}
func (d *Downloader) Has(hash common.Hash) bool {
return d.queue.has(hash)
return d.queue.Has(hash)
}
func (d *Downloader) getFromPeer(p *peer, hash common.Hash, ignoreInitial bool) (err error) {
d.activePeer = p.id
defer func() {
// reset on error
if err != nil {
d.queue.reset()
d.queue.Reset()
}
}()
glog.V(logger.Detail).Infoln("Synchronising with the network using:", p.id)
glog.V(logger.Debug).Infoln("Synchronizing with the network using:", p.id)
// Start the fetcher. This will block the update entirely
// interupts need to be send to the appropriate channels
// respectively.
@@ -234,20 +186,13 @@ func (d *Downloader) getFromPeer(p *peer, hash common.Hash, ignoreInitial bool)
return err
}
glog.V(logger.Detail).Infoln("Sync completed")
glog.V(logger.Debug).Infoln("Synchronization completed")
return nil
}
// XXX Make synchronous
func (d *Downloader) startFetchingHashes(p *peer, h common.Hash, ignoreInitial bool) error {
atomic.StoreInt32(&d.fetchingHashes, 1)
defer atomic.StoreInt32(&d.fetchingHashes, 0)
if d.queue.has(h) {
return errAlreadyInPool
}
glog.V(logger.Debug).Infof("Downloading hashes (%x) from %s", h[:4], p.id)
start := time.Now()
@@ -256,7 +201,7 @@ func (d *Downloader) startFetchingHashes(p *peer, h common.Hash, ignoreInitial b
// In such circumstances we don't need to download the block so don't add it to the queue.
if !ignoreInitial {
// Add the hash to the queue first
d.queue.hashPool.Add(h)
d.queue.Insert([]common.Hash{h})
}
// Get the first batch of hashes
p.getHashes(h)
@@ -273,7 +218,7 @@ out:
for {
select {
case hashPack := <-d.hashCh:
// make sure the active peer is giving us the hashes
// Make sure the active peer is giving us the hashes
if hashPack.peerId != activePeer.id {
glog.V(logger.Debug).Infof("Received hashes from incorrect peer(%s)\n", hashPack.peerId)
break
@@ -281,43 +226,37 @@ out:
failureResponseTimer.Reset(hashTtl)
var (
hashes = hashPack.hashes
done bool // determines whether we're done fetching hashes (i.e. common hash found)
)
hashSet := set.New()
for _, hash = range hashes {
if d.hasBlock(hash) || d.queue.blockHashes.Has(hash) {
glog.V(logger.Debug).Infof("Found common hash %x\n", hash[:4])
// Make sure the peer actually gave something valid
if len(hashPack.hashes) == 0 {
glog.V(logger.Debug).Infof("Peer (%s) responded with empty hash set\n", activePeer.id)
d.queue.Reset()
return errEmptyHashSet
}
// Determine if we're done fetching hashes (queue up all pending), and continue if not done
done, index := false, 0
for index, hash = range hashPack.hashes {
if d.hasBlock(hash) || d.queue.GetBlock(hash) != nil {
glog.V(logger.Debug).Infof("Found common hash %x\n", hash[:4])
hashPack.hashes = hashPack.hashes[:index]
done = true
break
}
hashSet.Add(hash)
}
d.queue.put(hashSet)
d.queue.Insert(hashPack.hashes)
// Add hashes to the chunk set
if len(hashes) == 0 { // Make sure the peer actually gave you something valid
glog.V(logger.Debug).Infof("Peer (%s) responded with empty hash set\n", activePeer.id)
d.queue.reset()
return errEmptyHashSet
} else if !done { // Check if we're done fetching
// Get the next set of hashes
if !done {
activePeer.getHashes(hash)
} else { // we're done
// The offset of the queue is determined by the highest known block
var offset int
if block := d.getBlock(hash); block != nil {
offset = int(block.NumberU64() + 1)
}
// allocate proper size for the queueue
d.queue.alloc(offset, d.queue.hashPool.Size())
break out
continue
}
// We're done, allocate the download cache and proceed pulling the blocks
offset := 0
if block := d.getBlock(hash); block != nil {
offset = int(block.NumberU64() + 1)
}
d.queue.Alloc(offset)
break out
case <-failureResponseTimer.C:
glog.V(logger.Debug).Infof("Peer (%s) didn't respond in time for hash request\n", p.id)
@@ -326,7 +265,7 @@ out:
// already fetched hash list. This can't guarantee 100% correctness but does
// a fair job. This is always either correct or false incorrect.
for id, peer := range d.peers {
if d.queue.hashPool.Has(peer.recentHash) && !attemptedPeers[id] {
if d.queue.Has(peer.recentHash) && !attemptedPeers[id] {
p = peer
break
}
@@ -335,8 +274,8 @@ out:
// if all peers have been tried, abort the process entirely or if the hash is
// the zero hash.
if p == nil || (hash == common.Hash{}) {
d.queue.reset()
return errTimeout
d.queue.Reset()
return ErrTimeout
}
// set p to the active peer. this will invalidate any hashes that may be returned
@@ -346,15 +285,14 @@ out:
glog.V(logger.Debug).Infof("Hash fetching switched to new peer(%s)\n", p.id)
}
}
glog.V(logger.Detail).Infof("Downloaded hashes (%d) in %v\n", d.queue.hashPool.Size(), time.Since(start))
glog.V(logger.Debug).Infof("Downloaded hashes (%d) in %v\n", d.queue.Pending(), time.Since(start))
return nil
}
func (d *Downloader) startFetchingBlocks(p *peer) error {
glog.V(logger.Detail).Infoln("Downloading", d.queue.hashPool.Size(), "block(s)")
atomic.StoreInt32(&d.downloadingBlocks, 1)
defer atomic.StoreInt32(&d.downloadingBlocks, 0)
glog.V(logger.Debug).Infoln("Downloading", d.queue.Pending(), "block(s)")
// Defer the peer reset. This will empty the peer requested set
// and makes sure there are no lingering peers with an incorrect
// state
@@ -362,7 +300,7 @@ func (d *Downloader) startFetchingBlocks(p *peer) error {
start := time.Now()
// default ticker for re-fetching blocks everynow and then
// default ticker for re-fetching blocks every now and then
ticker := time.NewTicker(20 * time.Millisecond)
out:
for {
@@ -371,7 +309,7 @@ out:
// If the peer was previously banned and failed to deliver it's pack
// in a reasonable time frame, ignore it's message.
if d.peers[blockPack.peerId] != nil {
err := d.queue.deliver(blockPack.peerId, blockPack.blocks)
err := d.queue.Deliver(blockPack.peerId, blockPack.blocks)
if err != nil {
glog.V(logger.Debug).Infof("deliver failed for peer %s: %v\n", blockPack.peerId, err)
// FIXME d.UnregisterPeer(blockPack.peerId)
@@ -385,86 +323,70 @@ out:
d.peers.setState(blockPack.peerId, idleState)
}
case <-ticker.C:
// after removing bad peers make sure we actually have suffucient peer left to keep downlading
// Check for bad peers. Bad peers may indicate a peer not responding
// to a `getBlocks` message. A timeout of 5 seconds is set. Peers
// that badly or poorly behave are removed from the peer set (not banned).
// Bad peers are excluded from the available peer set and therefor won't be
// reused. XXX We could re-introduce peers after X time.
badPeers := d.queue.Expire(blockTtl)
for _, pid := range badPeers {
// XXX We could make use of a reputation system here ranking peers
// in their performance
// 1) Time for them to respond;
// 2) Measure their speed;
// 3) Amount and availability.
if peer := d.peers[pid]; peer != nil {
peer.demote()
peer.reset()
}
}
// After removing bad peers make sure we actually have sufficient peer left to keep downloading
if len(d.peers) == 0 {
d.queue.reset()
d.queue.Reset()
return errNoPeers
}
// If there are unrequested hashes left start fetching
// from the available peers.
if d.queue.hashPool.Size() > 0 {
if d.queue.Pending() > 0 {
// Throttle the download if block cache is full and waiting processing
if d.queue.Throttle() {
continue
}
availablePeers := d.peers.get(idleState)
for _, peer := range availablePeers {
// Get a possible chunk. If nil is returned no chunk
// could be returned due to no hashes available.
chunk := d.queue.get(peer, maxBlockFetch)
if chunk == nil {
request := d.queue.Reserve(peer, maxBlockFetch)
if request == nil {
continue
}
// XXX make fetch blocking.
// Fetch the chunk and check for error. If the peer was somehow
// already fetching a chunk due to a bug, it will be returned to
// the queue
if err := peer.fetch(chunk); err != nil {
if err := peer.fetch(request); err != nil {
// log for tracing
glog.V(logger.Debug).Infof("peer %s received double work (state = %v)\n", peer.id, peer.state)
d.queue.put(chunk.hashes)
d.queue.Cancel(request)
}
}
// make sure that we have peers available for fetching. If all peers have been tried
// and all failed throw an error
if len(d.queue.fetching) == 0 {
d.queue.reset()
if d.queue.InFlight() == 0 {
d.queue.Reset()
return fmt.Errorf("%v peers avaialable = %d. total peers = %d. hashes needed = %d", errPeersUnavailable, len(availablePeers), len(d.peers), d.queue.hashPool.Size())
return fmt.Errorf("%v peers avaialable = %d. total peers = %d. hashes needed = %d", errPeersUnavailable, len(availablePeers), len(d.peers), d.queue.Pending())
}
} else if len(d.queue.fetching) == 0 {
// When there are no more queue and no more `fetching`. We can
} else if d.queue.InFlight() == 0 {
// When there are no more queue and no more in flight, We can
// safely assume we're done. Another part of the process will check
// for parent errors and will re-request anything that's missing
break out
} else {
// Check for bad peers. Bad peers may indicate a peer not responding
// to a `getBlocks` message. A timeout of 5 seconds is set. Peers
// that badly or poorly behave are removed from the peer set (not banned).
// Bad peers are excluded from the available peer set and therefor won't be
// reused. XXX We could re-introduce peers after X time.
d.queue.mu.Lock()
var badPeers []string
for pid, chunk := range d.queue.fetching {
if time.Since(chunk.itime) > blockTtl {
badPeers = append(badPeers, pid)
// remove peer as good peer from peer list
// FIXME d.UnregisterPeer(pid)
}
}
d.queue.mu.Unlock()
for _, pid := range badPeers {
// A nil chunk is delivered so that the chunk's hashes are given
// back to the queue objects. When hashes are put back in the queue
// other (decent) peers can pick them up.
// XXX We could make use of a reputation system here ranking peers
// in their performance
// 1) Time for them to respond;
// 2) Measure their speed;
// 3) Amount and availability.
d.queue.deliver(pid, nil)
if peer := d.peers[pid]; peer != nil {
peer.demote()
peer.reset()
}
}
}
}
}
glog.V(logger.Detail).Infoln("Downloaded block(s) in", time.Since(start))
return nil
@@ -484,28 +406,11 @@ func (d *Downloader) AddHashes(id string, hashes []common.Hash) error {
return fmt.Errorf("received hashes from %s while active peer is %s", id, d.activePeer)
}
if glog.V(logger.Detail) && len(hashes) != 0 {
if glog.V(logger.Debug) && len(hashes) != 0 {
from, to := hashes[0], hashes[len(hashes)-1]
glog.Infof("adding %d (T=%d) hashes [ %x / %x ] from: %s\n", len(hashes), d.queue.hashPool.Size(), from[:4], to[:4], id)
glog.V(logger.Debug).Infof("adding %d (T=%d) hashes [ %x / %x ] from: %s\n", len(hashes), d.queue.Pending(), from[:4], to[:4], id)
}
d.hashCh <- hashPack{id, hashes}
return nil
}
func (d *Downloader) isFetchingHashes() bool {
return atomic.LoadInt32(&d.fetchingHashes) == 1
}
func (d *Downloader) isDownloadingBlocks() bool {
return atomic.LoadInt32(&d.downloadingBlocks) == 1
}
func (d *Downloader) isBusy() bool {
return d.isFetchingHashes() || d.isDownloadingBlocks()
}
func (d *Downloader) IsBusy() bool {
return d.isBusy()
}

View File

@@ -128,7 +128,7 @@ func TestDownload(t *testing.T) {
t.Error("download error", err)
}
inqueue := len(tester.downloader.queue.blocks)
inqueue := len(tester.downloader.queue.blockCache)
if inqueue != targetBlocks {
t.Error("expected", targetBlocks, "have", inqueue)
}
@@ -151,7 +151,7 @@ func TestMissing(t *testing.T) {
t.Error("download error", err)
}
inqueue := len(tester.downloader.queue.blocks)
inqueue := len(tester.downloader.queue.blockCache)
if inqueue != targetBlocks {
t.Error("expected", targetBlocks, "have", inqueue)
}
@@ -181,3 +181,51 @@ func TestTaking(t *testing.T) {
t.Error("expected to take 1000, got", len(bs1))
}
}
func TestThrottling(t *testing.T) {
minDesiredPeerCount = 4
blockTtl = 1 * time.Second
targetBlocks := 4 * blockCacheLimit
hashes := createHashes(0, targetBlocks)
blocks := createBlocksFromHashes(hashes)
tester := newTester(t, hashes, blocks)
tester.newPeer("peer1", big.NewInt(10000), hashes[0])
tester.newPeer("peer2", big.NewInt(0), common.Hash{})
tester.badBlocksPeer("peer3", big.NewInt(0), common.Hash{})
tester.badBlocksPeer("peer4", big.NewInt(0), common.Hash{})
// Concurrently download and take the blocks
errc := make(chan error, 1)
go func() {
errc <- tester.sync("peer1", hashes[0])
}()
done := make(chan struct{})
took := []*types.Block{}
go func() {
for {
select {
case <-done:
took = append(took, tester.downloader.TakeBlocks()...)
done <- struct{}{}
return
default:
took = append(took, tester.downloader.TakeBlocks()...)
}
}
}()
// Synchronise the two threads and verify
err := <-errc
done <- struct{}{}
<-done
if err != nil {
t.Fatalf("failed to synchronise blocks: %v", err)
}
if len(took) != targetBlocks {
t.Fatalf("downloaded block mismatch: have %v, want %v", len(took), targetBlocks)
}
}

View File

@@ -78,7 +78,7 @@ func newPeer(id string, hash common.Hash, getHashes hashFetcherFn, getBlocks blo
}
// fetch a chunk using the peer
func (p *peer) fetch(chunk *chunk) error {
func (p *peer) fetch(request *fetchRequest) error {
p.mu.Lock()
defer p.mu.Unlock()
@@ -88,13 +88,12 @@ func (p *peer) fetch(chunk *chunk) error {
// set working state
p.state = workingState
// convert the set to a fetchable slice
hashes, i := make([]common.Hash, chunk.hashes.Size()), 0
chunk.hashes.Each(func(v interface{}) bool {
hashes[i] = v.(common.Hash)
i++
return true
})
// Convert the hash set to a fetchable slice
hashes := make([]common.Hash, 0, len(request.Hashes))
for hash, _ := range request.Hashes {
hashes = append(hashes, hash)
}
p.getBlocks(hashes)
return nil

View File

@@ -1,201 +1,341 @@
package downloader
import (
"errors"
"fmt"
"math"
"sync"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"gopkg.in/fatih/set.v0"
"gopkg.in/karalabe/cookiejar.v2/collections/prque"
)
const (
blockCacheLimit = 1024 // Maximum number of blocks to cache before throttling the download
)
// fetchRequest is a currently running block retrieval operation.
type fetchRequest struct {
Peer *peer // Peer to which the request was sent
Hashes map[common.Hash]int // Requested hashes with their insertion index (priority)
Time time.Time // Time when the request was made
}
// queue represents hashes that are either need fetching or are being fetched
type queue struct {
hashPool *set.Set
fetchPool *set.Set
blockHashes *set.Set
hashPool map[common.Hash]int // Pending hashes, mapping to their insertion index (priority)
hashQueue *prque.Prque // Priority queue of the block hashes to fetch
hashCounter int // Counter indexing the added hashes to ensure retrieval order
mu sync.Mutex
fetching map[string]*chunk
pendPool map[string]*fetchRequest // Currently pending block retrieval operations
blockOffset int
blocks []*types.Block
blockPool map[common.Hash]int // Hash-set of the downloaded data blocks, mapping to cache indexes
blockCache []*types.Block // Downloaded but not yet delivered blocks
blockOffset int // Offset of the first cached block in the block-chain
lock sync.RWMutex
}
func newqueue() *queue {
// newQueue creates a new download queue for scheduling block retrieval.
func newQueue() *queue {
return &queue{
hashPool: set.New(),
fetchPool: set.New(),
blockHashes: set.New(),
fetching: make(map[string]*chunk),
hashPool: make(map[common.Hash]int),
hashQueue: prque.New(),
pendPool: make(map[string]*fetchRequest),
blockPool: make(map[common.Hash]int),
}
}
func (c *queue) reset() {
c.mu.Lock()
defer c.mu.Unlock()
// Reset clears out the queue contents.
func (q *queue) Reset() {
q.lock.Lock()
defer q.lock.Unlock()
c.resetNoTS()
}
func (c *queue) resetNoTS() {
c.blockOffset = 0
c.hashPool.Clear()
c.fetchPool.Clear()
c.blockHashes.Clear()
c.blocks = nil
c.fetching = make(map[string]*chunk)
q.hashPool = make(map[common.Hash]int)
q.hashQueue.Reset()
q.hashCounter = 0
q.pendPool = make(map[string]*fetchRequest)
q.blockPool = make(map[common.Hash]int)
q.blockOffset = 0
q.blockCache = nil
}
func (c *queue) size() int {
return c.hashPool.Size() + c.blockHashes.Size() + c.fetchPool.Size()
// Size retrieves the number of hashes in the queue, returning separately for
// pending and already downloaded.
func (q *queue) Size() (int, int) {
q.lock.RLock()
defer q.lock.RUnlock()
return len(q.hashPool), len(q.blockPool)
}
// reserve a `max` set of hashes for `p` peer.
func (c *queue) get(p *peer, max int) *chunk {
c.mu.Lock()
defer c.mu.Unlock()
// Pending retrieves the number of hashes pending for retrieval.
func (q *queue) Pending() int {
q.lock.RLock()
defer q.lock.RUnlock()
// return nothing if the pool has been depleted
if c.hashPool.Size() == 0 {
return nil
return q.hashQueue.Size()
}
// InFlight retrieves the number of fetch requests currently in flight.
func (q *queue) InFlight() int {
q.lock.RLock()
defer q.lock.RUnlock()
return len(q.pendPool)
}
// Throttle checks if the download should be throttled (active block fetches
// exceed block cache).
func (q *queue) Throttle() bool {
q.lock.RLock()
defer q.lock.RUnlock()
// Calculate the currently in-flight block requests
pending := 0
for _, request := range q.pendPool {
pending += len(request.Hashes)
}
// Throttle if more blocks are in-flight than free space in the cache
return pending >= len(q.blockCache)-len(q.blockPool)
}
limit := int(math.Min(float64(max), float64(c.hashPool.Size())))
// Create a new set of hashes
hashes, i := set.New(), 0
c.hashPool.Each(func(v interface{}) bool {
// break on limit
if i == limit {
return false
}
// skip any hashes that have previously been requested from the peer
if p.ignored.Has(v) {
return true
}
hashes.Add(v)
i++
// Has checks if a hash is within the download queue or not.
func (q *queue) Has(hash common.Hash) bool {
q.lock.RLock()
defer q.lock.RUnlock()
if _, ok := q.hashPool[hash]; ok {
return true
})
// if no hashes can be requested return a nil chunk
if hashes.Size() == 0 {
return nil
}
// remove the fetchable hashes from hash pool
c.hashPool.Separate(hashes)
c.fetchPool.Merge(hashes)
// Create a new chunk for the seperated hashes. The time is being used
// to reset the chunk (timeout)
chunk := &chunk{p, hashes, time.Now()}
// register as 'fetching' state
c.fetching[p.id] = chunk
// create new chunk for peer
return chunk
if _, ok := q.blockPool[hash]; ok {
return true
}
return false
}
func (c *queue) has(hash common.Hash) bool {
return c.hashPool.Has(hash) || c.fetchPool.Has(hash) || c.blockHashes.Has(hash)
// Insert adds a set of hashes for the download queue for scheduling.
func (q *queue) Insert(hashes []common.Hash) {
q.lock.Lock()
defer q.lock.Unlock()
// Insert all the hashes prioritized in the arrival order
for i, hash := range hashes {
index := q.hashCounter + i
q.hashPool[hash] = index
q.hashQueue.Push(hash, float32(index)) // Highest gets schedules first
}
// Update the hash counter for the next batch of inserts
q.hashCounter += len(hashes)
}
func (c *queue) getBlock(hash common.Hash) *types.Block {
c.mu.Lock()
defer c.mu.Unlock()
// GetHeadBlock retrieves the first block from the cache, or nil if it hasn't
// been downloaded yet (or simply non existent).
func (q *queue) GetHeadBlock() *types.Block {
q.lock.RLock()
defer q.lock.RUnlock()
if !c.blockHashes.Has(hash) {
if len(q.blockCache) == 0 {
return nil
}
return q.blockCache[0]
}
for _, block := range c.blocks {
if block.Hash() == hash {
return block
}
// GetBlock retrieves a downloaded block, or nil if non-existent.
func (q *queue) GetBlock(hash common.Hash) *types.Block {
q.lock.RLock()
defer q.lock.RUnlock()
// Short circuit if the block hasn't been downloaded yet
index, ok := q.blockPool[hash]
if !ok {
return nil
}
// Return the block if it's still available in the cache
if q.blockOffset <= index && index < q.blockOffset+len(q.blockCache) {
return q.blockCache[index-q.blockOffset]
}
return nil
}
// deliver delivers a chunk to the queue that was requested of the peer
func (c *queue) deliver(id string, blocks []*types.Block) (err error) {
c.mu.Lock()
defer c.mu.Unlock()
// TakeBlocks retrieves and permanently removes a batch of blocks from the cache.
// The head parameter is required to prevent a race condition where concurrent
// takes may fail parent verifications.
func (q *queue) TakeBlocks(head *types.Block) types.Blocks {
q.lock.Lock()
defer q.lock.Unlock()
chunk := c.fetching[id]
// If the chunk was never requested simply ignore it
if chunk != nil {
delete(c.fetching, id)
// check the length of the returned blocks. If the length of blocks is 0
// we'll assume the peer doesn't know about the chain.
if len(blocks) == 0 {
// So we can ignore the blocks we didn't know about
chunk.peer.ignored.Merge(chunk.hashes)
// Short circuit if the head block's different
if len(q.blockCache) == 0 || q.blockCache[0] != head {
return nil
}
// Otherwise accumulate all available blocks
var blocks types.Blocks
for _, block := range q.blockCache {
if block == nil {
break
}
blocks = append(blocks, block)
delete(q.blockPool, block.Hash())
}
// Delete the blocks from the slice and let them be garbage collected
// without this slice trick the blocks would stay in memory until nil
// would be assigned to q.blocks
copy(q.blockCache, q.blockCache[len(blocks):])
for k, n := len(q.blockCache)-len(blocks), len(q.blockCache); k < n; k++ {
q.blockCache[k] = nil
}
q.blockOffset += len(blocks)
// Add the blocks
for i, block := range blocks {
// See (1) for future limitation
n := int(block.NumberU64()) - c.blockOffset
if n > len(c.blocks) || n < 0 {
// set the error and set the blocks which could be processed
// abort the rest of the blocks (FIXME this could be improved)
err = fmt.Errorf("received block which overflow (N=%v O=%v)", block.Number(), c.blockOffset)
blocks = blocks[:i]
break
return blocks
}
// Reserve reserves a set of hashes for the given peer, skipping any previously
// failed download.
func (q *queue) Reserve(p *peer, max int) *fetchRequest {
q.lock.Lock()
defer q.lock.Unlock()
// Short circuit if the pool has been depleted, or if the peer's already
// downloading something (sanity check not to corrupt state)
if q.hashQueue.Empty() {
return nil
}
if _, ok := q.pendPool[p.id]; ok {
return nil
}
// Retrieve a batch of hashes, skipping previously failed ones
send := make(map[common.Hash]int)
skip := make(map[common.Hash]int)
for len(send) < max && !q.hashQueue.Empty() {
hash, priority := q.hashQueue.Pop()
if p.ignored.Has(hash) {
skip[hash.(common.Hash)] = int(priority)
} else {
send[hash.(common.Hash)] = int(priority)
}
}
// Merge all the skipped hashes back
for hash, index := range skip {
q.hashQueue.Push(hash, float32(index))
}
// Assemble and return the block download request
if len(send) == 0 {
return nil
}
request := &fetchRequest{
Peer: p,
Hashes: send,
Time: time.Now(),
}
q.pendPool[p.id] = request
return request
}
// Cancel aborts a fetch request, returning all pending hashes to the queue.
func (q *queue) Cancel(request *fetchRequest) {
q.lock.Lock()
defer q.lock.Unlock()
for hash, index := range request.Hashes {
q.hashQueue.Push(hash, float32(index))
}
delete(q.pendPool, request.Peer.id)
}
// Expire checks for in flight requests that exceeded a timeout allowance,
// canceling them and returning the responsible peers for penalization.
func (q *queue) Expire(timeout time.Duration) []string {
q.lock.Lock()
defer q.lock.Unlock()
// Iterate over the expired requests and return each to the queue
peers := []string{}
for id, request := range q.pendPool {
if time.Since(request.Time) > timeout {
for hash, index := range request.Hashes {
q.hashQueue.Push(hash, float32(index))
}
c.blocks[n] = block
peers = append(peers, id)
}
// seperate the blocks and the hashes
blockHashes := chunk.fetchedHashes(blocks)
// merge block hashes
c.blockHashes.Merge(blockHashes)
// Add back whatever couldn't be delivered
c.hashPool.Merge(chunk.hashes)
// Remove the hashes from the fetch pool
c.fetchPool.Separate(chunk.hashes)
}
return
}
func (c *queue) alloc(offset, size int) {
c.mu.Lock()
defer c.mu.Unlock()
if c.blockOffset < offset {
c.blockOffset = offset
// Remove the expired requests from the pending pool
for _, id := range peers {
delete(q.pendPool, id)
}
return peers
}
// (1) XXX at some point we could limit allocation to memory and use the disk
// to store future blocks.
if len(c.blocks) < size {
c.blocks = append(c.blocks, make([]*types.Block, size)...)
// Deliver injects a block retrieval response into the download queue.
func (q *queue) Deliver(id string, blocks []*types.Block) (err error) {
q.lock.Lock()
defer q.lock.Unlock()
// Short circuit if the blocks were never requested
request := q.pendPool[id]
if request == nil {
return errors.New("no fetches pending")
}
}
delete(q.pendPool, id)
// puts puts sets of hashes on to the queue for fetching
func (c *queue) put(hashes *set.Set) {
c.mu.Lock()
defer c.mu.Unlock()
c.hashPool.Merge(hashes)
}
type chunk struct {
peer *peer
hashes *set.Set
itime time.Time
}
func (ch *chunk) fetchedHashes(blocks []*types.Block) *set.Set {
fhashes := set.New()
// If no blocks were retrieved, mark them as unavailable for the origin peer
if len(blocks) == 0 {
for hash, _ := range request.Hashes {
request.Peer.ignored.Add(hash)
}
}
// Iterate over the downloaded blocks and add each of them
errs := make([]error, 0)
for _, block := range blocks {
fhashes.Add(block.Hash())
}
ch.hashes.Separate(fhashes)
// Skip any blocks that fall outside the cache range
index := int(block.NumberU64()) - q.blockOffset
if index >= len(q.blockCache) || index < 0 {
//fmt.Printf("block cache overflown (N=%v O=%v, C=%v)", block.Number(), q.blockOffset, len(q.blockCache))
continue
}
// Skip any blocks that were not requested
hash := block.Hash()
if _, ok := request.Hashes[hash]; !ok {
errs = append(errs, fmt.Errorf("non-requested block %v", hash))
continue
}
// Otherwise merge the block and mark the hash block
q.blockCache[index] = block
return fhashes
delete(request.Hashes, hash)
delete(q.hashPool, hash)
q.blockPool[hash] = int(block.NumberU64())
}
// Return all failed fetches to the queue
for hash, index := range request.Hashes {
q.hashQueue.Push(hash, float32(index))
}
if len(errs) != 0 {
return fmt.Errorf("multiple failures: %v", errs)
}
return nil
}
// Alloc ensures that the block cache is the correct size, given a starting
// offset, and a memory cap.
func (q *queue) Alloc(offset int) {
q.lock.Lock()
defer q.lock.Unlock()
if q.blockOffset < offset {
q.blockOffset = offset
}
size := len(q.hashPool)
if size > blockCacheLimit {
size = blockCacheLimit
}
if len(q.blockCache) < size {
q.blockCache = append(q.blockCache, make([]*types.Block, size-len(q.blockCache))...)
}
}

View File

@@ -32,31 +32,30 @@ func createBlocksFromHashSet(hashes *set.Set) []*types.Block {
}
func TestChunking(t *testing.T) {
queue := newqueue()
queue := newQueue()
peer1 := newPeer("peer1", common.Hash{}, nil, nil)
peer2 := newPeer("peer2", common.Hash{}, nil, nil)
// 99 + 1 (1 == known genesis hash)
hashes := createHashes(0, 99)
hashSet := createHashSet(hashes)
queue.put(hashSet)
queue.Insert(hashes)
chunk1 := queue.get(peer1, 99)
chunk1 := queue.Reserve(peer1, 99)
if chunk1 == nil {
t.Errorf("chunk1 is nil")
t.FailNow()
}
chunk2 := queue.get(peer2, 99)
chunk2 := queue.Reserve(peer2, 99)
if chunk2 == nil {
t.Errorf("chunk2 is nil")
t.FailNow()
}
if chunk1.hashes.Size() != 99 {
t.Error("expected chunk1 hashes to be 99, got", chunk1.hashes.Size())
if len(chunk1.Hashes) != 99 {
t.Error("expected chunk1 hashes to be 99, got", len(chunk1.Hashes))
}
if chunk2.hashes.Size() != 1 {
t.Error("expected chunk1 hashes to be 1, got", chunk2.hashes.Size())
if len(chunk2.Hashes) != 1 {
t.Error("expected chunk1 hashes to be 1, got", len(chunk2.Hashes))
}
}

View File

@@ -19,9 +19,9 @@ import (
)
const (
peerCountTimeout = 12 * time.Second // Amount of time it takes for the peer handler to ignore minDesiredPeerCount
blockProcTimer = 500 * time.Millisecond
minDesiredPeerCount = 5 // Amount of peers desired to start syncing
forceSyncCycle = 10 * time.Second // Time interval to force syncs, even if few peers are available
blockProcCycle = 500 * time.Millisecond // Time interval to check for new blocks to process
minDesiredPeerCount = 5 // Amount of peers desired to start syncing
blockProcAmount = 256
)
@@ -307,7 +307,7 @@ func (self *ProtocolManager) handleMsg(p *peer) error {
// Attempt to insert the newly received by checking if the parent exists.
// if the parent exists we process the block and propagate to our peers
// otherwise synchronise with the peer
// otherwise synchronize with the peer
if self.chainman.HasBlock(request.Block.ParentHash()) {
if _, err := self.chainman.InsertChain(types.Blocks{request.Block}); err != nil {
glog.V(logger.Error).Infoln("removed peer (", p.id, ") due to block error")

View File

@@ -12,10 +12,8 @@ import (
// Sync contains all synchronisation code for the eth protocol
func (pm *ProtocolManager) update() {
// itimer is used to determine when to start ignoring `minDesiredPeerCount`
itimer := time.NewTimer(peerCountTimeout)
// btimer is used for picking of blocks from the downloader
btimer := time.Tick(blockProcTimer)
forceSync := time.Tick(forceSyncCycle)
blockProc := time.Tick(blockProcCycle)
for {
select {
@@ -24,27 +22,22 @@ func (pm *ProtocolManager) update() {
if len(pm.peers) < minDesiredPeerCount {
break
}
// Find the best peer
// Find the best peer and synchronise with it
peer := getBestPeer(pm.peers)
if peer == nil {
glog.V(logger.Debug).Infoln("Sync attempt cancelled. No peers available")
glog.V(logger.Debug).Infoln("Sync attempt canceled. No peers available")
}
itimer.Stop()
go pm.synchronise(peer)
case <-itimer.C:
// The timer will make sure that the downloader keeps an active state
// in which it attempts to always check the network for highest td peers
// Either select the peer or restart the timer if no peers could
// be selected.
case <-forceSync:
// Force a sync even if not enough peers are present
if peer := getBestPeer(pm.peers); peer != nil {
go pm.synchronise(peer)
} else {
itimer.Reset(5 * time.Second)
}
case <-btimer:
case <-blockProc:
// Try to pull some blocks from the downloaded
go pm.processBlocks()
case <-pm.quitSync:
return
}
@@ -59,12 +52,11 @@ func (pm *ProtocolManager) processBlocks() error {
pm.wg.Add(1)
defer pm.wg.Done()
// Take a batch of blocks (will return nil if a previous batch has not reached the chain yet)
blocks := pm.downloader.TakeBlocks()
if len(blocks) == 0 {
return nil
}
defer pm.downloader.Done()
glog.V(logger.Debug).Infof("Inserting chain with %d blocks (#%v - #%v)\n", len(blocks), blocks[0].Number(), blocks[len(blocks)-1].Number())
for len(blocks) != 0 && !pm.quit {
@@ -83,26 +75,28 @@ func (pm *ProtocolManager) synchronise(peer *peer) {
if peer.td.Cmp(pm.chainman.Td()) <= 0 {
return
}
// Check downloader if it's busy so it doesn't show the sync message
// for every attempty
if pm.downloader.IsBusy() {
return
}
// FIXME if we have the hash in our chain and the TD of the peer is
// much higher than ours, something is wrong with us or the peer.
// Check if the hash is on our own chain
if pm.chainman.HasBlock(peer.recentHash) {
return
}
// Get the hashes from the peer (synchronously)
glog.V(logger.Debug).Infof("Attempting synchronisation: %v, 0x%x", peer.id, peer.recentHash)
err := pm.downloader.Synchronise(peer.id, peer.recentHash)
if err != nil && err == downloader.ErrBadPeer {
glog.V(logger.Debug).Infoln("removed peer from peer set due to bad action")
switch err {
case nil:
glog.V(logger.Debug).Infof("Synchronisation completed")
case downloader.ErrBusy:
glog.V(logger.Debug).Infof("Synchronisation already in progress")
case downloader.ErrTimeout:
glog.V(logger.Debug).Infof("Removing peer %v due to sync timeout", peer.id)
pm.removePeer(peer)
} else if err != nil {
// handle error
glog.V(logger.Detail).Infoln("error downloading:", err)
default:
glog.V(logger.Warn).Infof("Synchronisation failed: %v", err)
}
}

View File

@@ -88,8 +88,8 @@ out:
case core.TxPreEvent:
self.filterMu.RLock()
for _, filter := range self.filters {
if filter.PendingCallback != nil {
filter.PendingCallback(event.Tx)
if filter.TransactionCallback != nil {
filter.TransactionCallback(event.Tx)
}
}
self.filterMu.RUnlock()

File diff suppressed because one or more lines are too long

View File

@@ -143,6 +143,10 @@ func (self *JSRE) runEventLoop() {
}
return otto.UndefinedValue()
}
self.vm.Set("setTimeout", setTimeout)
self.vm.Set("setInterval", setInterval)
self.vm.Set("clearTimeout", clearTimeout)
self.vm.Set("clearInterval", clearTimeout)
var waitForCallbacks bool
@@ -165,7 +169,7 @@ loop:
_, err := self.vm.Call(`Function.call.call`, nil, arguments...)
if err != nil {
break loop
fmt.Println("js error:", err, arguments)
}
if timer.interval {
timer.timer.Reset(timer.duration)
@@ -177,10 +181,6 @@ loop:
}
case evalReq := <-self.evalQueue:
// run the code, send the result back
self.vm.Set("setTimeout", setTimeout)
self.vm.Set("setInterval", setInterval)
self.vm.Set("clearTimeout", clearTimeout)
self.vm.Set("clearInterval", clearTimeout)
evalReq.fn(&evalReq.res)
close(evalReq.done)
if waitForCallbacks && (len(registry) == 0) {
@@ -286,7 +286,7 @@ func (self *JSRE) loadScript(call otto.FunctionCall) otto.Value {
// uses the "prettyPrint" JS function to format a value
func (self *JSRE) PrettyPrint(v interface{}) (val otto.Value, err error) {
var method otto.Value
v, err = self.vm.ToValue(v)
v, err = self.ToValue(v)
if err != nil {
return
}
@@ -297,8 +297,23 @@ func (self *JSRE) PrettyPrint(v interface{}) (val otto.Value, err error) {
return method.Call(method, v)
}
// creates an otto value from a go type
// creates an otto value from a go type (serialized version)
func (self *JSRE) ToValue(v interface{}) (otto.Value, error) {
done := make(chan bool)
req := &evalReq{
fn: func(res *evalResult) {
res.result, res.err = self.vm.ToValue(v)
},
done: done,
}
self.evalQueue <- req
<-done
return req.res.result, req.res.err
}
// creates an otto value from a go type (non-serialized version)
func (self *JSRE) ToVal(v interface{}) otto.Value {
result, err := self.vm.ToValue(v)
if err != nil {
fmt.Println("Value unknown:", err)

View File

@@ -65,26 +65,26 @@ type protoHandshake struct {
ID discover.NodeID
}
// setupConn starts a protocol session on the given connection.
// It runs the encryption handshake and the protocol handshake.
// If dial is non-nil, the connection the local node is the initiator.
// If atcap is true, the connection will be disconnected with DiscTooManyPeers
// after the key exchange.
func setupConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake, dial *discover.Node, atcap bool, trusted map[discover.NodeID]bool) (*conn, error) {
// setupConn starts a protocol session on the given connection. It
// runs the encryption handshake and the protocol handshake. If dial
// is non-nil, the connection the local node is the initiator. If
// keepconn returns false, the connection will be disconnected with
// DiscTooManyPeers after the key exchange.
func setupConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake, dial *discover.Node, keepconn func(discover.NodeID) bool) (*conn, error) {
if dial == nil {
return setupInboundConn(fd, prv, our, atcap, trusted)
return setupInboundConn(fd, prv, our, keepconn)
} else {
return setupOutboundConn(fd, prv, our, dial, atcap, trusted)
return setupOutboundConn(fd, prv, our, dial, keepconn)
}
}
func setupInboundConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake, atcap bool, trusted map[discover.NodeID]bool) (*conn, error) {
func setupInboundConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake, keepconn func(discover.NodeID) bool) (*conn, error) {
secrets, err := receiverEncHandshake(fd, prv, nil)
if err != nil {
return nil, fmt.Errorf("encryption handshake failed: %v", err)
}
rw := newRlpxFrameRW(fd, secrets)
if atcap && !trusted[secrets.RemoteID] {
if !keepconn(secrets.RemoteID) {
SendItems(rw, discMsg, DiscTooManyPeers)
return nil, errors.New("we have too many peers")
}
@@ -99,13 +99,13 @@ func setupInboundConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake, a
return &conn{rw, rhs}, nil
}
func setupOutboundConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake, dial *discover.Node, atcap bool, trusted map[discover.NodeID]bool) (*conn, error) {
func setupOutboundConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake, dial *discover.Node, keepconn func(discover.NodeID) bool) (*conn, error) {
secrets, err := initiatorEncHandshake(fd, prv, dial.ID, nil)
if err != nil {
return nil, fmt.Errorf("encryption handshake failed: %v", err)
}
rw := newRlpxFrameRW(fd, secrets)
if atcap && !trusted[secrets.RemoteID] {
if !keepconn(secrets.RemoteID) {
SendItems(rw, discMsg, DiscTooManyPeers)
return nil, errors.New("we have too many peers")
}

View File

@@ -141,9 +141,10 @@ func TestSetupConn(t *testing.T) {
fd0, fd1 := net.Pipe()
done := make(chan struct{})
keepalways := func(discover.NodeID) bool { return true }
go func() {
defer close(done)
conn0, err := setupConn(fd0, prv0, hs0, node1, false, nil)
conn0, err := setupConn(fd0, prv0, hs0, node1, keepalways)
if err != nil {
t.Errorf("outbound side error: %v", err)
return
@@ -156,7 +157,7 @@ func TestSetupConn(t *testing.T) {
}
}()
conn1, err := setupConn(fd1, prv1, hs1, nil, false, nil)
conn1, err := setupConn(fd1, prv1, hs1, nil, keepalways)
if err != nil {
t.Fatalf("inbound side error: %v", err)
}

View File

@@ -211,6 +211,18 @@ func (p *Peer) handle(msg Msg) error {
return nil
}
func countMatchingProtocols(protocols []Protocol, caps []Cap) int {
n := 0
for _, cap := range caps {
for _, proto := range protocols {
if proto.Name == cap.Name && proto.Version == cap.Version {
n++
}
}
}
return n
}
// matchProtocols creates structures for matching named subprotocols.
func matchProtocols(protocols []Protocol, caps []Cap, rw MsgReadWriter) map[string]*protoRW {
sort.Sort(capsByName(caps))

View File

@@ -22,10 +22,11 @@ const (
refreshPeersInterval = 30 * time.Second
staticPeerCheckInterval = 15 * time.Second
// This is the maximum number of inbound connection
// that are allowed to linger between 'accepted' and
// 'added as peer'.
maxAcceptConns = 50
// Maximum number of concurrently handshaking inbound connections.
maxAcceptConns = 10
// Maximum number of concurrently dialing outbound connections.
maxDialingConns = 10
// total timeout for encryption handshake and protocol
// handshake in both directions.
@@ -52,6 +53,11 @@ type Server struct {
// connected. It must be greater than zero.
MaxPeers int
// MaxPendingPeers is the maximum number of peers that can be pending in the
// handshake phase, counted separately for inbound and outbound connections.
// Zero defaults to preset values.
MaxPendingPeers int
// Name sets the node name of this server.
// Use common.MakeName to create a name that follows existing conventions.
Name string
@@ -120,7 +126,7 @@ type Server struct {
peerWG sync.WaitGroup // active peer goroutines
}
type setupFunc func(net.Conn, *ecdsa.PrivateKey, *protoHandshake, *discover.Node, bool, map[discover.NodeID]bool) (*conn, error)
type setupFunc func(net.Conn, *ecdsa.PrivateKey, *protoHandshake, *discover.Node, func(discover.NodeID) bool) (*conn, error)
type newPeerHook func(*Peer)
// Peers returns all connected peers.
@@ -331,8 +337,12 @@ func (srv *Server) listenLoop() {
// This channel acts as a semaphore limiting
// active inbound connections that are lingering pre-handshake.
// If all slots are taken, no further connections are accepted.
slots := make(chan struct{}, maxAcceptConns)
for i := 0; i < maxAcceptConns; i++ {
tokens := maxAcceptConns
if srv.MaxPendingPeers > 0 {
tokens = srv.MaxPendingPeers
}
slots := make(chan struct{}, tokens)
for i := 0; i < tokens; i++ {
slots <- struct{}{}
}
@@ -401,7 +411,15 @@ func (srv *Server) dialLoop() {
defer srv.loopWG.Done()
defer refresh.Stop()
// TODO: maybe limit number of active dials
// Limit the number of concurrent dials
tokens := maxDialingConns
if srv.MaxPendingPeers > 0 {
tokens = srv.MaxPendingPeers
}
slots := make(chan struct{}, tokens)
for i := 0; i < tokens; i++ {
slots <- struct{}{}
}
dial := func(dest *discover.Node) {
// Don't dial nodes that would fail the checks in addPeer.
// This is important because the connection handshake is a lot
@@ -413,11 +431,14 @@ func (srv *Server) dialLoop() {
if !ok || dialing[dest.ID] {
return
}
// Request a dial slot to prevent CPU exhaustion
<-slots
dialing[dest.ID] = true
srv.peerWG.Add(1)
go func() {
srv.dialNode(dest)
slots <- struct{}{}
dialed <- dest
}()
}
@@ -485,17 +506,7 @@ func (srv *Server) startPeer(fd net.Conn, dest *discover.Node) {
// the callers of startPeer added the peer to the wait group already.
fd.SetDeadline(time.Now().Add(handshakeTimeout))
// Check capacity, but override for static nodes
srv.lock.RLock()
atcap := len(srv.peers) == srv.MaxPeers
if dest != nil {
if _, ok := srv.staticNodes[dest.ID]; ok {
atcap = false
}
}
srv.lock.RUnlock()
conn, err := srv.setupFunc(fd, srv.PrivateKey, srv.ourHandshake, dest, atcap, srv.trustedNodes)
conn, err := srv.setupFunc(fd, srv.PrivateKey, srv.ourHandshake, dest, srv.keepconn)
if err != nil {
fd.Close()
glog.V(logger.Debug).Infof("Handshake with %v failed: %v", fd.RemoteAddr(), err)
@@ -507,7 +518,7 @@ func (srv *Server) startPeer(fd net.Conn, dest *discover.Node) {
conn: fd, rtimeout: frameReadTimeout, wtimeout: frameWriteTimeout,
}
p := newPeer(fd, conn, srv.Protocols)
if ok, reason := srv.addPeer(conn.ID, p); !ok {
if ok, reason := srv.addPeer(conn, p); !ok {
glog.V(logger.Detail).Infof("Not adding %v (%v)\n", p, reason)
p.politeDisconnect(reason)
srv.peerWG.Done()
@@ -518,6 +529,21 @@ func (srv *Server) startPeer(fd net.Conn, dest *discover.Node) {
go srv.runPeer(p)
}
// preflight checks whether a connection should be kept. it runs
// after the encryption handshake, as soon as the remote identity is
// known.
func (srv *Server) keepconn(id discover.NodeID) bool {
srv.lock.RLock()
defer srv.lock.RUnlock()
if _, ok := srv.staticNodes[id]; ok {
return true // static nodes are always allowed
}
if _, ok := srv.trustedNodes[id]; ok {
return true // trusted nodes are always allowed
}
return len(srv.peers) < srv.MaxPeers
}
func (srv *Server) runPeer(p *Peer) {
glog.V(logger.Debug).Infof("Added %v\n", p)
srvjslog.LogJson(&logger.P2PConnected{
@@ -538,13 +564,18 @@ func (srv *Server) runPeer(p *Peer) {
})
}
func (srv *Server) addPeer(id discover.NodeID, p *Peer) (bool, DiscReason) {
func (srv *Server) addPeer(conn *conn, p *Peer) (bool, DiscReason) {
// drop connections with no matching protocols.
if len(srv.Protocols) > 0 && countMatchingProtocols(srv.Protocols, conn.protoHandshake.Caps) == 0 {
return false, DiscUselessPeer
}
// add the peer if it passes the other checks.
srv.lock.Lock()
defer srv.lock.Unlock()
if ok, reason := srv.checkPeer(id); !ok {
if ok, reason := srv.checkPeer(conn.ID); !ok {
return false, reason
}
srv.peers[id] = p
srv.peers[conn.ID] = p
return true, 0
}

View File

@@ -22,8 +22,11 @@ func startTestServer(t *testing.T, pf newPeerHook) *Server {
ListenAddr: "127.0.0.1:0",
PrivateKey: newkey(),
newPeerHook: pf,
setupFunc: func(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake, dial *discover.Node, atcap bool, trusted map[discover.NodeID]bool) (*conn, error) {
setupFunc: func(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake, dial *discover.Node, keepconn func(discover.NodeID) bool) (*conn, error) {
id := randomID()
if !keepconn(id) {
return nil, DiscAlreadyConnected
}
rw := newRlpxFrameRW(fd, secrets{
MAC: zero16,
AES: zero16,
@@ -200,7 +203,7 @@ func TestServerDisconnectAtCap(t *testing.T) {
// Run the handshakes just like a real peer would.
key := newkey()
hs := &protoHandshake{Version: baseProtocolVersion, ID: discover.PubkeyID(&key.PublicKey)}
_, err = setupConn(conn, key, hs, srv.Self(), false, srv.trustedNodes)
_, err = setupConn(conn, key, hs, srv.Self(), keepalways)
if i == nconns-1 {
// When handling the last connection, the server should
// disconnect immediately instead of running the protocol
@@ -250,7 +253,7 @@ func TestServerStaticPeers(t *testing.T) {
// Run the handshakes just like a real peer would, and wait for completion
key := newkey()
shake := &protoHandshake{Version: baseProtocolVersion, ID: discover.PubkeyID(&key.PublicKey)}
if _, err = setupConn(conn, key, shake, server.Self(), false, server.trustedNodes); err != nil {
if _, err = setupConn(conn, key, shake, server.Self(), keepalways); err != nil {
t.Fatalf("conn %d: unexpected error: %v", i, err)
}
<-started
@@ -344,7 +347,7 @@ func TestServerTrustedPeers(t *testing.T) {
// Run the handshakes just like a real peer would, and wait for completion
key := newkey()
shake := &protoHandshake{Version: baseProtocolVersion, ID: discover.PubkeyID(&key.PublicKey)}
if _, err = setupConn(conn, key, shake, server.Self(), false, server.trustedNodes); err != nil {
if _, err = setupConn(conn, key, shake, server.Self(), keepalways); err != nil {
t.Fatalf("conn %d: unexpected error: %v", i, err)
}
<-started
@@ -357,7 +360,7 @@ func TestServerTrustedPeers(t *testing.T) {
defer conn.Close()
shake := &protoHandshake{Version: baseProtocolVersion, ID: trusted.ID}
if _, err = setupConn(conn, key, shake, server.Self(), false, server.trustedNodes); err != nil {
if _, err = setupConn(conn, key, shake, server.Self(), keepalways); err != nil {
t.Fatalf("trusted node: unexpected error: %v", err)
}
select {
@@ -369,6 +372,136 @@ func TestServerTrustedPeers(t *testing.T) {
}
}
// Tests that a failed dial will temporarily throttle a peer.
func TestServerMaxPendingDials(t *testing.T) {
defer testlog(t).detach()
// Start a simple test server
server := &Server{
ListenAddr: "127.0.0.1:0",
PrivateKey: newkey(),
MaxPeers: 10,
MaxPendingPeers: 1,
}
if err := server.Start(); err != nil {
t.Fatal("failed to start test server: %v", err)
}
defer server.Stop()
// Simulate two separate remote peers
peers := make(chan *discover.Node, 2)
conns := make(chan net.Conn, 2)
for i := 0; i < 2; i++ {
listener, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Fatalf("listener %d: failed to setup: %v", i, err)
}
defer listener.Close()
addr := listener.Addr().(*net.TCPAddr)
peers <- &discover.Node{
ID: discover.PubkeyID(&newkey().PublicKey),
IP: addr.IP,
TCP: uint16(addr.Port),
}
go func() {
conn, err := listener.Accept()
if err == nil {
conns <- conn
}
}()
}
// Request a dial for both peers
go func() {
for i := 0; i < 2; i++ {
server.staticDial <- <-peers // hack piggybacking the static implementation
}
}()
// Make sure only one outbound connection goes through
var conn net.Conn
select {
case conn = <-conns:
case <-time.After(100 * time.Millisecond):
t.Fatalf("first dial timeout")
}
select {
case conn = <-conns:
t.Fatalf("second dial completed prematurely")
case <-time.After(100 * time.Millisecond):
}
// Finish the first dial, check the second
conn.Close()
select {
case conn = <-conns:
conn.Close()
case <-time.After(100 * time.Millisecond):
t.Fatalf("second dial timeout")
}
}
func TestServerMaxPendingAccepts(t *testing.T) {
defer testlog(t).detach()
// Start a test server and a peer sink for synchronization
started := make(chan *Peer)
server := &Server{
ListenAddr: "127.0.0.1:0",
PrivateKey: newkey(),
MaxPeers: 10,
MaxPendingPeers: 1,
NoDial: true,
newPeerHook: func(p *Peer) { started <- p },
}
if err := server.Start(); err != nil {
t.Fatal("failed to start test server: %v", err)
}
defer server.Stop()
// Try and connect to the server on multiple threads concurrently
conns := make([]net.Conn, 2)
for i := 0; i < 2; i++ {
dialer := &net.Dialer{Deadline: time.Now().Add(3 * time.Second)}
conn, err := dialer.Dial("tcp", server.ListenAddr)
if err != nil {
t.Fatalf("failed to dial server: %v", err)
}
conns[i] = conn
}
// Check that a handshake on the second doesn't pass
go func() {
key := newkey()
shake := &protoHandshake{Version: baseProtocolVersion, ID: discover.PubkeyID(&key.PublicKey)}
if _, err := setupConn(conns[1], key, shake, server.Self(), keepalways); err != nil {
t.Fatalf("failed to run handshake: %v", err)
}
}()
select {
case <-started:
t.Fatalf("handshake on second connection accepted")
case <-time.After(time.Second):
}
// Shake on first, check that both go through
go func() {
key := newkey()
shake := &protoHandshake{Version: baseProtocolVersion, ID: discover.PubkeyID(&key.PublicKey)}
if _, err := setupConn(conns[0], key, shake, server.Self(), keepalways); err != nil {
t.Fatalf("failed to run handshake: %v", err)
}
}()
for i := 0; i < 2; i++ {
select {
case <-started:
case <-time.After(time.Second):
t.Fatalf("peer %d: handshake timeout", i)
}
}
}
func newkey() *ecdsa.PrivateKey {
key, err := crypto.GenerateKey()
if err != nil {
@@ -383,3 +516,7 @@ func randomID() (id discover.NodeID) {
}
return id
}
func keepalways(id discover.NodeID) bool {
return true
}

View File

@@ -2,9 +2,8 @@ package rpc
import (
"encoding/json"
"fmt"
"math/big"
"sync"
// "sync"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
@@ -14,8 +13,7 @@ import (
)
type EthereumApi struct {
eth *xeth.XEth
xethMu sync.RWMutex
eth *xeth.XEth
}
func NewEthereumApi(xeth *xeth.XEth) *EthereumApi {
@@ -27,9 +25,6 @@ func NewEthereumApi(xeth *xeth.XEth) *EthereumApi {
}
func (api *EthereumApi) xeth() *xeth.XEth {
api.xethMu.RLock()
defer api.xethMu.RUnlock()
return api.eth
}
@@ -154,6 +149,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
}
*reply = newHexNum(big.NewInt(int64(len(br.Uncles))).Bytes())
case "eth_getData", "eth_getCode":
args := new(GetDataArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {
@@ -161,18 +157,13 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
}
v := api.xethAtStateNum(args.BlockNumber).CodeAtBytes(args.Address)
*reply = newHexData(v)
case "eth_sendTransaction", "eth_transact":
args := new(NewTxArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
}
// call ConfirmTransaction first
tx, _ := json.Marshal(req)
if !api.xeth().ConfirmTransaction(string(tx)) {
return fmt.Errorf("Transaction not confirmed")
}
// nonce may be nil ("guess" mode)
var nonce string
if args.Nonce != nil {
@@ -311,25 +302,49 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
} else {
*reply = v.Uncles[args.Index]
}
case "eth_getCompilers":
c := []string{""}
var lang string
if solc, _ := api.xeth().Solc(); solc != nil {
lang = "Solidity"
}
c := []string{lang}
*reply = c
case "eth_compileSolidity", "eth_compileLLL", "eth_compileSerpent":
case "eth_compileLLL", "eth_compileSerpent":
return NewNotImplementedError(req.Method)
case "eth_compileSolidity":
solc, _ := api.xeth().Solc()
if solc == nil {
return NewNotImplementedError(req.Method)
}
args := new(SourceArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
}
contract, err := solc.Compile(args.Source)
if err != nil {
return err
}
*reply = contract
case "eth_newFilter":
args := new(BlockFilterArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
}
id := api.xeth().RegisterFilter(args.Earliest, args.Latest, args.Skip, args.Max, args.Address, args.Topics)
id := api.xeth().NewLogFilter(args.Earliest, args.Latest, args.Skip, args.Max, args.Address, args.Topics)
*reply = newHexNum(big.NewInt(int64(id)).Bytes())
case "eth_newBlockFilter":
args := new(FilterStringArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
}
*reply = newHexNum(api.xeth().NewFilterString(args.Word))
*reply = newHexNum(api.xeth().NewBlockFilter())
case "eth_newPendingTransactionFilter":
*reply = newHexNum(api.xeth().NewTransactionFilter())
case "eth_uninstallFilter":
args := new(FilterIdArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {
@@ -341,7 +356,17 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
if err := json.Unmarshal(req.Params, &args); err != nil {
return err
}
*reply = NewLogsRes(api.xeth().FilterChanged(args.Id))
switch api.xeth().GetFilterType(args.Id) {
case xeth.BlockFilterTy:
*reply = NewHashesRes(api.xeth().BlockFilterChanged(args.Id))
case xeth.TransactionFilterTy:
*reply = NewHashesRes(api.xeth().TransactionFilterChanged(args.Id))
case xeth.LogFilterTy:
*reply = NewLogsRes(api.xeth().LogFilterChanged(args.Id))
default:
*reply = []string{} // reply empty string slice
}
case "eth_getFilterLogs":
args := new(FilterIdArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {

View File

@@ -5,8 +5,12 @@ import (
// "sync"
"testing"
// "time"
// "fmt"
"io/ioutil"
"strconv"
// "github.com/ethereum/go-ethereum/xeth"
"github.com/ethereum/go-ethereum/common/compiler"
"github.com/ethereum/go-ethereum/xeth"
)
func TestWeb3Sha3(t *testing.T) {
@@ -26,6 +30,97 @@ func TestWeb3Sha3(t *testing.T) {
}
}
func TestCompileSolidity(t *testing.T) {
solc, err := compiler.New("")
if solc == nil {
t.Skip("no solidity compiler")
}
source := `contract test {\n` +
" /// @notice Will multiply `a` by 7." + `\n` +
` function multiply(uint a) returns(uint d) {\n` +
` return a * 7;\n` +
` }\n` +
`}\n`
jsonstr := `{"jsonrpc":"2.0","method":"eth_compileSolidity","params":["` + source + `"],"id":64}`
expCode := "605280600c6000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa114602e57005b60376004356041565b8060005260206000f35b6000600782029050604d565b91905056"
expAbiDefinition := `[{"constant":false,"inputs":[{"name":"a","type":"uint256"}],"name":"multiply","outputs":[{"name":"d","type":"uint256"}],"type":"function"}]`
expUserDoc := `{"methods":{"multiply(uint256)":{"notice":"Will multiply ` + "`a`" + ` by 7."}}}`
expDeveloperDoc := `{"methods":{}}`
expCompilerVersion := `0.9.13`
expLanguage := "Solidity"
expLanguageVersion := "0"
expSource := source
api := NewEthereumApi(&xeth.XEth{})
var req RpcRequest
json.Unmarshal([]byte(jsonstr), &req)
var response interface{}
err = api.GetRequestReply(&req, &response)
if err != nil {
t.Errorf("expected no error, got %v", err)
}
respjson, err := json.Marshal(response)
if err != nil {
t.Errorf("expected no error, got %v", err)
}
var contract = compiler.Contract{}
err = json.Unmarshal(respjson, &contract)
if err != nil {
t.Errorf("expected no error, got %v", err)
}
if contract.Code != expCode {
t.Errorf("Expected %s got %s", expCode, contract.Code)
}
if strconv.Quote(contract.Info.Source) != `"`+expSource+`"` {
t.Errorf("Expected \n'%s' got \n'%s'", expSource, strconv.Quote(contract.Info.Source))
}
if contract.Info.Language != expLanguage {
t.Errorf("Expected %s got %s", expLanguage, contract.Info.Language)
}
if contract.Info.LanguageVersion != expLanguageVersion {
t.Errorf("Expected %s got %s", expLanguageVersion, contract.Info.LanguageVersion)
}
if contract.Info.CompilerVersion != expCompilerVersion {
t.Errorf("Expected %s got %s", expCompilerVersion, contract.Info.CompilerVersion)
}
userdoc, err := json.Marshal(contract.Info.UserDoc)
if err != nil {
t.Errorf("expected no error, got %v", err)
}
devdoc, err := json.Marshal(contract.Info.DeveloperDoc)
if err != nil {
t.Errorf("expected no error, got %v", err)
}
abidef, err := json.Marshal(contract.Info.AbiDefinition)
if err != nil {
t.Errorf("expected no error, got %v", err)
}
if string(abidef) != expAbiDefinition {
t.Errorf("Expected \n'%s' got \n'%s'", expAbiDefinition, string(abidef))
}
ioutil.WriteFile("/tmp/abidef", []byte(string(abidef)), 0700)
ioutil.WriteFile("/tmp/expabidef", []byte(expAbiDefinition), 0700)
if string(userdoc) != expUserDoc {
t.Errorf("Expected \n'%s' got \n'%s'", expUserDoc, string(userdoc))
}
if string(devdoc) != expDeveloperDoc {
t.Errorf("Expected %s got %s", expDeveloperDoc, string(devdoc))
}
}
// func TestDbStr(t *testing.T) {
// jsonput := `{"jsonrpc":"2.0","method":"db_putString","params":["testDB","myKey","myString"],"id":64}`
// jsonget := `{"jsonrpc":"2.0","method":"db_getString","params":["testDB","myKey"],"id":64}`

View File

@@ -1136,3 +1136,26 @@ func (args *SubmitWorkArgs) UnmarshalJSON(b []byte) (err error) {
return nil
}
type SourceArgs struct {
Source string
}
func (args *SourceArgs) UnmarshalJSON(b []byte) (err error) {
var obj []interface{}
if err := json.Unmarshal(b, &obj); err != nil {
return NewDecodeParamError(err.Error())
}
if len(obj) < 1 {
return NewInsufficientParamsError(len(obj), 1)
}
arg0, ok := obj[0].(string)
if !ok {
return NewInvalidTypeError("source code", "not a string")
}
args.Source = arg0
return nil
}

View File

@@ -2494,3 +2494,13 @@ func TestBlockHeightFromJsonInvalid(t *testing.T) {
t.Error(str)
}
}
func TestSourceArgsEmpty(t *testing.T) {
input := `[]`
args := new(SourceArgs)
str := ExpectInsufficientParamsError(json.Unmarshal([]byte(input), &args))
if len(str) > 0 {
t.Error(str)
}
}

View File

@@ -3,6 +3,7 @@ package rpc
import (
"encoding/json"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
)
@@ -303,3 +304,13 @@ func NewLogsRes(logs state.Logs) (ls []LogRes) {
return
}
func NewHashesRes(hs []common.Hash) []string {
hashes := make([]string, len(hs))
for i, hash := range hs {
hashes[i] = hash.Hex()
}
return hashes
}

View File

@@ -44,6 +44,10 @@ func TestBcForkBlockTests(t *testing.T) {
runBlockTestsInFile("files/BlockTests/bcForkBlockTest.json", []string{}, t)
}
func TestBcTotalDifficulty(t *testing.T) {
runBlockTestsInFile("files/BlockTests/bcTotalDifficultyTest.json", []string{}, t)
}
func runBlockTestsInFile(filepath string, snafus []string, t *testing.T) {
bt, err := LoadBlockTests(filepath)
if err != nil {

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,71 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f0000000000000000000000010000000000000000000000000000000000000000a27f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff167ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff42070b8c5430070bf15560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e4c7aa9",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b379178585",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "6cfc27db102eef174dcf122d8f31a69f009fb0d349fafc44f01c46c5475a92f5",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f0000000000000000000000010000000000000000000000000000000000000000a27f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff167ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff42070b8c5430070bf15560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f0000000000000000000000010000000000000000000000000000000000000000a27f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff167ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff42070b8c5430070bf1",
"gasLimit" : "0x2e4c7a7b",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x293d448f"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x33c6014b",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe447f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000000000000000000000000000000000000000000017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe60005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xc396",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3739d3b4d",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "f1f5f06ca3269f5e4e7d172828216e2089156370c90bf41ec84bdc04de644a6f",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe447f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000000000000000000000000000000000000000000017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe60005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f00000000000000000000000000000000000000000000000000000000000000017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe447f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000000000000000000000000000000000000000000017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe",
"gasLimit" : "0x0cc5000c",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x33c6014b"
}
}
}

View File

@@ -0,0 +1,73 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x3f7ada4a",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000100000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000015560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xffffffffffffffffffffffffffffffffffffffff",
"0x01" : "0x01"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x0102f7",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b367e822ed",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "2ac7a32edf453f27c5910d2e018b0b8825e1d849ba2bfa68fffb6899e9f57cb0",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000100000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000015560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f00000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000100000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f0000000000000000000000000000000000000000000000000000000000000001",
"gasLimit" : "0x1b7d47a1",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x3f7ada4a"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x4e91b038",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f0000000000000000000000010000000000000000000000000000000000000000947f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x945304eb96065b2a98b57a48a06ae28d285a71b5"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xc097",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b358d18f5f",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "df7a2395377733685e4ffd910ac50c5e14adceb1d0648200e6a35451f7ffe707",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f0000000000000000000000010000000000000000000000000000000000000000947f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f0000000000000000000000010000000000000000000000000000000000000000947f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b5",
"gasLimit" : "0x3e7f5362",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x4e91b038"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x5de12c27",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b5437f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000160005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x01"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xc856",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b349820bb1",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "f86368de65d734ca2c25bda227757d798e3a8a66dc8ce18ddceed0bd121a2518",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b5437f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000160005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f00000000000000000000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b5437f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000001",
"gasLimit" : "0x2f866490",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x5de12c27"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x105d80ad",
"code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe44447f000000000000000000000000000000000000000000000000000000000000c3507f00000000000000000000000000000000000000000000000000000000000000017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3506c8ea356796d65546d3883768f5560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x8ea356796d65546d3883768f55"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xc24c",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b39705bd35",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "40a5c7197419fb4c4bbd2c399eddc9ad8bcd01b0b950428958c21339ed0253ef",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe44447f000000000000000000000000000000000000000000000000000000000000c3507f00000000000000000000000000000000000000000000000000000000000000017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3506c8ea356796d65546d3883768f5560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe44447f000000000000000000000000000000000000000000000000000000000000c3507f00000000000000000000000000000000000000000000000000000000000000017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3506c8ea356796d65546d3883768f",
"gasLimit" : "0x026c8829",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x105d80ad"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x1569eba8",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe437f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff085560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x010000000000000000000000000000000000000000"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xe42a",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b391f9305c",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "7cdbaeca641a4910d86fc89e8897ce522d64c7efff9af8821b6d9b21e6f6ae16",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe437f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff085560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe437f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff08",
"gasLimit" : "0x708c2d19",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x1569eba8"
}
}
}

View File

@@ -0,0 +1,73 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x6ac01f3a",
"code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff4244904244045560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x051d6a3cd647",
"0x051d6a3cd647" : "0x01"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x01077c",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b33ca2d978",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "8b81447cdcd4755c4a1ec09b07a61216dd66106844fe384b5b0e9a7ddf83055d",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff4244904244045560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff424490424404",
"gasLimit" : "0xd9acdb",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x6ac01f3a"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x3158e7cd",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507f0000000000000000000000000000000000000000000000000000000000000000557f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff6750a3190486f0",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xc350"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xadea",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3760a6a77",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "f90c0fced4f364c533d8fd2639665219dc2e076e94d3dc3a04a25691a21bad31",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507f0000000000000000000000000000000000000000000000000000000000000000557f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff6750a3190486f0",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507f0000000000000000000000000000000000000000000000000000000000000000557f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff6750a3190486f0",
"gasLimit" : "0x1d183aaa",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x3158e7cd"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x61b9caa3",
"code" : "0x7f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000000000000000000000000000000000000000c3507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3505a7f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c350356436f0f119011a5560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x010000000000000000000000000000000000000000"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xcb07",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b345a96a84",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "e51ce43e7e084ded8ccf5e2c26035e90477a23c285f88bc552f521cfa200a101",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000000000000000000000000000000000000000c3507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3505a7f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c350356436f0f119011a5560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000000000000000000000000000000000000000c3507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3505a7f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c350356436f0f119011a",
"gasLimit" : "0x0d2fbf7d",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x61b9caa3"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x7e83fa74",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff14447ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b60005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xbf14",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b328df46a6",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "0cb659a91d23f40b4dfc08874dec658bc1bea4e27f6e717f0c2a7433c50bc8db",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff14447ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b60005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff14447ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b",
"gasLimit" : "0x0169ec4f",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x7e83fa74"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x25d01724",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff60005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xffffffffffffffffffffffffffffffffffffffff"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xbb57",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b381932db3",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "b71834e308232e0df4f8c88ed977640e19418e5e746f40add2de2dfd73ff1fe6",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff60005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff",
"gasLimit" : "0x396e40ab",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x25d01724"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x4cd4dc30",
"code" : "0x7f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x010000000000000000000000000000000000000000"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xbc8e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b35a8e6770",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "b098726ac5c2f7001c66db547c70b9ba7a42db05d839fb969f114818d9db1544",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000055",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000100000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000",
"gasLimit" : "0x172b6eeb",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x4cd4dc30"
}
}
}

View File

@@ -0,0 +1,73 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x245d7b33",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000100000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000001631075803033455560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x10758030",
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x0104da",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b383058021",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "83db91420b09afa49ca7cbe4a31449b0c8167ac17f4e615fa306f66fc8ead236",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000100000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000001631075803033455560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000100000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000163107580303345",
"gasLimit" : "0x6bb4cd54",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x245d7b33"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x5eaa223f",
"code" : "0x7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe427f000000000000000000000000000000000000000000000000000000000000c3504160005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x945304eb96065b2a98b57a48a06ae28d285a71b5"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xc215",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b348b91bda",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "5c006cbf978674807a6d4fc7926703add138cde08ee901131e832947ae1fd002",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe427f000000000000000000000000000000000000000000000000000000000000c3504160005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe427f000000000000000000000000000000000000000000000000000000000000c35041",
"gasLimit" : "0x1819c789",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x5eaa223f"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x2f7e230c",
"code" : "0x7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000000000000000000000000000000000000000c3507f00000000000000000000000000000000000000000000000000000000000000004560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xb656",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b377e526cc",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "89a31aea399e1cdfed3e8749b53b15f3045d5243a20ef62d26bc7c1722a18e22",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000000000000000000000000000000000000000c3507f00000000000000000000000000000000000000000000000000000000000000004560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000000000000000000000000000000000000000000045",
"gasLimit" : "0x5fa770e4",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x2f7e230c"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x50f09196",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b5357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3507f0000000000000000000000010000000000000000000000000000000000000000033a8060005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x01"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xc1ab",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b35672aced",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "03a9f209c265fd52289ca0df99196210a90a9555aee156d1cad47689c9b19387",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b5357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3507f0000000000000000000000010000000000000000000000000000000000000000033a8060005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b5357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3507f0000000000000000000000010000000000000000000000000000000000000000033a80",
"gasLimit" : "0x3ccd2021",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x50f09196"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x49195164",
"code" : "0x7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff817f00000000000000000000000100000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4286687859f383797187945560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x7859f3837971879455"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xbe44",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b35e49f086",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "c1218271a72dee1fa981d6d570f9e767b3079e85343cf6fd36bda073066bedd9",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff817f00000000000000000000000100000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4286687859f383797187945560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000100000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000c3507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff817f00000000000000000000000100000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4286687859f38379718794",
"gasLimit" : "0x4ac6aafd",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x49195164"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x1c91b9d0",
"code" : "0x7f000000000000000000000000000000000000000000000000000000000000c350357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5a605560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x55"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xc6a4",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b38ad17fba",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "caf56509c0e62bd8cbe90daa3c0d0ce026a4482f60fa4d88846d94b6b9001b5f",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f000000000000000000000000000000000000000000000000000000000000c350357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5a605560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f000000000000000000000000000000000000000000000000000000000000c350357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5a60",
"gasLimit" : "0x6ac3e368",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x1c91b9d0"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x4f622410",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000100000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff427f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b54355",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x945304eb96065b2a98b57a48a06ae28d285a71b5"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xb00c",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b358012c12",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "6e8bad0fac19f0195ab782f8969aaea38cb092e5dc7574de8d317acdb90cf79f",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000100000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff427f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b54355",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000100000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff427f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b543",
"gasLimit" : "0x27db6af5",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x4f622410"
}
}
}

View File

@@ -0,0 +1,73 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x13da3c95",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000000000000000000000000000000000000000c3507f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000000000000000000000000000000000000000c350670b9af27e9a6468a15560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xc350",
"0x0b9af27e9a6468a1" : "0xc350"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x01019e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b39388c1fb",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "a5e94cc93d41d4d39cdebda112600410dd3dae8761245e03250101aa878201e6",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000000000000000000000000000000000000000c3507f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000000000000000000000000000000000000000c350670b9af27e9a6468a15560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000000000000000000000000000000000000000c3507f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000000000000000000000000000000000000000c350670b9af27e9a6468a1",
"gasLimit" : "0x31803093",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x13da3c95"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x409ceff3",
"code" : "0x33447f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff434461334515455560005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x051d6a3cd647"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xcbf7",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b366c64444",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "3e8b2d40bcb72a4f7e20754b41def5098d6925492201aab4f911573db4d80635",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x33447f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff434461334515455560005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x33447f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff43446133451545",
"gasLimit" : "0x44016d98",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x409ceff3"
}
}
}

View File

@@ -0,0 +1,72 @@
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x383bfc76",
"code" : "0x7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe435060005155",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0xc223",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b36f274195",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "e2b29a1bf24efbe0a7ccafaa9333ac2711ff15e5d0ce472adb6cc9393ee75a39",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x00",
"code" : "0x7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe435060005155",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b57f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000000000000000000000000000000000000000000017f00000000000000000000000100000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe4350",
"gasLimit" : "0x44d7bc49",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x383bfc76"
}
}
}

View File

@@ -17,7 +17,7 @@
"code" : "0x600040600055600540600155600440600255",
"nonce" : "0x00",
"storage" : {
"0x" : "0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
"0x00" : "0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
"0x02" : "0x13600b294191fc92924bb3ce4b969c1e7e2bab8f4c93c3fc6d0a51733df3c060"
}
},
@@ -81,7 +81,7 @@
"code" : "0x60014060005560024060015561010040600255",
"nonce" : "0x00",
"storage" : {
"0x" : "0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
"0x00" : "0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
"0x01" : "0xad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
"0x02" : "0x6ca54da2c4784ea43fd88b3402de07ae4bced597cbb19f323b7595857a6720ae"
}

View File

@@ -38,7 +38,7 @@
"code" : "0x600160005401600055600060006000600060005473bbbf5374fce5edbc8e2a8697c15331677e6ebf0b650ffffffffffff1600155",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
}
},
@@ -115,7 +115,7 @@
"code" : "0x6001600054016000556000600060006000600073bbbf5374fce5edbc8e2a8697c15331677e6ebf0b610401600054046001036127105a0302f16001556103e860005402600101600255",
"nonce" : "0x00",
"storage" : {
"0x" : "0x0401",
"0x00" : "0x0401",
"0x01" : "0x01",
"0x02" : "0x0fa3e9"
}
@@ -194,7 +194,7 @@
"code" : "0x6001600054016000556000600060006000600073bbbf5374fce5edbc8e2a8697c15331677e6ebf0b620186a060005402600101f16001556103e860005402600101600255",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01",
"0x00" : "0x01",
"0x02" : "0x03e9"
}
}
@@ -272,7 +272,7 @@
"code" : "0x600160005401600055600060006000600060005473bbbf5374fce5edbc8e2a8697c15331677e6ebf0b650ffffffffffff2600155",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
}
},
@@ -349,7 +349,7 @@
"code" : "0x6001600054016000556000600060006000600073bbbf5374fce5edbc8e2a8697c15331677e6ebf0b610401600054046001036127105a0302f26001556103e860005402600101600255",
"nonce" : "0x00",
"storage" : {
"0x" : "0x0401",
"0x00" : "0x0401",
"0x01" : "0x01",
"0x02" : "0x0fa3e9"
}
@@ -428,7 +428,7 @@
"code" : "0x6001600054016000556000600060006000600073bbbf5374fce5edbc8e2a8697c15331677e6ebf0b620186a060005402600101f26001556103e860005402600101600255",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01",
"0x00" : "0x01",
"0x02" : "0x03e9"
}
}
@@ -713,7 +713,7 @@
"code" : "0x60016000600060006000601773945304eb96065b2a98b57a48a06ae28d285a71b5612710f101600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -949,7 +949,7 @@
"code" : "0x60003560e060020a9004806343d726d61461004257806391b7f5ed14610050578063d686f9ee14610061578063f5bade661461006f578063fcfff16f1461008057005b61004a6101de565b60006000f35b61005b6004356100bf565b60006000f35b610069610304565b60006000f35b61007a60043561008e565b60006000f35b6100886100f0565b60006000f35b600054600160a060020a031633600160a060020a031614156100af576100b4565b6100bc565b806001819055505b50565b600054600160a060020a031633600160a060020a031614156100e0576100e5565b6100ed565b806002819055505b50565b600054600160a060020a031633600160a060020a031614806101255750600354600160a060020a031633600160a060020a0316145b61012e57610161565b60016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a16101dc565b60045460011480610173575060015434105b6101b85760016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a142600581905550336003819055506101db565b33600160a060020a03166000346000600060006000848787f16101d757005b5050505b5b565b60006004546000146101ef576101f4565b610301565b600054600160a060020a031633600160a060020a031614801561022c5750600054600160a060020a0316600354600160a060020a0316145b61023557610242565b6000600481905550610301565b600354600160a060020a031633600160a060020a03161461026257610300565b600554420360025402905060015481116102c757600354600160a060020a0316600082600154036000600060006000848787f161029b57005b505050600054600160a060020a03166000826000600060006000848787f16102bf57005b5050506102ee565b600054600160a060020a031660006001546000600060006000848787f16102ea57005b5050505b60006004819055506000546003819055505b5b50565b6000600054600160a060020a031633600160a060020a031614156103275761032c565b61037e565b600554420360025402905060015481116103455761037d565b600054600160a060020a031660006001546000600060006000848787f161036857005b50505060006004819055506000546003819055505b5b5056",
"nonce" : "0x00",
"storage" : {
"0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x00" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x01" : "0x42",
"0x02" : "0x23",
"0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
@@ -971,7 +971,7 @@
"code" : "0x60003560e060020a9004806343d726d61461004257806391b7f5ed14610050578063d686f9ee14610061578063f5bade661461006f578063fcfff16f1461008057005b61004a6101de565b60006000f35b61005b6004356100bf565b60006000f35b610069610304565b60006000f35b61007a60043561008e565b60006000f35b6100886100f0565b60006000f35b600054600160a060020a031633600160a060020a031614156100af576100b4565b6100bc565b806001819055505b50565b600054600160a060020a031633600160a060020a031614156100e0576100e5565b6100ed565b806002819055505b50565b600054600160a060020a031633600160a060020a031614806101255750600354600160a060020a031633600160a060020a0316145b61012e57610161565b60016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a16101dc565b60045460011480610173575060015434105b6101b85760016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a142600581905550336003819055506101db565b33600160a060020a03166000346000600060006000848787f16101d757005b5050505b5b565b60006004546000146101ef576101f4565b610301565b600054600160a060020a031633600160a060020a031614801561022c5750600054600160a060020a0316600354600160a060020a0316145b61023557610242565b6000600481905550610301565b600354600160a060020a031633600160a060020a03161461026257610300565b600554420360025402905060015481116102c757600354600160a060020a0316600082600154036000600060006000848787f161029b57005b505050600054600160a060020a03166000826000600060006000848787f16102bf57005b5050506102ee565b600054600160a060020a031660006001546000600060006000848787f16102ea57005b5050505b60006004819055506000546003819055505b5b50565b6000600054600160a060020a031633600160a060020a031614156103275761032c565b61037e565b600554420360025402905060015481116103455761037d565b600054600160a060020a031660006001546000600060006000848787f161036857005b50505060006004819055506000546003819055505b5b5056",
"nonce" : "0x00",
"storage" : {
"0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x00" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x01" : "0x42",
"0x02" : "0x23",
"0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",

View File

@@ -17,7 +17,7 @@
"code" : "0x6001600101600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x02"
"0x00" : "0x02"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {

View File

@@ -17,7 +17,7 @@
"code" : "0x74600c60005566602060406000f060205260076039f36000526015600b6001f0600055600060006000600060006000546103e8f1",
"nonce" : "0x01",
"storage" : {
"0x" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
"0x00" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -39,7 +39,7 @@
"code" : "0x602060406000f0",
"nonce" : "0x00",
"storage" : {
"0x" : "0x0c"
"0x00" : "0x0c"
}
}
},
@@ -219,7 +219,7 @@
"code" : "0x74600c60005566602060406000f060205260076039f36000526015600b6001f06000556000600060006000600c6000546000f1",
"nonce" : "0x01",
"storage" : {
"0x" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
"0x00" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -241,7 +241,7 @@
"code" : "0x602060406000f0",
"nonce" : "0x00",
"storage" : {
"0x" : "0x0c"
"0x00" : "0x0c"
}
}
},
@@ -290,7 +290,7 @@
"code" : "0x74600c60005566602060406000f060205260076039f36000526015600b6001f06000556000600060006000600160005461c350f1",
"nonce" : "0x01",
"storage" : {
"0x" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
"0x00" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -319,7 +319,7 @@
"code" : "0x602060406000f0",
"nonce" : "0x01",
"storage" : {
"0x" : "0x0c"
"0x00" : "0x0c"
}
}
},
@@ -396,7 +396,7 @@
"code" : "0x",
"nonce" : "0x01",
"storage" : {
"0x" : "0x0c"
"0x00" : "0x0c"
}
}
},
@@ -707,7 +707,7 @@
"code" : "0x6001601f6001601e600073b94f5374fce5edbc8e2a8697c15331677e6ebf0b6107d0f1506000516000556002601ef3",
"nonce" : "0x00",
"storage" : {
"0x" : "0x15"
"0x00" : "0x15"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -784,7 +784,7 @@
"code" : "0x60156000526020602060206000600073b94f5374fce5edbc8e2a8697c15331677e6ebf0b611b58f15060005160005560205160015560406000f3",
"nonce" : "0x00",
"storage" : {
"0x" : "0x15",
"0x00" : "0x15",
"0x01" : "0x3f"
}
},

View File

@@ -24,7 +24,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -260,7 +260,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -344,7 +344,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -428,7 +428,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -512,7 +512,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -597,7 +597,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -682,7 +682,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -767,7 +767,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -1004,7 +1004,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -1089,7 +1089,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -1174,7 +1174,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -1259,7 +1259,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -1345,7 +1345,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -1431,7 +1431,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -1517,7 +1517,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -1755,7 +1755,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -1841,7 +1841,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -1927,7 +1927,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -2013,7 +2013,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -2100,7 +2100,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -2187,7 +2187,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -2274,7 +2274,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -2361,7 +2361,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -2600,7 +2600,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -2687,7 +2687,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -2774,7 +2774,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -2861,7 +2861,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -2938,7 +2938,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -3026,7 +3026,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -3103,7 +3103,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -3191,7 +3191,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -3431,7 +3431,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -3519,7 +3519,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -3607,7 +3607,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -3695,7 +3695,7 @@
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {

View File

@@ -2,10 +2,10 @@
"FillStack" : {
"env" : {
"currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "5623894562375",
"currentGasLimit" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
"currentNumber" : "0",
"currentTimestamp" : "1",
"currentDifficulty" : "0x051d6a3cd647",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
@@ -13,23 +13,23 @@
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0",
"balance" : "0x00",
"code" : "0x5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe457f00000000000000000000000100000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000000000000000000000000000000000000000c3504357155320803a975560005155",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "3141638",
"balance" : "0x2ff006",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "999999999996858408",
"balance" : "0x0de0b6b3a7341028",
"code" : "0x",
"nonce" : "1",
"nonce" : "0x01",
"storage" : {
}
}
@@ -37,44 +37,44 @@
"postStateRoot" : "fce3d23dbb978bf49908221f831b52381c8a13cc354cf20130f659c481515e83",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0",
"balance" : "0x00",
"code" : "0x5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe457f00000000000000000000000100000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000000000000000000000000000000000000000c3504357155320803a975560005155",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "46",
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "1000000000000000000",
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe457f00000000000000000000000100000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000000000000000000000000000000000000000c3504357155320803a97",
"gasLimit" : "3141592",
"gasPrice" : "1",
"nonce" : "0",
"gasLimit" : "0x2fefd8",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "264050067"
"value" : "0x0fbd1593"
}
},
"mload32bitBound" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "17592320524892",
"currentNumber" : "0",
"currentTimestamp" : "1",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x10000804025c",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
@@ -82,23 +82,23 @@
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"balance" : "0x0de0b6b3a7640000",
"code" : "0x64010000000051600155",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
"balance" : "17592320524892",
"balance" : "0x10000804025c",
"code" : "0x",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "158330884724028",
"balance" : "0x90004824153c",
"code" : "0x",
"nonce" : "1",
"nonce" : "0x01",
"storage" : {
}
}
@@ -106,37 +106,37 @@
"postStateRoot" : "8a47d8a8689889820bd4273dd667ece01f288b091ce244c671a6394dc4109f1f",
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"balance" : "0x0de0b6b3a7640000",
"code" : "0x64010000000051600155",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "175923205248920",
"balance" : "0xa00050281798",
"code" : "0x",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "",
"gasLimit" : "17592320524892",
"gasPrice" : "1",
"nonce" : "0",
"gasLimit" : "0x10000804025c",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"value" : "10"
"value" : "0x0a"
}
},
"mload32bitBound2" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "37791080412587",
"currentNumber" : "0",
"currentTimestamp" : "1",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x225eebec75ab",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
@@ -144,23 +144,23 @@
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"balance" : "0x0de0b6b3a7640000",
"code" : "0x64017735940051600155",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
"balance" : "37791080412587",
"balance" : "0x225eebec75ab",
"code" : "0x",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "340119723807263",
"balance" : "0x0135564b51921f",
"code" : "0x",
"nonce" : "1",
"nonce" : "0x01",
"storage" : {
}
}
@@ -168,37 +168,37 @@
"postStateRoot" : "6965350d67785b430326cd01f5c523976fa9361740a6f09f2f8b1f1f7940b6ec",
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"balance" : "0x0de0b6b3a7640000",
"code" : "0x64017735940051600155",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "377910804219850",
"balance" : "0x0157b5373e07ca",
"code" : "0x",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "",
"gasLimit" : "37791080412587",
"gasPrice" : "1",
"nonce" : "0",
"gasLimit" : "0x225eebec75ab",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"value" : "10"
"value" : "0x0a"
}
},
"mload32bitBound_Msize" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "175923205248920000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x027101391c9c29c0",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
@@ -206,24 +206,24 @@
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"balance" : "0x0de0b6b3a7640000",
"code" : "0x600163ffffffff5259600055",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
"0x" : "0x0100000020"
"0x00" : "0x0100000020"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
"balance" : "35184775307321",
"balance" : "0x20001808a039",
"code" : "0x",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "1759196867713892679",
"balance" : "0x1869ec3b06110147",
"code" : "0x",
"nonce" : "1",
"nonce" : "0x01",
"storage" : {
}
}
@@ -231,37 +231,37 @@
"postStateRoot" : "f5cba7b1b92529ff627b7c99277dce9461d3b4cf23b030d82a3c67411d22315d",
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"balance" : "0x0de0b6b3a7640000",
"code" : "0x600163ffffffff5259600055",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "1759232052489200000",
"balance" : "0x186a0c3b1e19a180",
"code" : "0x",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "",
"gasLimit" : "175923205248920000",
"gasPrice" : "1",
"nonce" : "0",
"gasLimit" : "0x027101391c9c29c0",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"value" : "0"
"value" : "0x00"
}
},
"mload32bitBound_return" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "175923205248920000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x027101391c9c29c0",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
@@ -269,23 +269,23 @@
"out" : "0x00",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"balance" : "0x0de0b6b3a7640000",
"code" : "0x6401000000016000f3",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
"balance" : "35184775287313",
"balance" : "0x200018085211",
"code" : "0x",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "1759196867713912687",
"balance" : "0x1869ec3b06114f6f",
"code" : "0x",
"nonce" : "1",
"nonce" : "0x01",
"storage" : {
}
}
@@ -293,37 +293,37 @@
"postStateRoot" : "8745f6bdec4290420747b8c024382c6ed14e09f4a11718bdc1f0f99e4d04607b",
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"balance" : "0x0de0b6b3a7640000",
"code" : "0x6401000000016000f3",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "1759232052489200000",
"balance" : "0x186a0c3b1e19a180",
"code" : "0x",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "",
"gasLimit" : "175923205248920000",
"gasPrice" : "1",
"nonce" : "0",
"gasLimit" : "0x027101391c9c29c0",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"value" : "0"
"value" : "0x00"
}
},
"mload32bitBound_return2" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "175923205248920000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x027101391c9c29c0",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
@@ -331,23 +331,23 @@
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60016000526401000000006000f3",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
"balance" : "35184774763031",
"balance" : "0x200018005217",
"code" : "0x",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "1759196867714436969",
"balance" : "0x1869ec3b06194f69",
"code" : "0x",
"nonce" : "1",
"nonce" : "0x01",
"storage" : {
}
}
@@ -355,28 +355,28 @@
"postStateRoot" : "e6c6c5b997cf7ecbc653c920a5b42d1ddd9f9ca2df2c68fd47059df2a3309b14",
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60016000526401000000006000f3",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "1759232052489200000",
"balance" : "0x186a0c3b1e19a180",
"code" : "0x",
"nonce" : "0",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "",
"gasLimit" : "175923205248920000",
"gasPrice" : "1",
"nonce" : "0",
"gasLimit" : "0x027101391c9c29c0",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"value" : "0"
"value" : "0x00"
}
}
}

View File

@@ -451,7 +451,7 @@
"code" : "0x602a60005359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x20"
"0x00" : "0x20"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -514,7 +514,7 @@
"code" : "0x602a601e5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x20"
"0x00" : "0x20"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -577,7 +577,7 @@
"code" : "0x602a601f5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x20"
"0x00" : "0x20"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -640,7 +640,7 @@
"code" : "0x602a617ce052617ce05160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d00",
"0x00" : "0x7d00",
"0x01" : "0x2a"
}
},
@@ -704,7 +704,7 @@
"code" : "0x602a617ce152617ce15160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d20",
"0x00" : "0x7d20",
"0x01" : "0x2a"
}
},
@@ -768,7 +768,7 @@
"code" : "0x602a617cff52617cff5160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d20",
"0x00" : "0x7d20",
"0x01" : "0x2a"
}
},
@@ -832,7 +832,7 @@
"code" : "0x602a617d0052617d005160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d20",
"0x00" : "0x7d20",
"0x01" : "0x2a"
}
},
@@ -896,7 +896,7 @@
"code" : "0x602a617d0152617d015160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d40",
"0x00" : "0x7d40",
"0x01" : "0x2a"
}
},
@@ -960,7 +960,7 @@
"code" : "0x602a617cdf52617cdf5160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d00",
"0x00" : "0x7d00",
"0x01" : "0x2a"
}
},
@@ -1024,7 +1024,7 @@
"code" : "0x602a617cc152617cc15160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d00",
"0x00" : "0x7d00",
"0x01" : "0x2a"
}
},
@@ -1088,7 +1088,7 @@
"code" : "0x602a617cc052617cc05160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7ce0",
"0x00" : "0x7ce0",
"0x01" : "0x2a"
}
},
@@ -1152,7 +1152,7 @@
"code" : "0x602a617cbf52617cbf5160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7ce0",
"0x00" : "0x7ce0",
"0x01" : "0x2a"
}
},
@@ -1216,7 +1216,7 @@
"code" : "0x602a617cff5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d00"
"0x00" : "0x7d00"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1279,7 +1279,7 @@
"code" : "0x602a617d005359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d20"
"0x00" : "0x7d20"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1342,7 +1342,7 @@
"code" : "0x602a617d1e5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d20"
"0x00" : "0x7d20"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1405,7 +1405,7 @@
"code" : "0x602a617d1f5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d20"
"0x00" : "0x7d20"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1468,7 +1468,7 @@
"code" : "0x602a617d205359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d40"
"0x00" : "0x7d40"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1531,7 +1531,7 @@
"code" : "0x602a617cfe5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d00"
"0x00" : "0x7d00"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1594,7 +1594,7 @@
"code" : "0x602a617ce05359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7d00"
"0x00" : "0x7d00"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1657,7 +1657,7 @@
"code" : "0x602a617cdf5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7ce0"
"0x00" : "0x7ce0"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1720,7 +1720,7 @@
"code" : "0x602a617cde5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7ce0"
"0x00" : "0x7ce0"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1783,7 +1783,7 @@
"code" : "0x602a60205359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x40"
"0x00" : "0x40"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1846,7 +1846,7 @@
"code" : "0x602a61f9e05261f9e05160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa00",
"0x00" : "0xfa00",
"0x01" : "0x2a"
}
},
@@ -1910,7 +1910,7 @@
"code" : "0x602a61f9e15261f9e15160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa20",
"0x00" : "0xfa20",
"0x01" : "0x2a"
}
},
@@ -1974,7 +1974,7 @@
"code" : "0x602a61f9ff5261f9ff5160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa20",
"0x00" : "0xfa20",
"0x01" : "0x2a"
}
},
@@ -2038,7 +2038,7 @@
"code" : "0x602a61fa005261fa005160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa20",
"0x00" : "0xfa20",
"0x01" : "0x2a"
}
},
@@ -2102,7 +2102,7 @@
"code" : "0x602a61fa015261fa015160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa40",
"0x00" : "0xfa40",
"0x01" : "0x2a"
}
},
@@ -2166,7 +2166,7 @@
"code" : "0x602a61f9df5261f9df5160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa00",
"0x00" : "0xfa00",
"0x01" : "0x2a"
}
},
@@ -2230,7 +2230,7 @@
"code" : "0x602a61f9c15261f9c15160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa00",
"0x00" : "0xfa00",
"0x01" : "0x2a"
}
},
@@ -2294,7 +2294,7 @@
"code" : "0x602a61f9c05261f9c05160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xf9e0",
"0x00" : "0xf9e0",
"0x01" : "0x2a"
}
},
@@ -2358,7 +2358,7 @@
"code" : "0x602a61f9bf5261f9bf5160015559600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xf9e0",
"0x00" : "0xf9e0",
"0x01" : "0x2a"
}
},
@@ -2422,7 +2422,7 @@
"code" : "0x602a61f9ff5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa00"
"0x00" : "0xfa00"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2485,7 +2485,7 @@
"code" : "0x602a61fa005359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa20"
"0x00" : "0xfa20"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2548,7 +2548,7 @@
"code" : "0x602a61fa1e5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa20"
"0x00" : "0xfa20"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2611,7 +2611,7 @@
"code" : "0x602a61fa1f5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa20"
"0x00" : "0xfa20"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2674,7 +2674,7 @@
"code" : "0x602a61fa205359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa40"
"0x00" : "0xfa40"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2737,7 +2737,7 @@
"code" : "0x602a61f9fe5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa00"
"0x00" : "0xfa00"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2800,7 +2800,7 @@
"code" : "0x602a61f9e05359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xfa00"
"0x00" : "0xfa00"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2863,7 +2863,7 @@
"code" : "0x602a61f9df5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xf9e0"
"0x00" : "0xf9e0"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2926,7 +2926,7 @@
"code" : "0x602a61f9de5359600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xf9e0"
"0x00" : "0xf9e0"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {

View File

@@ -24,7 +24,7 @@
"code" : "0x7f18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c600052601c6020527f73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f6040527feeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549606052602060806080600060006001620493e0f160025560a060020a608051066000556000543214600155",
"nonce" : "0x00",
"storage" : {
"0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x00" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x01" : "0x01",
"0x02" : "0x01"
}
@@ -290,7 +290,7 @@
"code" : "0x7f18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c600052601c6020527f73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f6040527feeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549606052602060806080600060006001610bb8f1600255608051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x00" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x02" : "0x01"
}
},
@@ -361,7 +361,7 @@
"code" : "0x7f18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c600052601c6020527f73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f6040527feeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549606052602060806080600060006001610bb8f160025560a060020a608051066000556000543214600155",
"nonce" : "0x00",
"storage" : {
"0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x00" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x01" : "0x01",
"0x02" : "0x01"
}
@@ -433,7 +433,7 @@
"code" : "0x7f18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c600052601c6020527f73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f6040527feeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549606052602060406080600060006001620493e0f160025560a060020a604051066000556000543214600155",
"nonce" : "0x00",
"storage" : {
"0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x00" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x01" : "0x01",
"0x02" : "0x01"
}
@@ -645,7 +645,7 @@
"code" : "0x7f2f380a2dea7e778d81affc2443403b8fe4644db442ae4862ff5bb3732829cdb9600052601b6020527f6b65ccb0558806e9b097f27a396d08f964e37b8b7af6ceeb516ff86739fbea0a6040527f37cbc8d883e129a4b1ef9d5f1df53c4f21a3ef147cf2a50a4ede0eb06ce092d4606052602060806080600060006001620186a0f160025560a060020a608051066000556000543214600155",
"nonce" : "0x00",
"storage" : {
"0x" : "0xe4319f4b631c6d0fcfc84045dbcb676865fe5e13",
"0x00" : "0xe4319f4b631c6d0fcfc84045dbcb676865fe5e13",
"0x02" : "0x01"
}
},
@@ -709,7 +709,7 @@
"code" : "0x600160005260206000602060006000600360fff1600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -779,7 +779,7 @@
"code" : "0x602060006000600060006003610258f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x9c1185a5c5e9fc54612808977ee8f548b2258d31",
"0x00" : "0x9c1185a5c5e9fc54612808977ee8f548b2258d31",
"0x02" : "0x01"
}
},
@@ -905,7 +905,7 @@
"code" : "0x64f34578907f600052602060006025600060006003610258f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xf34578907f"
"0x00" : "0xf34578907f"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -968,7 +968,7 @@
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000526020600060206000600060036078f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
"0x00" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1031,7 +1031,7 @@
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000526020600060206000600060036077f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
"0x00" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1094,7 +1094,7 @@
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60005260206000620f4240600060006003610258f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
"0x00" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1164,7 +1164,7 @@
"code" : "0x600160005260206000602060006000600260fff1600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xec4916dd28fc4c10d78e287ca5d9cc51ee1ae73cbfde08c6b37324cbfaac8bc5"
"0x00" : "0xec4916dd28fc4c10d78e287ca5d9cc51ee1ae73cbfde08c6b37324cbfaac8bc5"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1234,7 +1234,7 @@
"code" : "0x6020600060006000600060026101f4f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"0x00" : "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"0x02" : "0x01"
}
},
@@ -1305,7 +1305,7 @@
"code" : "0x60206000600060006013600262030d40f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"0x00" : "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"0x02" : "0x01"
}
},
@@ -1376,7 +1376,7 @@
"code" : "0x64f34578907f6005526020600060256000600060026101f4f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xcb39b3bde22925b2f931111130c774761d8895e0e08437c9b396c1e97d10f34d",
"0x00" : "0xcb39b3bde22925b2f931111130c774761d8895e0e08437c9b396c1e97d10f34d",
"0x02" : "0x01"
}
},
@@ -1447,7 +1447,7 @@
"code" : "0x64f34578907f6000526020600060256000600060026101f4f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x7392925565d67be8e9620aacbcfaecd8cb6ec58d709d25da9eccf1d08a41ce35",
"0x00" : "0x7392925565d67be8e9620aacbcfaecd8cb6ec58d709d25da9eccf1d08a41ce35",
"0x02" : "0x01"
}
},
@@ -1518,7 +1518,7 @@
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000526020600060206000600060026064f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xaf9613760f72635fbdb44a5a0a63c39f12af30f950a6ee5c971be188e89c4051",
"0x00" : "0xaf9613760f72635fbdb44a5a0a63c39f12af30f950a6ee5c971be188e89c4051",
"0x02" : "0x01"
}
},
@@ -1589,7 +1589,7 @@
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000526020600060206000600060026063f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xaf9613760f72635fbdb44a5a0a63c39f12af30f950a6ee5c971be188e89c4051",
"0x00" : "0xaf9613760f72635fbdb44a5a0a63c39f12af30f950a6ee5c971be188e89c4051",
"0x02" : "0x01"
}
},
@@ -1653,7 +1653,7 @@
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60005260206000620f4240600060006002610258f1600255600051600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
"0x00" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {

File diff suppressed because one or more lines are too long

View File

@@ -373,7 +373,7 @@
"code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa61157cf1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01",
"0x00" : "0x01",
"0x01" : "0x01"
}
},
@@ -613,7 +613,7 @@
"code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01",
"0x00" : "0x01",
"0x01" : "0x01"
}
},
@@ -685,7 +685,7 @@
"code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01",
"0x00" : "0x01",
"0x01" : "0x01"
}
},
@@ -758,7 +758,7 @@
"code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f16000556000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f1",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01",
"0x00" : "0x01",
"0x01" : "0x01"
}
},

View File

@@ -17,7 +17,7 @@
"code" : "0x60003560e060020a90048063c040622614601557005b601b6021565b60006000f35b61014f60008190555056",
"nonce" : "0x00",
"storage" : {
"0x" : "0x014f"
"0x00" : "0x014f"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -142,7 +142,7 @@
"code" : "0x60003560e060020a9004806330debb4214610021578063c04062261461003257005b61002c6004356100c7565b60006000f35b61003a610044565b8060005260206000f35b60006000600160008190555073095e7baea6a6c7c4c2dfeb977efac326af552d87600181905550606a6100d2600039606a60006000f0905080600160a060020a03166319ab453c600060008260e060020a026000526004600154600160a060020a03168152602001600060008660325a03f16100bc57005b505060005491505090565b80600081905550505600605e80600c6000396000f30060003560e060020a9004806319ab453c14601557005b601e6004356024565b60006000f35b80600160a060020a03166330debb42600060008260e060020a02600052600460e18152602001600060008660325a03f1605957005b50505056",
"nonce" : "0x01",
"storage" : {
"0x" : "0xe1",
"0x00" : "0xe1",
"0x01" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87"
}
},
@@ -406,7 +406,7 @@
"code" : "0x60003560e060020a90048063820b13f614610021578063a444f5e91461003257005b61002c600435610093565b60006000f35b61003d600435610043565b60006000f35b600073095e7baea6a6c7c4c2dfeb977efac326af552d8760008190555081600181905550606b6101ad600039606b600054600160a060020a0316815260200182815260200160006000f090505050565b600060c86100e560003960c8600054600160a060020a0316815260200182815260200160006000f0905080600160a060020a0316600060026000600060006000848787f16100dd57005b50505050505600604060c860043960045160245160006001820391508160008190555060008211602657604c565b606b605d600039606b83600160a060020a0316815260200182815260200160006000f090505b505050600180605c6000396000f300006040606b6004396004516024516001810390508060008190555060008111602457605b565b81600160a060020a031663820b13f6600060008260e060020a026000526004858152602001600060008660325a03f1605857005b50505b5050600180606a6000396000f300006040606b6004396004516024516001810390508060008190555060008111602457605b565b81600160a060020a031663820b13f6600060008260e060020a026000526004858152602001600060008660325a03f1605857005b50505b5050600180606a6000396000f30000",
"nonce" : "0x03",
"storage" : {
"0x" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87",
"0x00" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87",
"0x01" : "0x04"
}
},
@@ -436,7 +436,7 @@
"code" : "0x00",
"nonce" : "0x01",
"storage" : {
"0x" : "0x02"
"0x00" : "0x02"
}
},
"c506eeab8810e0b592686a218b889284e45b2c35" : {
@@ -444,7 +444,7 @@
"code" : "0x00",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"d2571607e241ecf590ed94b12d87c94babe36db6" : {
@@ -452,7 +452,7 @@
"code" : "0x00",
"nonce" : "0x00",
"storage" : {
"0x" : "0x03"
"0x00" : "0x03"
}
}
},
@@ -501,7 +501,7 @@
"code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463c04062268114610039578063e97384dc1461004b57005b61004161005d565b8060005260206000f35b61005361008c565b8060005260206000f35b600061006761008c565b600060006101000a81548160ff0219169083021790555060ff60016000540416905090565b6001732adc25665018aa1fe0e6bc666dac8fc2697ff9ba73ffffffffffffffffffffffffffffffffffffffff411614156100c5576100cd565b5060006101c7565b446302b8feb014156100de576100e6565b5060006101c7565b45683635c9adc5dea0000014156100fc57610104565b5060006101c7565b43607814156101125761011a565b5060006101c7565b5a503373ffffffffffffffffffffffffffffffffffffffff1673a94f5374fce5edbc8e2a8697c15331677e6ebf0b14156101535761015b565b5060006101c7565b346064141561016957610171565b5060006101c7565b3a6001141561017f57610187565b5060006101c7565b3273ffffffffffffffffffffffffffffffffffffffff1673a94f5374fce5edbc8e2a8697c15331677e6ebf0b14156101be576101c6565b5060006101c7565b5b9056",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -564,7 +564,7 @@
"code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463c04062268114610039578063ed973fe91461004b57005b6100416100ea565b8060005260206000f35b61005361005d565b8060005260206000f35b60006000608161011a600039608160006000f0905073ffffffffffffffffffffffffffffffffffffffff811663b9c3d0a5602060007fb9c3d0a50000000000000000000000000000000000000000000000000000000081526004600060008660325a03f16100c757005b505060005160e1146100d8576100e1565b600191506100e6565b600091505b5090565b60006100f461005d565b600060006101000a81548160ff0219169083021790555060ff600160005404169050905600607580600c6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350462f55d9d81146036578063b9c3d0a514604557005b603f6004356055565b60006000f35b604b6070565b8060005260206000f35b8073ffffffffffffffffffffffffffffffffffffffff16ff50565b60e19056",
"nonce" : "0x01",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -634,7 +634,7 @@
"code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463a60eedda8114610039578063c04062261461004b57005b61004161005d565b8060005260206000f35b61005361015a565b8060005260206000f35b60006000608161018a600039608160006000f0905073ffffffffffffffffffffffffffffffffffffffff811662f55d9d6000807ef55d9d00000000000000000000000000000000000000000000000000000000825260044173ffffffffffffffffffffffffffffffffffffffff168152602001600060008660325a03f16100e057005b505073ffffffffffffffffffffffffffffffffffffffff811663b9c3d0a5602060007fb9c3d0a50000000000000000000000000000000000000000000000000000000081526004600060008660325a03f161013757005b505060005160e11461014857610151565b60019150610156565b600091505b5090565b600061016461005d565b600060006101000a81548160ff0219169083021790555060ff600160005404169050905600607580600c6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350462f55d9d81146036578063b9c3d0a514604557005b603f600435605a565b60006000f35b604b6055565b8060005260206000f35b60e190565b8073ffffffffffffffffffffffffffffffffffffffff16ff5056",
"nonce" : "0x01",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -759,7 +759,7 @@
"code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463380e439681146037578063c040622614604757005b603d6084565b8060005260206000f35b604d6057565b8060005260206000f35b6000605f6084565b600060006101000a81548160ff0219169083021790555060ff60016000540416905090565b6000808160011560cd575b600a82121560a157600190910190608f565b81600a1460ac5760c9565b50600a5b60008160ff16111560c85760019182900391900360b0565b5b60d5565b6000925060ed565b8160001460e05760e8565b6001925060ed565b600092505b50509056",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -822,7 +822,7 @@
"code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463c04062268114602d57005b6033603d565b8060005260206000f35b600060005a600160205590505a81036000555a600260205590505a81036001555a600260205590505a81036002555a65168aa8d53fe660205590505a81036003555a600260205590505a81036004555a600060205590505a81036005555a5060019291505056",
"nonce" : "0x00",
"storage" : {
"0x" : "0x4e2d",
"0x00" : "0x4e2d",
"0x01" : "0x1395",
"0x02" : "0x1395",
"0x03" : "0x1395",
@@ -890,7 +890,7 @@
"code" : "0x7c010000000000000000000000000000000000000000000000000000000060003504632a9afb838114610039578063c04062261461004b57005b61004161005d565b8060005260206000f35b61005361016c565b8060005260206000f35b600160ff8154141561006e57610076565b506000610169565b60015460035414156100875761008f565b506000610169565b73a94f5374fce5edbc8e2a8697c15331677e6ebf0b73ffffffffffffffffffffffffffffffffffffffff60016002540481161614156100cd576100d5565b506000610169565b7f676c6f62616c2064617461203332206c656e67746820737472696e670000000060045414156101045761010c565b506000610169565b6005600080815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673a94f5374fce5edbc8e2a8697c15331677e6ebf0b141561016057610168565b506000610169565b5b90565b600060ff806001555073a94f5374fce5edbc8e2a8697c15331677e6ebf0b6002805473ffffffffffffffffffffffffffffffffffffffff1916821790555060ff80600355507f676c6f62616c2064617461203332206c656e67746820737472696e6700000000806004555073a94f5374fce5edbc8e2a8697c15331677e6ebf0b6005600080815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff0219169083021790555061022f61005d565b600060006101000a81548160ff0219169083021790555060ff6001600054041690509056",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01",
"0x00" : "0x01",
"0x01" : "0xff",
"0x02" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x03" : "0xff",

View File

@@ -40,6 +40,68 @@
"value" : "0x01f5"
}
},
"gasPrice0" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x6001600101600055",
"nonce" : "0x00",
"storage" : {
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
"balance" : "0x00",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "0e0a9930aef3324bda67bbde12029234f6f38f11f887ba3c6aca7f9e6a006746",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x6001600101600055",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "",
"gasLimit" : "0xa033",
"gasPrice" : "0x00",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x0186a0"
}
},
"makeMoney" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",

View File

@@ -173,7 +173,7 @@
"code" : "0x6001600054016000556000600060006000600173945304eb96065b2a98b57a48a06ae28d285a71b5620186a05a03f1",
"nonce" : "0x00",
"storage" : {
"0x" : "0x30"
"0x00" : "0x30"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -188,7 +188,7 @@
"code" : "0x6001600054016000556000600060006000600073095e7baea6a6c7c4c2dfeb977efac326af552d87620186a05a03f1",
"nonce" : "0x00",
"storage" : {
"0x" : "0x2f"
"0x00" : "0x2f"
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
@@ -251,7 +251,7 @@
"code" : "0x6001600054016000556000600060006000600173945304eb96065b2a98b57a48a06ae28d285a71b5620186a05a03f1",
"nonce" : "0x00",
"storage" : {
"0x" : "0x30"
"0x00" : "0x30"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -266,7 +266,7 @@
"code" : "0x6001600054016000556000600060006000600073095e7baea6a6c7c4c2dfeb977efac326af552d87620186a05a03f1",
"nonce" : "0x00",
"storage" : {
"0x" : "0x2f"
"0x00" : "0x2f"
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
@@ -497,7 +497,7 @@
"code" : "0x5b600a60805110156042576000600061c3506000600173aaaf5374fce5edbc8e2a8697c15331677e6ebf0b650ffffffffffff16000556001608051016080526000565b608051600155",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01",
"0x00" : "0x01",
"0x01" : "0x0a"
}
}
@@ -630,7 +630,7 @@
"code" : "0x600160005401600055690fffffffffffffffffff610402600054040260025560006000690fffffffffffffffffff610402600054040260006000306104005a03f1600155",
"nonce" : "0x00",
"storage" : {
"0x" : "0x0401",
"0x00" : "0x0401",
"0x01" : "0x01"
}
},
@@ -1032,7 +1032,7 @@
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620186a0f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -1186,7 +1186,7 @@
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000604060406000601774945304eb96065b2a98b57a48a06ae28d285a71b5aa6103e8f1600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2106,7 +2106,7 @@
"code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052601d60036017f0600055",
"nonce" : "0x01",
"storage" : {
"0x" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
"0x00" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2384,7 +2384,7 @@
"code" : "0x34600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x0186a0"
"0x00" : "0x0186a0"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2447,7 +2447,7 @@
"code" : "0x60006000600060006001600061c350f2600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2662,7 +2662,7 @@
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000604060406000601774945304eb96065b2a98b57a48a06ae28d285a71b5aa6103e8f2600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2815,7 +2815,7 @@
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526002600060406000601773945304eb96065b2a98b57a48a06ae28d285a71b561c350f2600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01",
"0x00" : "0x01",
"0x01" : "0x01"
}
},
@@ -2893,7 +2893,7 @@
"code" : "0x3331600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x0de0b6b3a6c9e2e0"
"0x00" : "0x0de0b6b3a6c9e2e0"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -2956,7 +2956,7 @@
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526080600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x80"
"0x00" : "0x80"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -3033,7 +3033,7 @@
"code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052601d60036017f0600055",
"nonce" : "0x01",
"storage" : {
"0x" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
"0x00" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -3289,7 +3289,7 @@
"code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052601d60036103e8f0600055",
"nonce" : "0x01",
"storage" : {
"0x" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
"0x00" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -3359,7 +3359,7 @@
"code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052600060036017f0600055",
"nonce" : "0x01",
"storage" : {
"0x" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
"0x00" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -3429,7 +3429,7 @@
"code" : "0x7c601080600c6000396000f3006000355415600957005b6020356000355560005260007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6017f0600055",
"nonce" : "0x01",
"storage" : {
"0x" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
"0x00" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -3499,7 +3499,7 @@
"code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052600060006017f0600055",
"nonce" : "0x01",
"storage" : {
"0x" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
"0x00" : "0xd2571607e241ecf590ed94b12d87c94babe36db6"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
@@ -3631,7 +3631,7 @@
"code" : "0x3031600055",
"nonce" : "0x00",
"storage" : {
"0x" : "0x0de0b6b3a76586a0"
"0x00" : "0x0de0b6b3a76586a0"
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {

File diff suppressed because it is too large Load Diff

View File

@@ -38,9 +38,54 @@
"value" : "0x0a"
}
},
"DataTestFirstZeroBytes" : {
"rlp" : "0xf87c80018261a894095e7baea6a6c7c4c2dfeb977efac326af552d870a9d00000000000000000000000000010000000000000000000000000000001ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"sender" : "8131688854fe0dca411aa19572a01fe3e3e4fa74",
"transaction" : {
"data" : "0x000000000000000000000000001000000000000000000000000000000",
"gasLimit" : "0x61a8",
"gasPrice" : "0x01",
"nonce" : "0x00",
"r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
"s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"v" : "0x1b",
"value" : "0x0a"
}
},
"DataTestLastZeroBytes" : {
"rlp" : "0xf87c80018261a894095e7baea6a6c7c4c2dfeb977efac326af552d870a9d00100000000000000000000000000000000000000000000000000000001ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"sender" : "ead53a9560ea38feb0bc2cad8ef65e5d8f990fc1",
"transaction" : {
"data" : "0x010000000000000000000000000000000000000000000000000000000",
"gasLimit" : "0x61a8",
"gasPrice" : "0x01",
"nonce" : "0x00",
"r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
"s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"v" : "0x1b",
"value" : "0x0a"
}
},
"DataTestNotEnoughGAS" : {
"rlp" : "0xf86d800182521c94095e7baea6a6c7c4c2dfeb977efac326af552d870a8e0358ac39584bc98a7c979f984b031ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
},
"DataTestZeroBytes" : {
"rlp" : "0xf87c80018261a894095e7baea6a6c7c4c2dfeb977efac326af552d870a9d00000000000000000000000000000000000000000000000000000000001ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"sender" : "b7ab01c0f092d30aeed17e23adb7aa5a9b2ee077",
"transaction" : {
"data" : "0x000000000000000000000000000000000000000000000000000000000",
"gasLimit" : "0x61a8",
"gasPrice" : "0x01",
"nonce" : "0x00",
"r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
"s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"v" : "0x1b",
"value" : "0x0a"
}
},
"EmptyTransaction" : {
"rlp" : "0xf85d80808094095e7baea6a6c7c4c2dfeb977efac326af552d8780801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
},
@@ -135,7 +180,7 @@
"value" : "0x00"
}
},
"TransactionWithHihghNonce" : {
"TransactionWithHihghNonce256" : {
"rlp" : "0xf87fa0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0182520894095e7baea6a6c7c4c2dfeb977efac326af552d8780801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"sender" : "9b96002788562fefd5ac08d5af877fa738272dc7",
"transaction" : {
@@ -150,6 +195,21 @@
"value" : "0x00"
}
},
"TransactionWithHihghNonce32" : {
"rlp" : "0xf8648501000000000182520894095e7baea6a6c7c4c2dfeb977efac326af552d8780801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"sender" : "e86dc346fd8debf719486ff2f9c4c629fe58fc46",
"transaction" : {
"data" : "",
"gasLimit" : "0x5208",
"gasPrice" : "0x01",
"nonce" : "0x0100000000",
"r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
"s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"v" : "0x1b",
"value" : "0x00"
}
},
"TransactionWithHihghValue" : {
"rlp" : "0xf87f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d87a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"sender" : "396bd0363e26195eeacfedbe54c44f16fbe470b6",
@@ -171,9 +231,39 @@
"TransactionWithRSvalue0" : {
"rlp" : "0xdf800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801b8080"
},
"TransactionWithRSvalue1" : {
"rlp" : "0xdf800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801b0101",
"sender" : "98c188f183d4e93ff2bffadd145f39b4a792ed85",
"transaction" : {
"data" : "",
"gasLimit" : "0x5208",
"gasPrice" : "0x01",
"nonce" : "0x00",
"r" : "0x01",
"s" : "0x01",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"v" : "0x1b",
"value" : "0x0b"
}
},
"TransactionWithRvalue0" : {
"rlp" : "0xf83f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801b80a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
},
"TransactionWithRvalue1" : {
"rlp" : "0xf83f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801b01a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"sender" : "421ba7ba39c1c2ddb98308deca3af1dd9e461740",
"transaction" : {
"data" : "",
"gasLimit" : "0x5208",
"gasPrice" : "0x01",
"nonce" : "0x00",
"r" : "0x01",
"s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"v" : "0x1b",
"value" : "0x0b"
}
},
"TransactionWithRvalueHigh" : {
"rlp" : "0xf85f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba0fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140a08887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3"
},
@@ -199,30 +289,33 @@
"rlp" : "0xf85f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba0fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
},
"TransactionWithSvalue0" : {
"rlp" : "0xf83f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a3664935380",
"sender" : "f9c8b2d1e51d4cd5e749fd80393caf36879bca08",
"transaction" : {
"data" : "0x",
"gasLimit" : "0x5208",
"gasPrice" : "0x01",
"nonce" : "0x",
"r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
"s" : "0x",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"v" : "0x1b",
"value" : "0x0b"
}
"rlp" : "0xf83f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a3664935380"
},
"TransactionWithSvalueHigh" : {
"rlp" : "0xf85f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e",
"sender" : "cae01e4c9e1eb0fc7676055de1fa1f1e8cfd36ee",
"TransactionWithSvalue1" : {
"rlp" : "0xf83f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a3664935301",
"sender" : "e115cf6bb5656786569dd273705242ca72d84bc0",
"transaction" : {
"data" : "",
"gasLimit" : "0x5208",
"gasPrice" : "0x01",
"nonce" : "0x00",
"r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
"s" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e",
"s" : "0x01",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"v" : "0x1b",
"value" : "0x0b"
}
},
"TransactionWithSvalueHigh" : {
"rlp" : "0xf85f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140",
"sender" : "474869ba435affa1f45aaada48520880921c0887",
"transaction" : {
"data" : "",
"gasLimit" : "0x5208",
"gasPrice" : "0x01",
"nonce" : "0x00",
"r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
"s" : "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"v" : "0x1b",
"value" : "0x0b"
@@ -247,7 +340,7 @@
}
},
"TransactionWithSvalueTooHigh" : {
"rlp" : "0xf85f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"
"rlp" : "0xf85f800182520894095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"
},
"TransactionWithTooFewRLPElements" : {
"rlp" : "0xf85b800194095e7baea6a6c7c4c2dfeb977efac326af552d87801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600040600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -37,7 +37,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600040600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -72,7 +72,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600140600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -81,7 +81,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600140600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -116,9 +116,9 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60014060005560024060015561010040600255",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
"0x" : "0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
"0x00" : "0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
"0x01" : "0xad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
"0x02" : "0x6ca54da2c4784ea43fd88b3402de07ae4bced597cbb19f323b7595857a6720ae"
}
@@ -128,7 +128,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60014060005560024060015561010040600255",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -163,7 +163,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600140600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -172,7 +172,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600140600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -207,7 +207,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600240600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -216,7 +216,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600240600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -251,7 +251,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600040600055610101406001557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40600255",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -260,7 +260,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600040600055610101406001557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40600255",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -289,7 +289,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x40",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -302,7 +302,7 @@
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
@@ -324,9 +324,9 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x41600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
"0x" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
"0x00" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
}
}
},
@@ -334,7 +334,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x41600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -347,7 +347,7 @@
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
@@ -369,9 +369,9 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x44600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
"0x" : "0x0100"
"0x00" : "0x0100"
}
}
},
@@ -379,7 +379,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x44600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -392,7 +392,7 @@
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
@@ -414,9 +414,9 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x45600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
"0x" : "0x0f4240"
"0x00" : "0x0f4240"
}
}
},
@@ -424,7 +424,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x45600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -459,9 +459,9 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x43600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
}
},
@@ -469,7 +469,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x43600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
@@ -482,7 +482,7 @@
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
@@ -504,9 +504,9 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x42600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
"0x" : "0x01"
"0x00" : "0x01"
}
}
},
@@ -514,7 +514,7 @@
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x42600055",
"nonce" : "0x",
"nonce" : "0x00",
"storage" : {
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More