diff options
-rw-r--r-- | Makefile | 67 | ||||
-rw-r--r-- | eth/downloader/downloader.go | 178 | ||||
-rw-r--r-- | eth/downloader/peer.go | 231 | ||||
-rw-r--r-- | eth/downloader/queue.go | 95 | ||||
-rw-r--r-- | rpc/api/eth.go | 46 | ||||
-rw-r--r-- | rpc/api/eth_js.go | 22 | ||||
-rw-r--r-- | tests/files/BlockchainTests/bcStateTest.json | 705 | ||||
-rw-r--r-- | tests/files/StateTests/stPreCompiledContracts.json | 144 | ||||
-rw-r--r-- | tests/files/StateTests/stSystemOperationsTest.json | 55 | ||||
-rw-r--r-- | xeth/xeth.go | 54 |
10 files changed, 1296 insertions, 301 deletions
@@ -2,9 +2,17 @@ # with Go source code. If you know what GOPATH is then you probably # don't need to bother with make. -.PHONY: geth geth-cross geth-linux geth-darwin geth-windows geth-android evm all test travis-test-with-coverage xgo clean +.PHONY: geth geth-cross evm all test travis-test-with-coverage xgo clean +.PHONY: geth-linux geth-linux-arm geth-linux-386 geth-linux-amd64 +.PHONY: geth-darwin geth-darwin-386 geth-darwin-amd64 +.PHONY: geth-windows geth-windows-386 geth-windows-amd64 +.PHONY: geth-android geth-android-16 geth-android-21 + GOBIN = build/bin +CROSSDEPS = https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 +GO ?= latest + geth: build/env.sh go install -v $(shell build/flags.sh) ./cmd/geth @echo "Done building." @@ -14,26 +22,67 @@ geth-cross: geth-linux geth-darwin geth-windows geth-android @echo "Full cross compilation done:" @ls -l $(GOBIN)/geth-* -geth-linux: xgo - build/env.sh $(GOBIN)/xgo --dest=$(GOBIN) --deps=https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 --targets=linux/* -v $(shell build/flags.sh) ./cmd/geth +geth-linux: xgo geth-linux-arm geth-linux-386 geth-linux-amd64 @echo "Linux cross compilation done:" @ls -l $(GOBIN)/geth-linux-* -geth-darwin: xgo - build/env.sh $(GOBIN)/xgo --dest=$(GOBIN) --deps=https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 --targets=darwin/* -v $(shell build/flags.sh) ./cmd/geth +geth-linux-arm: xgo + build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/arm -v $(shell build/flags.sh) ./cmd/geth + @echo "Linux ARM cross compilation done:" + @ls -l $(GOBIN)/geth-linux-* | grep arm + +geth-linux-386: xgo + build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/386 -v $(shell build/flags.sh) ./cmd/geth + @echo "Linux 386 cross compilation done:" + @ls -l $(GOBIN)/geth-linux-* | grep 386 + +geth-linux-amd64: xgo + build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/amd64 -v $(shell build/flags.sh) ./cmd/geth + @echo "Linux amd64 cross compilation done:" + @ls -l $(GOBIN)/geth-linux-* | grep amd64 + +geth-darwin: xgo geth-darwin-386 geth-darwin-amd64 @echo "Darwin cross compilation done:" @ls -l $(GOBIN)/geth-darwin-* -geth-windows: xgo - build/env.sh $(GOBIN)/xgo --dest=$(GOBIN) --deps=https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 --targets=windows/* -v $(shell build/flags.sh) ./cmd/geth +geth-darwin-386: xgo + build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=darwin/386 -v $(shell build/flags.sh) ./cmd/geth + @echo "Darwin 386 cross compilation done:" + @ls -l $(GOBIN)/geth-darwin-* | grep 386 + +geth-darwin-amd64: xgo + build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=darwin/amd64 -v $(shell build/flags.sh) ./cmd/geth + @echo "Darwin amd64 cross compilation done:" + @ls -l $(GOBIN)/geth-darwin-* | grep amd64 + +geth-windows: xgo geth-windows-386 geth-windows-amd64 @echo "Windows cross compilation done:" @ls -l $(GOBIN)/geth-windows-* -geth-android: xgo - build/env.sh $(GOBIN)/xgo --dest=$(GOBIN) --deps=https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 --targets=android-16/*,android-21/* -v $(shell build/flags.sh) ./cmd/geth +geth-windows-386: xgo + build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=windows/386 -v $(shell build/flags.sh) ./cmd/geth + @echo "Windows 386 cross compilation done:" + @ls -l $(GOBIN)/geth-windows-* | grep 386 + +geth-windows-amd64: xgo + build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=windows/amd64 -v $(shell build/flags.sh) ./cmd/geth + @echo "Windows amd64 cross compilation done:" + @ls -l $(GOBIN)/geth-windows-* | grep amd64 + +geth-android: xgo geth-android-16 geth-android-21 @echo "Android cross compilation done:" @ls -l $(GOBIN)/geth-android-* +geth-android-16: xgo + build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=android-16/* -v $(shell build/flags.sh) ./cmd/geth + @echo "Android 16 cross compilation done:" + @ls -l $(GOBIN)/geth-android-16-* + +geth-android-21: xgo + build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=android-21/* -v $(shell build/flags.sh) ./cmd/geth + @echo "Android 21 cross compilation done:" + @ls -l $(GOBIN)/geth-android-21-* + evm: build/env.sh $(GOROOT)/bin/go install -v $(shell build/flags.sh) ./cmd/evm @echo "Done building." diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index 5fa18a2e3..c272d05af 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -45,16 +45,17 @@ var ( MaxReceiptFetch = 256 // Amount of transaction receipts to allow fetching per request MaxStateFetch = 384 // Amount of node state values to allow fetching per request - hashTTL = 5 * time.Second // [eth/61] Time it takes for a hash request to time out - blockSoftTTL = 3 * time.Second // [eth/61] Request completion threshold for increasing or decreasing a peer's bandwidth - blockHardTTL = 3 * blockSoftTTL // [eth/61] Maximum time allowance before a block request is considered expired - headerTTL = 5 * time.Second // [eth/62] Time it takes for a header request to time out - bodySoftTTL = 3 * time.Second // [eth/62] Request completion threshold for increasing or decreasing a peer's bandwidth - bodyHardTTL = 3 * bodySoftTTL // [eth/62] Maximum time allowance before a block body request is considered expired - receiptSoftTTL = 3 * time.Second // [eth/63] Request completion threshold for increasing or decreasing a peer's bandwidth - receiptHardTTL = 3 * receiptSoftTTL // [eth/63] Maximum time allowance before a receipt request is considered expired - stateSoftTTL = 2 * time.Second // [eth/63] Request completion threshold for increasing or decreasing a peer's bandwidth - stateHardTTL = 3 * stateSoftTTL // [eth/63] Maximum time allowance before a node data request is considered expired + hashTTL = 3 * time.Second // [eth/61] Time it takes for a hash request to time out + blockTargetRTT = 3 * time.Second / 2 // [eth/61] Target time for completing a block retrieval request + blockTTL = 3 * blockTargetRTT // [eth/61] Maximum time allowance before a block request is considered expired + + headerTTL = 3 * time.Second // [eth/62] Time it takes for a header request to time out + bodyTargetRTT = 3 * time.Second / 2 // [eth/62] Target time for completing a block body retrieval request + bodyTTL = 3 * bodyTargetRTT // [eth/62] Maximum time allowance before a block body request is considered expired + receiptTargetRTT = 3 * time.Second / 2 // [eth/63] Target time for completing a receipt retrieval request + receiptTTL = 3 * receiptTargetRTT // [eth/63] Maximum time allowance before a receipt request is considered expired + stateTargetRTT = 2 * time.Second / 2 // [eth/63] Target time for completing a state trie retrieval request + stateTTL = 3 * stateTargetRTT // [eth/63] Maximum time allowance before a node data request is considered expired maxQueuedHashes = 256 * 1024 // [eth/61] Maximum number of hashes to queue for import (DOS protection) maxQueuedHeaders = 256 * 1024 // [eth/62] Maximum number of headers to queue for import (DOS protection) @@ -486,7 +487,7 @@ func (d *Downloader) fetchHeight61(p *peer) (uint64, error) { // Request the advertised remote head block and wait for the response go p.getBlocks([]common.Hash{p.head}) - timeout := time.After(blockSoftTTL) + timeout := time.After(hashTTL) for { select { case <-d.cancelCh: @@ -779,47 +780,27 @@ func (d *Downloader) fetchBlocks61(from uint64) error { // If the peer was previously banned and failed to deliver it's pack // in a reasonable time frame, ignore it's message. if peer := d.peers.Peer(packet.PeerId()); peer != nil { - // Deliver the received chunk of blocks, and demote in case of errors blocks := packet.(*blockPack).blocks - err := d.queue.DeliverBlocks(peer.id, blocks) - switch err { - case nil: - // If no blocks were delivered, demote the peer (need the delivery above) - if len(blocks) == 0 { - peer.Demote() - peer.SetBlocksIdle() - glog.V(logger.Detail).Infof("%s: no blocks delivered", peer) - break - } - // All was successful, promote the peer and potentially start processing - peer.Promote() - peer.SetBlocksIdle() - glog.V(logger.Detail).Infof("%s: delivered %d blocks", peer, len(blocks)) - case errInvalidChain: - // The hash chain is invalid (blocks are not ordered properly), abort + // Deliver the received chunk of blocks and check chain validity + accepted, err := d.queue.DeliverBlocks(peer.id, blocks) + if err == errInvalidChain { return err - - case errNoFetchesPending: - // Peer probably timed out with its delivery but came through - // in the end, demote, but allow to to pull from this peer. - peer.Demote() - peer.SetBlocksIdle() - glog.V(logger.Detail).Infof("%s: out of bound delivery", peer) - - case errStaleDelivery: - // Delivered something completely else than requested, usually - // caused by a timeout and delivery during a new sync cycle. - // Don't set it to idle as the original request should still be - // in flight. - peer.Demote() - glog.V(logger.Detail).Infof("%s: stale delivery", peer) - + } + // Unless a peer delivered something completely else than requested (usually + // caused by a timed out request which came through in the end), set it to + // idle. If the delivery's stale, the peer should have already been idled. + if err != errStaleDelivery { + peer.SetBlocksIdle(accepted) + } + // Issue a log to the user to see what's going on + switch { + case err == nil && len(blocks) == 0: + glog.V(logger.Detail).Infof("%s: no blocks delivered", peer) + case err == nil: + glog.V(logger.Detail).Infof("%s: delivered %d blocks", peer, len(blocks)) default: - // Peer did something semi-useful, demote but keep it around - peer.Demote() - peer.SetBlocksIdle() - glog.V(logger.Detail).Infof("%s: delivery partially failed: %v", peer, err) + glog.V(logger.Detail).Infof("%s: delivery failed: %v", peer, err) } } // Blocks arrived, try to update the progress @@ -852,10 +833,15 @@ func (d *Downloader) fetchBlocks61(from uint64) error { return errNoPeers } // Check for block request timeouts and demote the responsible peers - for _, pid := range d.queue.ExpireBlocks(blockHardTTL) { + for pid, fails := range d.queue.ExpireBlocks(blockTTL) { if peer := d.peers.Peer(pid); peer != nil { - peer.Demote() - glog.V(logger.Detail).Infof("%s: block delivery timeout", peer) + if fails > 1 { + glog.V(logger.Detail).Infof("%s: block delivery timeout", peer) + peer.SetBlocksIdle(0) + } else { + glog.V(logger.Debug).Infof("%s: stalling block delivery, dropping", peer) + d.dropPeer(pid) + } } } // If there's nothing more to fetch, wait or terminate @@ -1281,14 +1267,14 @@ func (d *Downloader) fetchBodies(from uint64) error { glog.V(logger.Debug).Infof("Downloading block bodies from #%d", from) var ( - deliver = func(packet dataPack) error { + deliver = func(packet dataPack) (int, error) { pack := packet.(*bodyPack) return d.queue.DeliverBodies(pack.peerId, pack.transactions, pack.uncles) } - expire = func() []string { return d.queue.ExpireBodies(bodyHardTTL) } + expire = func() map[string]int { return d.queue.ExpireBodies(bodyTTL) } fetch = func(p *peer, req *fetchRequest) error { return p.FetchBodies(req) } capacity = func(p *peer) int { return p.BlockCapacity() } - setIdle = func(p *peer) { p.SetBodiesIdle() } + setIdle = func(p *peer, accepted int) { p.SetBodiesIdle(accepted) } ) err := d.fetchParts(errCancelBodyFetch, d.bodyCh, deliver, d.bodyWakeCh, expire, d.queue.PendingBlocks, d.queue.InFlightBlocks, d.queue.ShouldThrottleBlocks, d.queue.ReserveBodies, @@ -1305,14 +1291,14 @@ func (d *Downloader) fetchReceipts(from uint64) error { glog.V(logger.Debug).Infof("Downloading receipts from #%d", from) var ( - deliver = func(packet dataPack) error { + deliver = func(packet dataPack) (int, error) { pack := packet.(*receiptPack) return d.queue.DeliverReceipts(pack.peerId, pack.receipts) } - expire = func() []string { return d.queue.ExpireReceipts(receiptHardTTL) } + expire = func() map[string]int { return d.queue.ExpireReceipts(receiptTTL) } fetch = func(p *peer, req *fetchRequest) error { return p.FetchReceipts(req) } capacity = func(p *peer) int { return p.ReceiptCapacity() } - setIdle = func(p *peer) { p.SetReceiptsIdle() } + setIdle = func(p *peer, accepted int) { p.SetReceiptsIdle(accepted) } ) err := d.fetchParts(errCancelReceiptFetch, d.receiptCh, deliver, d.receiptWakeCh, expire, d.queue.PendingReceipts, d.queue.InFlightReceipts, d.queue.ShouldThrottleReceipts, d.queue.ReserveReceipts, @@ -1329,7 +1315,7 @@ func (d *Downloader) fetchNodeData() error { glog.V(logger.Debug).Infof("Downloading node state data") var ( - deliver = func(packet dataPack) error { + deliver = func(packet dataPack) (int, error) { start := time.Now() return d.queue.DeliverNodeData(packet.PeerId(), packet.(*statePack).states, func(err error, delivered int) { if err != nil { @@ -1352,14 +1338,14 @@ func (d *Downloader) fetchNodeData() error { glog.V(logger.Info).Infof("imported %d state entries in %v: processed %d in total", delivered, time.Since(start), d.syncStatsStateDone) }) } - expire = func() []string { return d.queue.ExpireNodeData(stateHardTTL) } + expire = func() map[string]int { return d.queue.ExpireNodeData(stateTTL) } throttle = func() bool { return false } reserve = func(p *peer, count int) (*fetchRequest, bool, error) { return d.queue.ReserveNodeData(p, count), false, nil } fetch = func(p *peer, req *fetchRequest) error { return p.FetchNodeData(req) } capacity = func(p *peer) int { return p.NodeDataCapacity() } - setIdle = func(p *peer) { p.SetNodeDataIdle() } + setIdle = func(p *peer, accepted int) { p.SetNodeDataIdle(accepted) } ) err := d.fetchParts(errCancelStateFetch, d.stateCh, deliver, d.stateWakeCh, expire, d.queue.PendingNodeData, d.queue.InFlightNodeData, throttle, reserve, nil, fetch, @@ -1372,10 +1358,10 @@ func (d *Downloader) fetchNodeData() error { // fetchParts iteratively downloads scheduled block parts, taking any available // peers, reserving a chunk of fetch requests for each, waiting for delivery and // also periodically checking for timeouts. -func (d *Downloader) fetchParts(errCancel error, deliveryCh chan dataPack, deliver func(packet dataPack) error, wakeCh chan bool, - expire func() []string, pending func() int, inFlight func() bool, throttle func() bool, reserve func(*peer, int) (*fetchRequest, bool, error), +func (d *Downloader) fetchParts(errCancel error, deliveryCh chan dataPack, deliver func(dataPack) (int, error), wakeCh chan bool, + expire func() map[string]int, pending func() int, inFlight func() bool, throttle func() bool, reserve func(*peer, int) (*fetchRequest, bool, error), fetchHook func([]*types.Header), fetch func(*peer, *fetchRequest) error, cancel func(*fetchRequest), capacity func(*peer) int, - idle func() ([]*peer, int), setIdle func(*peer), kind string) error { + idle func() ([]*peer, int), setIdle func(*peer, int), kind string) error { // Create a ticker to detect expired retrieval tasks ticker := time.NewTicker(100 * time.Millisecond) @@ -1394,45 +1380,25 @@ func (d *Downloader) fetchParts(errCancel error, deliveryCh chan dataPack, deliv // If the peer was previously banned and failed to deliver it's pack // in a reasonable time frame, ignore it's message. if peer := d.peers.Peer(packet.PeerId()); peer != nil { - // Deliver the received chunk of data, and demote in case of errors - switch err := deliver(packet); err { - case nil: - // If no blocks were delivered, demote the peer (need the delivery above to clean internal queue!) - if packet.Items() == 0 { - peer.Demote() - setIdle(peer) - glog.V(logger.Detail).Infof("%s: no %s delivered", peer, strings.ToLower(kind)) - break - } - // All was successful, promote the peer and potentially start processing - peer.Promote() - setIdle(peer) - glog.V(logger.Detail).Infof("%s: delivered %s %s(s)", peer, packet.Stats(), strings.ToLower(kind)) - - case errInvalidChain: - // The hash chain is invalid (blocks are not ordered properly), abort + // Deliver the received chunk of data and check chain validity + accepted, err := deliver(packet) + if err == errInvalidChain { return err - - case errNoFetchesPending: - // Peer probably timed out with its delivery but came through - // in the end, demote, but allow to to pull from this peer. - peer.Demote() - setIdle(peer) - glog.V(logger.Detail).Infof("%s: out of bound %s delivery", peer, strings.ToLower(kind)) - - case errStaleDelivery: - // Delivered something completely else than requested, usually - // caused by a timeout and delivery during a new sync cycle. - // Don't set it to idle as the original request should still be - // in flight. - peer.Demote() - glog.V(logger.Detail).Infof("%s: %s stale delivery", peer, strings.ToLower(kind)) - + } + // Unless a peer delivered something completely else than requested (usually + // caused by a timed out request which came through in the end), set it to + // idle. If the delivery's stale, the peer should have already been idled. + if err != errStaleDelivery { + setIdle(peer, accepted) + } + // Issue a log to the user to see what's going on + switch { + case err == nil && packet.Items() == 0: + glog.V(logger.Detail).Infof("%s: no %s delivered", peer, strings.ToLower(kind)) + case err == nil: + glog.V(logger.Detail).Infof("%s: delivered %s %s(s)", peer, packet.Stats(), strings.ToLower(kind)) default: - // Peer did something semi-useful, demote but keep it around - peer.Demote() - setIdle(peer) - glog.V(logger.Detail).Infof("%s: %s delivery partially failed: %v", peer, strings.ToLower(kind), err) + glog.V(logger.Detail).Infof("%s: %s delivery failed: %v", peer, strings.ToLower(kind), err) } } // Blocks assembled, try to update the progress @@ -1465,11 +1431,15 @@ func (d *Downloader) fetchParts(errCancel error, deliveryCh chan dataPack, deliv return errNoPeers } // Check for fetch request timeouts and demote the responsible peers - for _, pid := range expire() { + for pid, fails := range expire() { if peer := d.peers.Peer(pid); peer != nil { - peer.Demote() - setIdle(peer) - glog.V(logger.Detail).Infof("%s: %s delivery timeout", peer, strings.ToLower(kind)) + if fails > 1 { + glog.V(logger.Detail).Infof("%s: %s delivery timeout", peer, strings.ToLower(kind)) + setIdle(peer, 0) + } else { + glog.V(logger.Debug).Infof("%s: stalling %s delivery, dropping", peer, strings.ToLower(kind)) + d.dropPeer(pid) + } } } // If there's nothing more to fetch, wait or terminate diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go index 9ba6dabbd..80f08b68f 100644 --- a/eth/downloader/peer.go +++ b/eth/downloader/peer.go @@ -30,8 +30,10 @@ import ( "github.com/ethereum/go-ethereum/common" ) -// Maximum number of entries allowed on the list or lacking items. -const maxLackingHashes = 4096 +const ( + maxLackingHashes = 4096 // Maximum number of entries allowed on the list or lacking items + throughputImpact = 0.1 // The impact a single measurement has on a peer's final throughput value. +) // Hash and block fetchers belonging to eth/61 and below type relativeHashFetcherFn func(common.Hash) error @@ -59,18 +61,16 @@ type peer struct { blockIdle int32 // Current block activity state of the peer (idle = 0, active = 1) receiptIdle int32 // Current receipt activity state of the peer (idle = 0, active = 1) stateIdle int32 // Current node data activity state of the peer (idle = 0, active = 1) - rep int32 // Simple peer reputation - blockCapacity int32 // Number of blocks (bodies) allowed to fetch per request - receiptCapacity int32 // Number of receipts allowed to fetch per request - stateCapacity int32 // Number of node data pieces allowed to fetch per request + blockThroughput float64 // Number of blocks (bodies) measured to be retrievable per second + receiptThroughput float64 // Number of receipts measured to be retrievable per second + stateThroughput float64 // Number of node data pieces measured to be retrievable per second blockStarted time.Time // Time instance when the last block (body)fetch was started receiptStarted time.Time // Time instance when the last receipt fetch was started stateStarted time.Time // Time instance when the last node data fetch was started - lacking map[common.Hash]struct{} // Set of hashes not to request (didn't have previously) - lackingLock sync.RWMutex // Lock protecting the lacking hashes list + lacking map[common.Hash]struct{} // Set of hashes not to request (didn't have previously) getRelHashes relativeHashFetcherFn // [eth/61] Method to retrieve a batch of hashes from an origin hash getAbsHashes absoluteHashFetcherFn // [eth/61] Method to retrieve a batch of hashes from an absolute position @@ -84,6 +84,7 @@ type peer struct { getNodeData stateFetcherFn // [eth/63] Method to retrieve a batch of state trie data version int // Eth protocol version number to switch strategies + lock sync.RWMutex } // newPeer create a new downloader peer, with specific hash and block retrieval @@ -93,12 +94,9 @@ func newPeer(id string, version int, head common.Hash, getRelHeaders relativeHeaderFetcherFn, getAbsHeaders absoluteHeaderFetcherFn, getBlockBodies blockBodyFetcherFn, getReceipts receiptFetcherFn, getNodeData stateFetcherFn) *peer { return &peer{ - id: id, - head: head, - blockCapacity: 1, - receiptCapacity: 1, - stateCapacity: 1, - lacking: make(map[common.Hash]struct{}), + id: id, + head: head, + lacking: make(map[common.Hash]struct{}), getRelHashes: getRelHashes, getAbsHashes: getAbsHashes, @@ -117,15 +115,18 @@ func newPeer(id string, version int, head common.Hash, // Reset clears the internal state of a peer entity. func (p *peer) Reset() { + p.lock.Lock() + defer p.lock.Unlock() + atomic.StoreInt32(&p.blockIdle, 0) atomic.StoreInt32(&p.receiptIdle, 0) - atomic.StoreInt32(&p.blockCapacity, 1) - atomic.StoreInt32(&p.receiptCapacity, 1) - atomic.StoreInt32(&p.stateCapacity, 1) + atomic.StoreInt32(&p.stateIdle, 0) + + p.blockThroughput = 0 + p.receiptThroughput = 0 + p.stateThroughput = 0 - p.lackingLock.Lock() p.lacking = make(map[common.Hash]struct{}) - p.lackingLock.Unlock() } // Fetch61 sends a block retrieval request to the remote peer. @@ -216,107 +217,86 @@ func (p *peer) FetchNodeData(request *fetchRequest) error { return nil } -// SetBlocksIdle sets the peer to idle, allowing it to execute new retrieval requests. -// Its block retrieval allowance will also be updated either up- or downwards, -// depending on whether the previous fetch completed in time. -func (p *peer) SetBlocksIdle() { - p.setIdle(p.blockStarted, blockSoftTTL, blockHardTTL, MaxBlockFetch, &p.blockCapacity, &p.blockIdle) +// SetBlocksIdle sets the peer to idle, allowing it to execute new block retrieval +// requests. Its estimated block retrieval throughput is updated with that measured +// just now. +func (p *peer) SetBlocksIdle(delivered int) { + p.setIdle(p.blockStarted, delivered, &p.blockThroughput, &p.blockIdle) } -// SetBodiesIdle sets the peer to idle, allowing it to execute new retrieval requests. -// Its block body retrieval allowance will also be updated either up- or downwards, -// depending on whether the previous fetch completed in time. -func (p *peer) SetBodiesIdle() { - p.setIdle(p.blockStarted, bodySoftTTL, bodyHardTTL, MaxBodyFetch, &p.blockCapacity, &p.blockIdle) +// SetBodiesIdle sets the peer to idle, allowing it to execute block body retrieval +// requests. Its estimated body retrieval throughput is updated with that measured +// just now. +func (p *peer) SetBodiesIdle(delivered int) { + p.setIdle(p.blockStarted, delivered, &p.blockThroughput, &p.blockIdle) } -// SetReceiptsIdle sets the peer to idle, allowing it to execute new retrieval requests. -// Its receipt retrieval allowance will also be updated either up- or downwards, -// depending on whether the previous fetch completed in time. -func (p *peer) SetReceiptsIdle() { - p.setIdle(p.receiptStarted, receiptSoftTTL, receiptHardTTL, MaxReceiptFetch, &p.receiptCapacity, &p.receiptIdle) +// SetReceiptsIdle sets the peer to idle, allowing it to execute new receipt +// retrieval requests. Its estimated receipt retrieval throughput is updated +// with that measured just now. +func (p *peer) SetReceiptsIdle(delivered int) { + p.setIdle(p.receiptStarted, delivered, &p.receiptThroughput, &p.receiptIdle) } -// SetNodeDataIdle sets the peer to idle, allowing it to execute new retrieval -// requests. Its node data retrieval allowance will also be updated either up- or -// downwards, depending on whether the previous fetch completed in time. -func (p *peer) SetNodeDataIdle() { - p.setIdle(p.stateStarted, stateSoftTTL, stateSoftTTL, MaxStateFetch, &p.stateCapacity, &p.stateIdle) +// SetNodeDataIdle sets the peer to idle, allowing it to execute new state trie +// data retrieval requests. Its estimated state retrieval throughput is updated +// with that measured just now. +func (p *peer) SetNodeDataIdle(delivered int) { + p.setIdle(p.stateStarted, delivered, &p.stateThroughput, &p.stateIdle) } // setIdle sets the peer to idle, allowing it to execute new retrieval requests. -// Its data retrieval allowance will also be updated either up- or downwards, -// depending on whether the previous fetch completed in time. -func (p *peer) setIdle(started time.Time, softTTL, hardTTL time.Duration, maxFetch int, capacity, idle *int32) { - // Update the peer's download allowance based on previous performance - scale := 2.0 - if time.Since(started) > softTTL { - scale = 0.5 - if time.Since(started) > hardTTL { - scale = 1 / float64(maxFetch) // reduces capacity to 1 - } - } - for { - // Calculate the new download bandwidth allowance - prev := atomic.LoadInt32(capacity) - next := int32(math.Max(1, math.Min(float64(maxFetch), float64(prev)*scale))) - - // Try to update the old value - if atomic.CompareAndSwapInt32(capacity, prev, next) { - // If we're having problems at 1 capacity, try to find better peers - if next == 1 { - p.Demote() - } - break - } +// Its estimated retrieval throughput is updated with that measured just now. +func (p *peer) setIdle(started time.Time, delivered int, throughput *float64, idle *int32) { + // Irrelevant of the scaling, make sure the peer ends up idle + defer atomic.StoreInt32(idle, 0) + + p.lock.RLock() + defer p.lock.RUnlock() + + // If nothing was delivered (hard timeout / unavailable data), reduce throughput to minimum + if delivered == 0 { + *throughput = 0 + return } - // Set the peer to idle to allow further fetch requests - atomic.StoreInt32(idle, 0) + // Otherwise update the throughput with a new measurement + measured := float64(delivered) / (float64(time.Since(started)+1) / float64(time.Second)) // +1 (ns) to ensure non-zero divisor + *throughput = (1-throughputImpact)*(*throughput) + throughputImpact*measured } // BlockCapacity retrieves the peers block download allowance based on its -// previously discovered bandwidth capacity. +// previously discovered throughput. func (p *peer) BlockCapacity() int { - return int(atomic.LoadInt32(&p.blockCapacity)) -} + p.lock.RLock() + defer p.lock.RUnlock() -// ReceiptCapacity retrieves the peers block download allowance based on its -// previously discovered bandwidth capacity. -func (p *peer) ReceiptCapacity() int { - return int(atomic.LoadInt32(&p.receiptCapacity)) + return int(math.Max(1, math.Min(p.blockThroughput*float64(blockTargetRTT)/float64(time.Second), float64(MaxBlockFetch)))) } -// NodeDataCapacity retrieves the peers block download allowance based on its -// previously discovered bandwidth capacity. -func (p *peer) NodeDataCapacity() int { - return int(atomic.LoadInt32(&p.stateCapacity)) -} +// ReceiptCapacity retrieves the peers receipt download allowance based on its +// previously discovered throughput. +func (p *peer) ReceiptCapacity() int { + p.lock.RLock() + defer p.lock.RUnlock() -// Promote increases the peer's reputation. -func (p *peer) Promote() { - atomic.AddInt32(&p.rep, 1) + return int(math.Max(1, math.Min(p.receiptThroughput*float64(receiptTargetRTT)/float64(time.Second), float64(MaxReceiptFetch)))) } -// Demote decreases the peer's reputation or leaves it at 0. -func (p *peer) Demote() { - for { - // Calculate the new reputation value - prev := atomic.LoadInt32(&p.rep) - next := prev / 2 +// NodeDataCapacity retrieves the peers state download allowance based on its +// previously discovered throughput. +func (p *peer) NodeDataCapacity() int { + p.lock.RLock() + defer p.lock.RUnlock() - // Try to update the old value - if atomic.CompareAndSwapInt32(&p.rep, prev, next) { - return - } - } + return int(math.Max(1, math.Min(p.stateThroughput*float64(stateTargetRTT)/float64(time.Second), float64(MaxStateFetch)))) } // MarkLacking appends a new entity to the set of items (blocks, receipts, states) // that a peer is known not to have (i.e. have been requested before). If the // set reaches its maximum allowed capacity, items are randomly dropped off. func (p *peer) MarkLacking(hash common.Hash) { - p.lackingLock.Lock() - defer p.lackingLock.Unlock() + p.lock.Lock() + defer p.lock.Unlock() for len(p.lacking) >= maxLackingHashes { for drop, _ := range p.lacking { @@ -330,8 +310,8 @@ func (p *peer) MarkLacking(hash common.Hash) { // Lacks retrieves whether the hash of a blockchain item is on the peers lacking // list (i.e. whether we know that the peer does not have it). func (p *peer) Lacks(hash common.Hash) bool { - p.lackingLock.RLock() - defer p.lackingLock.RUnlock() + p.lock.RLock() + defer p.lock.RUnlock() _, ok := p.lacking[hash] return ok @@ -339,13 +319,13 @@ func (p *peer) Lacks(hash common.Hash) bool { // String implements fmt.Stringer. func (p *peer) String() string { - p.lackingLock.RLock() - defer p.lackingLock.RUnlock() + p.lock.RLock() + defer p.lock.RUnlock() return fmt.Sprintf("Peer %s [%s]", p.id, - fmt.Sprintf("reputation %3d, ", atomic.LoadInt32(&p.rep))+ - fmt.Sprintf("block cap %3d, ", atomic.LoadInt32(&p.blockCapacity))+ - fmt.Sprintf("receipt cap %3d, ", atomic.LoadInt32(&p.receiptCapacity))+ + fmt.Sprintf("blocks %3.2f/s, ", p.blockThroughput)+ + fmt.Sprintf("receipts %3.2f/s, ", p.receiptThroughput)+ + fmt.Sprintf("states %3.2f/s, ", p.stateThroughput)+ fmt.Sprintf("lacking %4d", len(p.lacking)), ) } @@ -377,6 +357,10 @@ func (ps *peerSet) Reset() { // Register injects a new peer into the working set, or returns an error if the // peer is already known. +// +// The method also sets the starting throughput values of the new peer to the +// average of all existing peers, to give it a realistic change of being used +// for data retrievals. func (ps *peerSet) Register(p *peer) error { ps.lock.Lock() defer ps.lock.Unlock() @@ -384,6 +368,20 @@ func (ps *peerSet) Register(p *peer) error { if _, ok := ps.peers[p.id]; ok { return errAlreadyRegistered } + if len(ps.peers) > 0 { + p.blockThroughput, p.receiptThroughput, p.stateThroughput = 0, 0, 0 + + for _, peer := range ps.peers { + peer.lock.RLock() + p.blockThroughput += peer.blockThroughput + p.receiptThroughput += peer.receiptThroughput + p.stateThroughput += peer.stateThroughput + peer.lock.RUnlock() + } + p.blockThroughput /= float64(len(ps.peers)) + p.receiptThroughput /= float64(len(ps.peers)) + p.stateThroughput /= float64(len(ps.peers)) + } ps.peers[p.id] = p return nil } @@ -435,7 +433,12 @@ func (ps *peerSet) BlockIdlePeers() ([]*peer, int) { idle := func(p *peer) bool { return atomic.LoadInt32(&p.blockIdle) == 0 } - return ps.idlePeers(61, 61, idle) + throughput := func(p *peer) float64 { + p.lock.RLock() + defer p.lock.RUnlock() + return p.blockThroughput + } + return ps.idlePeers(61, 61, idle, throughput) } // BodyIdlePeers retrieves a flat list of all the currently body-idle peers within @@ -444,7 +447,12 @@ func (ps *peerSet) BodyIdlePeers() ([]*peer, int) { idle := func(p *peer) bool { return atomic.LoadInt32(&p.blockIdle) == 0 } - return ps.idlePeers(62, 64, idle) + throughput := func(p *peer) float64 { + p.lock.RLock() + defer p.lock.RUnlock() + return p.blockThroughput + } + return ps.idlePeers(62, 64, idle, throughput) } // ReceiptIdlePeers retrieves a flat list of all the currently receipt-idle peers @@ -453,7 +461,12 @@ func (ps *peerSet) ReceiptIdlePeers() ([]*peer, int) { idle := func(p *peer) bool { return atomic.LoadInt32(&p.receiptIdle) == 0 } - return ps.idlePeers(63, 64, idle) + throughput := func(p *peer) float64 { + p.lock.RLock() + defer p.lock.RUnlock() + return p.receiptThroughput + } + return ps.idlePeers(63, 64, idle, throughput) } // NodeDataIdlePeers retrieves a flat list of all the currently node-data-idle @@ -462,12 +475,18 @@ func (ps *peerSet) NodeDataIdlePeers() ([]*peer, int) { idle := func(p *peer) bool { return atomic.LoadInt32(&p.stateIdle) == 0 } - return ps.idlePeers(63, 64, idle) + throughput := func(p *peer) float64 { + p.lock.RLock() + defer p.lock.RUnlock() + return p.stateThroughput + } + return ps.idlePeers(63, 64, idle, throughput) } // idlePeers retrieves a flat list of all currently idle peers satisfying the // protocol version constraints, using the provided function to check idleness. -func (ps *peerSet) idlePeers(minProtocol, maxProtocol int, idleCheck func(*peer) bool) ([]*peer, int) { +// The resulting set of peers are sorted by their measure throughput. +func (ps *peerSet) idlePeers(minProtocol, maxProtocol int, idleCheck func(*peer) bool, throughput func(*peer) float64) ([]*peer, int) { ps.lock.RLock() defer ps.lock.RUnlock() @@ -482,7 +501,7 @@ func (ps *peerSet) idlePeers(minProtocol, maxProtocol int, idleCheck func(*peer) } for i := 0; i < len(idle); i++ { for j := i + 1; j < len(idle); j++ { - if atomic.LoadInt32(&idle[i].rep) < atomic.LoadInt32(&idle[j].rep) { + if throughput(idle[i]) < throughput(idle[j]) { idle[i], idle[j] = idle[j], idle[i] } } diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index 584797d7b..1e55560db 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -703,7 +703,7 @@ func (q *queue) Revoke(peerId string) { // ExpireBlocks checks for in flight requests that exceeded a timeout allowance, // canceling them and returning the responsible peers for penalisation. -func (q *queue) ExpireBlocks(timeout time.Duration) []string { +func (q *queue) ExpireBlocks(timeout time.Duration) map[string]int { q.lock.Lock() defer q.lock.Unlock() @@ -712,7 +712,7 @@ func (q *queue) ExpireBlocks(timeout time.Duration) []string { // ExpireBodies checks for in flight block body requests that exceeded a timeout // allowance, canceling them and returning the responsible peers for penalisation. -func (q *queue) ExpireBodies(timeout time.Duration) []string { +func (q *queue) ExpireBodies(timeout time.Duration) map[string]int { q.lock.Lock() defer q.lock.Unlock() @@ -721,7 +721,7 @@ func (q *queue) ExpireBodies(timeout time.Duration) []string { // ExpireReceipts checks for in flight receipt requests that exceeded a timeout // allowance, canceling them and returning the responsible peers for penalisation. -func (q *queue) ExpireReceipts(timeout time.Duration) []string { +func (q *queue) ExpireReceipts(timeout time.Duration) map[string]int { q.lock.Lock() defer q.lock.Unlock() @@ -730,7 +730,7 @@ func (q *queue) ExpireReceipts(timeout time.Duration) []string { // ExpireNodeData checks for in flight node data requests that exceeded a timeout // allowance, canceling them and returning the responsible peers for penalisation. -func (q *queue) ExpireNodeData(timeout time.Duration) []string { +func (q *queue) ExpireNodeData(timeout time.Duration) map[string]int { q.lock.Lock() defer q.lock.Unlock() @@ -743,9 +743,9 @@ func (q *queue) ExpireNodeData(timeout time.Duration) []string { // Note, this method expects the queue lock to be already held. The // reason the lock is not obtained in here is because the parameters already need // to access the queue, so they already need a lock anyway. -func (q *queue) expire(timeout time.Duration, pendPool map[string]*fetchRequest, taskQueue *prque.Prque, timeoutMeter metrics.Meter) []string { +func (q *queue) expire(timeout time.Duration, pendPool map[string]*fetchRequest, taskQueue *prque.Prque, timeoutMeter metrics.Meter) map[string]int { // Iterate over the expired requests and return each to the queue - peers := []string{} + expiries := make(map[string]int) for id, request := range pendPool { if time.Since(request.Time) > timeout { // Update the metrics with the timeout @@ -758,25 +758,32 @@ func (q *queue) expire(timeout time.Duration, pendPool map[string]*fetchRequest, for _, header := range request.Headers { taskQueue.Push(header, -float32(header.Number.Uint64())) } - peers = append(peers, id) + // Add the peer to the expiry report along the the number of failed requests + expirations := len(request.Hashes) + if expirations < len(request.Headers) { + expirations = len(request.Headers) + } + expiries[id] = expirations } } // Remove the expired requests from the pending pool - for _, id := range peers { + for id, _ := range expiries { delete(pendPool, id) } - return peers + return expiries } -// DeliverBlocks injects a block retrieval response into the download queue. -func (q *queue) DeliverBlocks(id string, blocks []*types.Block) error { +// DeliverBlocks injects a block retrieval response into the download queue. The +// method returns the number of blocks accepted from the delivery and also wakes +// any threads waiting for data delivery. +func (q *queue) DeliverBlocks(id string, blocks []*types.Block) (int, error) { q.lock.Lock() defer q.lock.Unlock() // Short circuit if the blocks were never requested request := q.blockPendPool[id] if request == nil { - return errNoFetchesPending + return 0, errNoFetchesPending } blockReqTimer.UpdateSince(request.Time) delete(q.blockPendPool, id) @@ -788,7 +795,7 @@ func (q *queue) DeliverBlocks(id string, blocks []*types.Block) error { } } // Iterate over the downloaded blocks and add each of them - errs := make([]error, 0) + accepted, errs := 0, make([]error, 0) for _, block := range blocks { // Skip any blocks that were not requested hash := block.Hash() @@ -811,28 +818,33 @@ func (q *queue) DeliverBlocks(id string, blocks []*types.Block) error { delete(request.Hashes, hash) delete(q.hashPool, hash) + accepted++ } // Return all failed or missing fetches to the queue for hash, index := range request.Hashes { q.hashQueue.Push(hash, float32(index)) } // Wake up WaitResults - q.active.Signal() + if accepted > 0 { + q.active.Signal() + } // If none of the blocks were good, it's a stale delivery switch { case len(errs) == 0: - return nil + return accepted, nil case len(errs) == 1 && (errs[0] == errInvalidChain || errs[0] == errInvalidBlock): - return errs[0] + return accepted, errs[0] case len(errs) == len(blocks): - return errStaleDelivery + return accepted, errStaleDelivery default: - return fmt.Errorf("multiple failures: %v", errs) + return accepted, fmt.Errorf("multiple failures: %v", errs) } } // DeliverBodies injects a block body retrieval response into the results queue. -func (q *queue) DeliverBodies(id string, txLists [][]*types.Transaction, uncleLists [][]*types.Header) error { +// The method returns the number of blocks bodies accepted from the delivery and +// also wakes any threads waiting for data delivery. +func (q *queue) DeliverBodies(id string, txLists [][]*types.Transaction, uncleLists [][]*types.Header) (int, error) { q.lock.Lock() defer q.lock.Unlock() @@ -848,7 +860,9 @@ func (q *queue) DeliverBodies(id string, txLists [][]*types.Transaction, uncleLi } // DeliverReceipts injects a receipt retrieval response into the results queue. -func (q *queue) DeliverReceipts(id string, receiptList [][]*types.Receipt) error { +// The method returns the number of transaction receipts accepted from the delivery +// and also wakes any threads waiting for data delivery. +func (q *queue) DeliverReceipts(id string, receiptList [][]*types.Receipt) (int, error) { q.lock.Lock() defer q.lock.Unlock() @@ -867,12 +881,14 @@ func (q *queue) DeliverReceipts(id string, receiptList [][]*types.Receipt) error // Note, this method expects the queue lock to be already held for writing. The // reason the lock is not obtained in here is because the parameters already need // to access the queue, so they already need a lock anyway. -func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header, taskQueue *prque.Prque, pendPool map[string]*fetchRequest, - donePool map[common.Hash]struct{}, reqTimer metrics.Timer, results int, reconstruct func(header *types.Header, index int, result *fetchResult) error) error { +func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header, taskQueue *prque.Prque, + pendPool map[string]*fetchRequest, donePool map[common.Hash]struct{}, reqTimer metrics.Timer, + results int, reconstruct func(header *types.Header, index int, result *fetchResult) error) (int, error) { + // Short circuit if the data was never requested request := pendPool[id] if request == nil { - return errNoFetchesPending + return 0, errNoFetchesPending } reqTimer.UpdateSince(request.Time) delete(pendPool, id) @@ -885,8 +901,9 @@ func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header, taskQ } // Assemble each of the results with their headers and retrieved data parts var ( - failure error - useful bool + accepted int + failure error + useful bool ) for i, header := range request.Headers { // Short circuit assembly if no more fetch results are found @@ -906,6 +923,7 @@ func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header, taskQ donePool[header.Hash()] = struct{}{} q.resultCache[index].Pending-- useful = true + accepted++ // Clean up a successful fetch request.Headers[i] = nil @@ -918,27 +936,31 @@ func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header, taskQ } } // Wake up WaitResults - q.active.Signal() + if accepted > 0 { + q.active.Signal() + } // If none of the data was good, it's a stale delivery switch { case failure == nil || failure == errInvalidChain: - return failure + return accepted, failure case useful: - return fmt.Errorf("partial failure: %v", failure) + return accepted, fmt.Errorf("partial failure: %v", failure) default: - return errStaleDelivery + return accepted, errStaleDelivery } } // DeliverNodeData injects a node state data retrieval response into the queue. -func (q *queue) DeliverNodeData(id string, data [][]byte, callback func(error, int)) error { +// The method returns the number of node state entries originally requested, and +// the number of them actually accepted from the delivery. +func (q *queue) DeliverNodeData(id string, data [][]byte, callback func(error, int)) (int, error) { q.lock.Lock() defer q.lock.Unlock() // Short circuit if the data was never requested request := q.statePendPool[id] if request == nil { - return errNoFetchesPending + return 0, errNoFetchesPending } stateReqTimer.UpdateSince(request.Time) delete(q.statePendPool, id) @@ -950,10 +972,10 @@ func (q *queue) DeliverNodeData(id string, data [][]byte, callback func(error, i } } // Iterate over the downloaded data and verify each of them - errs := make([]error, 0) + accepted, errs := 0, make([]error, 0) process := []trie.SyncResult{} for _, blob := range data { - // Skip any blocks that were not requested + // Skip any state trie entires that were not requested hash := common.BytesToHash(crypto.Sha3(blob)) if _, ok := request.Hashes[hash]; !ok { errs = append(errs, fmt.Errorf("non-requested state data %x", hash)) @@ -961,6 +983,7 @@ func (q *queue) DeliverNodeData(id string, data [][]byte, callback func(error, i } // Inject the next state trie item into the processing queue process = append(process, trie.SyncResult{hash, blob}) + accepted++ delete(request.Hashes, hash) delete(q.stateTaskPool, hash) @@ -978,11 +1001,11 @@ func (q *queue) DeliverNodeData(id string, data [][]byte, callback func(error, i // If none of the data items were good, it's a stale delivery switch { case len(errs) == 0: - return nil + return accepted, nil case len(errs) == len(request.Hashes): - return errStaleDelivery + return accepted, errStaleDelivery default: - return fmt.Errorf("multiple failures: %v", errs) + return accepted, fmt.Errorf("multiple failures: %v", errs) } } diff --git a/rpc/api/eth.go b/rpc/api/eth.go index b84ae31da..db7a643d8 100644 --- a/rpc/api/eth.go +++ b/rpc/api/eth.go @@ -26,6 +26,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/natspec" "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc/codec" "github.com/ethereum/go-ethereum/rpc/shared" "github.com/ethereum/go-ethereum/xeth" @@ -70,8 +71,10 @@ var ( "eth_getCode": (*ethApi).GetData, "eth_getNatSpec": (*ethApi).GetNatSpec, "eth_sign": (*ethApi).Sign, - "eth_sendRawTransaction": (*ethApi).SendRawTransaction, + "eth_sendRawTransaction": (*ethApi).SubmitTransaction, + "eth_submitTransaction": (*ethApi).SubmitTransaction, "eth_sendTransaction": (*ethApi).SendTransaction, + "eth_signTransaction": (*ethApi).SignTransaction, "eth_transact": (*ethApi).SendTransaction, "eth_estimateGas": (*ethApi).EstimateGas, "eth_call": (*ethApi).Call, @@ -285,7 +288,7 @@ func (self *ethApi) Sign(req *shared.Request) (interface{}, error) { return v, nil } -func (self *ethApi) SendRawTransaction(req *shared.Request) (interface{}, error) { +func (self *ethApi) SubmitTransaction(req *shared.Request) (interface{}, error) { args := new(NewDataArgs) if err := self.codec.Decode(req.Params, &args); err != nil { return nil, shared.NewDecodeParamError(err.Error()) @@ -298,6 +301,45 @@ func (self *ethApi) SendRawTransaction(req *shared.Request) (interface{}, error) return v, nil } +// JsonTransaction is returned as response by the JSON RPC. It contains the +// signed RLP encoded transaction as Raw and the signed transaction object as Tx. +type JsonTransaction struct { + Raw string `json:"raw"` + Tx *tx `json:"tx"` +} + +func (self *ethApi) SignTransaction(req *shared.Request) (interface{}, error) { + args := new(NewTxArgs) + if err := self.codec.Decode(req.Params, &args); err != nil { + return nil, shared.NewDecodeParamError(err.Error()) + } + + // nonce may be nil ("guess" mode) + var nonce string + if args.Nonce != nil { + nonce = args.Nonce.String() + } + + var gas, price string + if args.Gas != nil { + gas = args.Gas.String() + } + if args.GasPrice != nil { + price = args.GasPrice.String() + } + tx, err := self.xeth.SignTransaction(args.From, args.To, nonce, args.Value.String(), gas, price, args.Data) + if err != nil { + return nil, err + } + + data, err := rlp.EncodeToBytes(tx) + if err != nil { + return nil, err + } + + return JsonTransaction{"0x" + common.Bytes2Hex(data), newTx(tx)}, nil +} + func (self *ethApi) SendTransaction(req *shared.Request) (interface{}, error) { args := new(NewTxArgs) if err := self.codec.Decode(req.Params, &args); err != nil { diff --git a/rpc/api/eth_js.go b/rpc/api/eth_js.go index 75c103c9d..dfc104ad8 100644 --- a/rpc/api/eth_js.go +++ b/rpc/api/eth_js.go @@ -36,11 +36,23 @@ web3._extend({ params: 3, inputFormatter: [web3._extend.formatters.inputTransactionFormatter, web3._extend.utils.fromDecimal, web3._extend.utils.fromDecimal] }), - new web3._extend.Method({ - name: 'getNatSpec', - call: 'eth_getNatSpec', - params: 1, - inputFormatter: [web3._extend.formatters.inputTransactionFormatter] + new web3._extend.Method({ + name: 'getNatSpec', + call: 'eth_getNatSpec', + params: 1, + inputFormatter: [web3._extend.formatters.inputTransactionFormatter] + }), + new web3._extend.Method({ + name: 'signTransaction', + call: 'eth_signTransaction', + params: 1, + inputFormatter: [web3._extend.formatters.inputTransactionFormatter] + }), + new web3._extend.Method({ + name: 'submitTransaction', + call: 'eth_submitTransaction', + params: 1, + inputFormatter: [web3._extend.formatters.inputTransactionFormatter] }) ], properties: diff --git a/tests/files/BlockchainTests/bcStateTest.json b/tests/files/BlockchainTests/bcStateTest.json index 42a178883..60a15a426 100644 --- a/tests/files/BlockchainTests/bcStateTest.json +++ b/tests/files/BlockchainTests/bcStateTest.json @@ -1,4 +1,631 @@ { + "CallingCanonicalContractFromFork" : { + "blocks" : [ + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x5208", + "hash" : "08b3bb56fceaec4428db828727f8ca3eccdf8dd6dc88fea30cac27d3fe8e8bc5", + "mixHash" : "d32d3ce5a29831d92e4d13bbad10d98b7aa3e268a261be29e6126922a2b65ce6", + "nonce" : "5f767835b991d998", + "number" : "0x01", + "parentHash" : "11538dc3be8edb7ac03d9ab9c58ee0348da65149545a42629322e5d577cfb337", + "receiptTrie" : "c741e9eaf5604d654d46a98cb267ecad8d26090f5a401ec1ac75097974fe83a5", + "stateRoot" : "9e502a6b6dbf7dfd743afe836af2d74e42fdfb0a58a18512d8c984d8f60612a1", + "timestamp" : "0x563500da", + "transactionsTrie" : "f80217763f8d00269566918ebd3c7729465f8b9818a0f437bf215a8190884d5d", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "1", + "chainname" : "A", + "rlp" : "0xf90261f901f9a011538dc3be8edb7ac03d9ab9c58ee0348da65149545a42629322e5d577cfb337a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a09e502a6b6dbf7dfd743afe836af2d74e42fdfb0a58a18512d8c984d8f60612a1a0f80217763f8d00269566918ebd3c7729465f8b9818a0f437bf215a8190884d5da0c741e9eaf5604d654d46a98cb267ecad8d26090f5a401ec1ac75097974fe83a5b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001832fefd882520884563500da80a0d32d3ce5a29831d92e4d13bbad10d98b7aa3e268a261be29e6126922a2b65ce6885f767835b991d998f862f86080018304cb2f94a95e7baea6a6c7c4c2dfeb977efac326af552d870a801ca0886931af2e4e440628e6e862e50944534ff3068c38cabb908dc708fa3736bfe0a03de874195b35641546d6c48409cca106127e5260a67fe7ed21a35dfb1f7a08b5c0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x00", + "r" : "0x886931af2e4e440628e6e862e50944534ff3068c38cabb908dc708fa3736bfe0", + "s" : "0x3de874195b35641546d6c48409cca106127e5260a67fe7ed21a35dfb1f7a08b5", + "to" : "a95e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1c", + "value" : "0x0a" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020040", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0xc0e3", + "hash" : "e3818b1951de8955f7e82faec0ce6116a68831398fe37d5d903946096769916f", + "mixHash" : "1005a7308338af66d2d078df0bbcb722aa23f02a565c1eb64c5cc49dcf197680", + "nonce" : "7a19e455210a4238", + "number" : "0x02", + "parentHash" : "08b3bb56fceaec4428db828727f8ca3eccdf8dd6dc88fea30cac27d3fe8e8bc5", + "receiptTrie" : "50d84f1a0c328748578441d1e31280248c629d8e83e3415e6a0493147f065435", + "stateRoot" : "f6116978d1ac80e6a6b27996b35410d388b51a7898250b709a1320a0414e1ead", + "timestamp" : "0x563500dd", + "transactionsTrie" : "73605c813df801dea03161bc2f66993a59f86babc47efa9d0e952bc79a26fabd", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "2", + "chainname" : "A", + "rlp" : "0xf902ccf901f9a008b3bb56fceaec4428db828727f8ca3eccdf8dd6dc88fea30cac27d3fe8e8bc5a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0f6116978d1ac80e6a6b27996b35410d388b51a7898250b709a1320a0414e1eada073605c813df801dea03161bc2f66993a59f86babc47efa9d0e952bc79a26fabda050d84f1a0c328748578441d1e31280248c629d8e83e3415e6a0493147f065435b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302004002832fefd882c0e384563500dd80a01005a7308338af66d2d078df0bbcb722aa23f02a565c1eb64c5cc49dcf197680887a19e455210a4238f8cdf8cb01018304cb2f8080b87e6060604052606e8060106000396000f360606040526000357c010000000000000000000000000000000000000000000000000000000090048063c0406226146037576035565b005b60406004506056565b6040518082815260200191505060405180910390f35b6000600560006000508190555060059050606b565b90561ca0b5a59222c12d3a9d52fddef1c7881a0dc7e72f5aed83be3cd7d7fdf868ec92a2a0551fea14e12dc99b6d78884bf5f0edae2da6ad4102d955057251d5d2aa8f54a5c0", + "transactions" : [ + { + "data" : "0x6060604052606e8060106000396000f360606040526000357c010000000000000000000000000000000000000000000000000000000090048063c0406226146037576035565b005b60406004506056565b6040518082815260200191505060405180910390f35b6000600560006000508190555060059050606b565b9056", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x01", + "r" : "0xb5a59222c12d3a9d52fddef1c7881a0dc7e72f5aed83be3cd7d7fdf868ec92a2", + "s" : "0x551fea14e12dc99b6d78884bf5f0edae2da6ad4102d955057251d5d2aa8f54a5", + "to" : "", + "v" : "0x1c", + "value" : "0x00" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x0169ee", + "hash" : "79423c013354dae6981d6739e3aaadc0a56b475ba241eb6c49494eee065f0aae", + "mixHash" : "f06fb582b789bb3c80c68b6151c91e96ed722ce38ba356e09d77d1378176bdb6", + "nonce" : "44585532f822bbd1", + "number" : "0x03", + "parentHash" : "e3818b1951de8955f7e82faec0ce6116a68831398fe37d5d903946096769916f", + "receiptTrie" : "1425974449f0fb4847ac5307c8a8d22b240387fc68993f0b9c485b118959eb10", + "stateRoot" : "92fd648d9e8a574b0b7d70bb9bff176067f319d9753871f9cf3c27d704cc9cc7", + "timestamp" : "0x563500f5", + "transactionsTrie" : "9a5ba001326af3fd741edc763f3f0830c71a28e55a0a461d455792c2ad4918fe", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "3", + "chainname" : "A", + "rlp" : "0xf902c4f901faa0e3818b1951de8955f7e82faec0ce6116a68831398fe37d5d903946096769916fa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a092fd648d9e8a574b0b7d70bb9bff176067f319d9753871f9cf3c27d704cc9cc7a09a5ba001326af3fd741edc763f3f0830c71a28e55a0a461d455792c2ad4918fea01425974449f0fb4847ac5307c8a8d22b240387fc68993f0b9c485b118959eb10b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000003832fefd8830169ee84563500f580a0f06fb582b789bb3c80c68b6151c91e96ed722ce38ba356e09d77d1378176bdb68844585532f822bbd1f8c4f86002018304cb2f94095e7baea6a6c7c4c2dfeb977efac326af552d870a801ca015eb1cc916728b9799e55c489857727669afb2986433d5f54cde11faaed9f0eea05d36f6d06c34aae8d0a2a5895c8ba4a17ad46a5fa59f361cb3e7e01a23030e38f86003018304cb2f94095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba0a7b7f2fa93025fc1e6aa18c1aa07c32a456439754e196cb74f2f7d12cf3e840da02078cf840fb25fc3d858b2a85b622f21be0588b5c5d81d433427f6470e06a4a7c0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x02", + "r" : "0x15eb1cc916728b9799e55c489857727669afb2986433d5f54cde11faaed9f0ee", + "s" : "0x5d36f6d06c34aae8d0a2a5895c8ba4a17ad46a5fa59f361cb3e7e01a23030e38", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1c", + "value" : "0x0a" + }, + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x03", + "r" : "0xa7b7f2fa93025fc1e6aa18c1aa07c32a456439754e196cb74f2f7d12cf3e840d", + "s" : "0x2078cf840fb25fc3d858b2a85b622f21be0588b5c5d81d433427f6470e06a4a7", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1b", + "value" : "0x0a" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x5208", + "hash" : "e0efde98e5a863413548be4bd0c7d95c403eb429f6480bbc54acd9ae993e6b29", + "mixHash" : "07eb27e1868f9956f1d60a12b653f1c8b6818e3ac8a25eaf8b1e4d91cb9b63b8", + "nonce" : "00b284c1d142e0ae", + "number" : "0x01", + "parentHash" : "11538dc3be8edb7ac03d9ab9c58ee0348da65149545a42629322e5d577cfb337", + "receiptTrie" : "f8b9bd0dc083e4c553e1a34ab265f74754b999e34b87ce68f034e4bd775ec3cc", + "stateRoot" : "8d6a64bdf95c29dcc72ccae2affaf8842208c7387434a53153991e6368f1c30a", + "timestamp" : "0x563500fb", + "transactionsTrie" : "da4ff51d21fb53978f91cc0bae0c01cfe4ed3485b999e4ef55d16441198223b5", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "1", + "chainname" : "B", + "rlp" : "0xf90261f901f9a011538dc3be8edb7ac03d9ab9c58ee0348da65149545a42629322e5d577cfb337a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a08d6a64bdf95c29dcc72ccae2affaf8842208c7387434a53153991e6368f1c30aa0da4ff51d21fb53978f91cc0bae0c01cfe4ed3485b999e4ef55d16441198223b5a0f8b9bd0dc083e4c553e1a34ab265f74754b999e34b87ce68f034e4bd775ec3ccb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001832fefd882520884563500fb80a007eb27e1868f9956f1d60a12b653f1c8b6818e3ac8a25eaf8b1e4d91cb9b63b88800b284c1d142e0aef862f86080018304cb2f94a95e7baea6a6c7c4c2dfeb977efac326af552d8764801ba08d9a64385e3a24e9f6fdd49256c9f7d23cd501deaa55c5b4283fc58b2a601039a02518fdccd38aa1caaf4b49c907f750961f325d3d70104a22700b16d9af0d0557c0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x00", + "r" : "0x8d9a64385e3a24e9f6fdd49256c9f7d23cd501deaa55c5b4283fc58b2a601039", + "s" : "0x2518fdccd38aa1caaf4b49c907f750961f325d3d70104a22700b16d9af0d0557", + "to" : "a95e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1b", + "value" : "0x64" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020040", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x01025f", + "hash" : "96ede2056e2a24ae0fd06a7396eacd31d3309b4da2d96b0eeab4a33e7cbc4df3", + "mixHash" : "9969bbd7cfb5b96d099f1cdf644fb40db340df09ceafec9305283a1900a42163", + "nonce" : "e56a1b4bf99b697e", + "number" : "0x02", + "parentHash" : "e0efde98e5a863413548be4bd0c7d95c403eb429f6480bbc54acd9ae993e6b29", + "receiptTrie" : "f18320a96d546803b8d0012e76cece8c69b214a2e4e5bf6e4134d638b16ab8e7", + "stateRoot" : "a9bb042145dda02ecae18f10f60f8d139933c7e2aa03747c9a6e50a1d823becd", + "timestamp" : "0x563500fc", + "transactionsTrie" : "7d90b54544a650e638e06d360a7dc2eee226c40373df61476b792ca3eccae35b", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "2", + "chainname" : "B", + "rlp" : "0xf90262f901faa0e0efde98e5a863413548be4bd0c7d95c403eb429f6480bbc54acd9ae993e6b29a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0a9bb042145dda02ecae18f10f60f8d139933c7e2aa03747c9a6e50a1d823becda07d90b54544a650e638e06d360a7dc2eee226c40373df61476b792ca3eccae35ba0f18320a96d546803b8d0012e76cece8c69b214a2e4e5bf6e4134d638b16ab8e7b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302004002832fefd88301025f84563500fc80a09969bbd7cfb5b96d099f1cdf644fb40db340df09ceafec9305283a1900a4216388e56a1b4bf99b697ef862f86001018304bb2b94095e7baea6a6c7c4c2dfeb977efac326af552d8764801ca0b66e1a2ee26689bdbb87af26141f167ded19e6b2041407bf4f80a36ce30a1b1ba0084e5def3deddc4ba0bd7dd8cebf184a8c3a3c2d5d9af5cb642bdf819d2e0be4c0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04bb2b", + "gasPrice" : "0x01", + "nonce" : "0x01", + "r" : "0xb66e1a2ee26689bdbb87af26141f167ded19e6b2041407bf4f80a36ce30a1b1b", + "s" : "0x084e5def3deddc4ba0bd7dd8cebf184a8c3a3c2d5d9af5cb642bdf819d2e0be4", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1c", + "value" : "0x64" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020080", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x661f", + "hash" : "9bada2849d859f3b9167460ad6a271334634a701f45ed993ceb21713f3b1ac90", + "mixHash" : "bdec38b76b56d641e8f66d8d25ac4b9e974770840eddf2b739a6c06f0b3cddd4", + "nonce" : "b74dd27326e79e4e", + "number" : "0x03", + "parentHash" : "96ede2056e2a24ae0fd06a7396eacd31d3309b4da2d96b0eeab4a33e7cbc4df3", + "receiptTrie" : "e9ac391e5acbde6dcfd8b2818b7624c8a8898130b39c6189ad1578a634e3c9af", + "stateRoot" : "6f2a96e71df732554404f93d6aa1000eb4fd7160d86b9223f72d6cb74247b5e3", + "timestamp" : "0x56350100", + "transactionsTrie" : "2bcc69b52ae6b6e2aca544608d302ea49078786bdc26a35220b67c81fa39b996", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "3", + "chainname" : "B", + "rlp" : "0xf90261f901f9a096ede2056e2a24ae0fd06a7396eacd31d3309b4da2d96b0eeab4a33e7cbc4df3a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a06f2a96e71df732554404f93d6aa1000eb4fd7160d86b9223f72d6cb74247b5e3a02bcc69b52ae6b6e2aca544608d302ea49078786bdc26a35220b67c81fa39b996a0e9ac391e5acbde6dcfd8b2818b7624c8a8898130b39c6189ad1578a634e3c9afb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302008003832fefd882661f845635010080a0bdec38b76b56d641e8f66d8d25ac4b9e974770840eddf2b739a6c06f0b3cddd488b74dd27326e79e4ef862f86002018304bb2b94095e7baea6a6c7c4c2dfeb977efac326af552d8764801ba09e440c52e3bbb810164fb44c2f5b1882b5e9ae50a072737fe74a0a9152f7b973a070d7c1e0cb08639654481bdb953f7f73e4c16f75db1f7bb62fa2ce82bc4801c5c0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04bb2b", + "gasPrice" : "0x01", + "nonce" : "0x02", + "r" : "0x9e440c52e3bbb810164fb44c2f5b1882b5e9ae50a072737fe74a0a9152f7b973", + "s" : "0x70d7c1e0cb08639654481bdb953f7f73e4c16f75db1f7bb62fa2ce82bc4801c5", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1b", + "value" : "0x64" + } + ], + "uncleHeaders" : [ + ] + } + ], + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x42", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x00", + "hash" : "11538dc3be8edb7ac03d9ab9c58ee0348da65149545a42629322e5d577cfb337", + "mixHash" : "7f405d76c550214b6b136eab04f4ccc018cdc4332aaff9a56ec082639e1280c1", + "nonce" : "8ab5a8979e9af8ec", + "number" : "0x00", + "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "c6f1b420417bb444dff74db6be80197fee3ad9829cd462cfbe316af263556604", + "timestamp" : "0x54c98c81", + "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "genesisRLP" : "0xf901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0c6f1b420417bb444dff74db6be80197fee3ad9829cd462cfbe316af263556604a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000080832fefd8808454c98c8142a07f405d76c550214b6b136eab04f4ccc018cdc4332aaff9a56ec082639e1280c1888ab5a8979e9af8ecc0c0", + "lastblockhash" : "9bada2849d859f3b9167460ad6a271334634a701f45ed993ceb21713f3b1ac90", + "postState" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x09184e72a0c8", + "code" : "0x63c0406226600052604060006004601c600073ec0e71ad0a90ffe1909d27dac207f7680abba42d620249f0f15060005160015401600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0x018080c44c" + } + }, + "8888f1f195afa192cfee860698584c030f4c9db1" : { + "balance" : "0xd02ab486ceddba86", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x09184e70e44e", + "code" : "0x", + "nonce" : "0x03", + "storage" : { + } + }, + "a95e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x64", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { + "balance" : "0x00", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x09184e72a000", + "code" : "0x63c0406226600052604060006004601c600073ec0e71ad0a90ffe1909d27dac207f7680abba42d620249f0f15060005160015401600155", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x09184e72a000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + } + }, + "CallingCanonicalContractFromFork_CALLCODE" : { + "blocks" : [ + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x5208", + "hash" : "0ad1f4a43ccdcb63b96e7b311587288463717733b64545c0333ccbdc089688d5", + "mixHash" : "d464d3d8c2cf63b4ebdf6ad3218091b22e1a422407dfe7ea3822f8ce1abee51f", + "nonce" : "0e656c789a5bfc31", + "number" : "0x01", + "parentHash" : "e4a20be00ea735fa164d36b5445910a424fe1daa7104ae1ac4b4493c83f4141f", + "receiptTrie" : "f8cb5639e2463803ae389081e9857729b32ad5b48fb02240727315eb175b10e3", + "stateRoot" : "62b7f69b376d3aafc54235bc38e5e94b5972b663b4a76b3742ff513c67f1eb57", + "timestamp" : "0x5635010b", + "transactionsTrie" : "f80217763f8d00269566918ebd3c7729465f8b9818a0f437bf215a8190884d5d", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "1", + "chainname" : "A", + "rlp" : "0xf90261f901f9a0e4a20be00ea735fa164d36b5445910a424fe1daa7104ae1ac4b4493c83f4141fa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a062b7f69b376d3aafc54235bc38e5e94b5972b663b4a76b3742ff513c67f1eb57a0f80217763f8d00269566918ebd3c7729465f8b9818a0f437bf215a8190884d5da0f8cb5639e2463803ae389081e9857729b32ad5b48fb02240727315eb175b10e3b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001832fefd8825208845635010b80a0d464d3d8c2cf63b4ebdf6ad3218091b22e1a422407dfe7ea3822f8ce1abee51f880e656c789a5bfc31f862f86080018304cb2f94a95e7baea6a6c7c4c2dfeb977efac326af552d870a801ca0886931af2e4e440628e6e862e50944534ff3068c38cabb908dc708fa3736bfe0a03de874195b35641546d6c48409cca106127e5260a67fe7ed21a35dfb1f7a08b5c0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x00", + "r" : "0x886931af2e4e440628e6e862e50944534ff3068c38cabb908dc708fa3736bfe0", + "s" : "0x3de874195b35641546d6c48409cca106127e5260a67fe7ed21a35dfb1f7a08b5", + "to" : "a95e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1c", + "value" : "0x0a" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020040", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0xc0e3", + "hash" : "bc38e64180176dc9671f4f955427578094be1a7f5682fb0b85547ee5586f0347", + "mixHash" : "a4bb1397f2bbb7b1dd44e429ad3769b85509d3bddd5f3f689f759df02490e6ec", + "nonce" : "230961e372de074e", + "number" : "0x02", + "parentHash" : "0ad1f4a43ccdcb63b96e7b311587288463717733b64545c0333ccbdc089688d5", + "receiptTrie" : "26fe765a9578e9cfb12c8190b5ecdc381db59701306072a628c383ef1e18600d", + "stateRoot" : "3abf60a0b953f13e0f59e28b70cd5d2b4f706b2da26a7d2e0b3706ed52347b64", + "timestamp" : "0x5635010d", + "transactionsTrie" : "73605c813df801dea03161bc2f66993a59f86babc47efa9d0e952bc79a26fabd", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "2", + "chainname" : "A", + "rlp" : "0xf902ccf901f9a00ad1f4a43ccdcb63b96e7b311587288463717733b64545c0333ccbdc089688d5a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a03abf60a0b953f13e0f59e28b70cd5d2b4f706b2da26a7d2e0b3706ed52347b64a073605c813df801dea03161bc2f66993a59f86babc47efa9d0e952bc79a26fabda026fe765a9578e9cfb12c8190b5ecdc381db59701306072a628c383ef1e18600db90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302004002832fefd882c0e3845635010d80a0a4bb1397f2bbb7b1dd44e429ad3769b85509d3bddd5f3f689f759df02490e6ec88230961e372de074ef8cdf8cb01018304cb2f8080b87e6060604052606e8060106000396000f360606040526000357c010000000000000000000000000000000000000000000000000000000090048063c0406226146037576035565b005b60406004506056565b6040518082815260200191505060405180910390f35b6000600560006000508190555060059050606b565b90561ca0b5a59222c12d3a9d52fddef1c7881a0dc7e72f5aed83be3cd7d7fdf868ec92a2a0551fea14e12dc99b6d78884bf5f0edae2da6ad4102d955057251d5d2aa8f54a5c0", + "transactions" : [ + { + "data" : "0x6060604052606e8060106000396000f360606040526000357c010000000000000000000000000000000000000000000000000000000090048063c0406226146037576035565b005b60406004506056565b6040518082815260200191505060405180910390f35b6000600560006000508190555060059050606b565b9056", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x01", + "r" : "0xb5a59222c12d3a9d52fddef1c7881a0dc7e72f5aed83be3cd7d7fdf868ec92a2", + "s" : "0x551fea14e12dc99b6d78884bf5f0edae2da6ad4102d955057251d5d2aa8f54a5", + "to" : "", + "v" : "0x1c", + "value" : "0x00" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x0169ee", + "hash" : "62b2eb4d783709651581d6b29268e8d27ef0e5698db3a47b77391f072e2f1da0", + "mixHash" : "6b26b2021169267ae324b57e08acd817311f9b4f17caf5534594c8e8317b23cf", + "nonce" : "eb64fbe044331a43", + "number" : "0x03", + "parentHash" : "bc38e64180176dc9671f4f955427578094be1a7f5682fb0b85547ee5586f0347", + "receiptTrie" : "f18604ae1541250e60873accc7ef540ef0c2d643fe412f8c0d71dd96719060e3", + "stateRoot" : "34aa6cf4783c74854567e87a0da34cda048d974efcd66a87f80ea7677b319bb5", + "timestamp" : "0x56350125", + "transactionsTrie" : "9a5ba001326af3fd741edc763f3f0830c71a28e55a0a461d455792c2ad4918fe", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "3", + "chainname" : "A", + "rlp" : "0xf902c4f901faa0bc38e64180176dc9671f4f955427578094be1a7f5682fb0b85547ee5586f0347a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a034aa6cf4783c74854567e87a0da34cda048d974efcd66a87f80ea7677b319bb5a09a5ba001326af3fd741edc763f3f0830c71a28e55a0a461d455792c2ad4918fea0f18604ae1541250e60873accc7ef540ef0c2d643fe412f8c0d71dd96719060e3b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000003832fefd8830169ee845635012580a06b26b2021169267ae324b57e08acd817311f9b4f17caf5534594c8e8317b23cf88eb64fbe044331a43f8c4f86002018304cb2f94095e7baea6a6c7c4c2dfeb977efac326af552d870a801ca015eb1cc916728b9799e55c489857727669afb2986433d5f54cde11faaed9f0eea05d36f6d06c34aae8d0a2a5895c8ba4a17ad46a5fa59f361cb3e7e01a23030e38f86003018304cb2f94095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba0a7b7f2fa93025fc1e6aa18c1aa07c32a456439754e196cb74f2f7d12cf3e840da02078cf840fb25fc3d858b2a85b622f21be0588b5c5d81d433427f6470e06a4a7c0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x02", + "r" : "0x15eb1cc916728b9799e55c489857727669afb2986433d5f54cde11faaed9f0ee", + "s" : "0x5d36f6d06c34aae8d0a2a5895c8ba4a17ad46a5fa59f361cb3e7e01a23030e38", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1c", + "value" : "0x0a" + }, + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x03", + "r" : "0xa7b7f2fa93025fc1e6aa18c1aa07c32a456439754e196cb74f2f7d12cf3e840d", + "s" : "0x2078cf840fb25fc3d858b2a85b622f21be0588b5c5d81d433427f6470e06a4a7", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1b", + "value" : "0x0a" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x5208", + "hash" : "2bd5b44505f34000b3eb344a4884e7fee6f320a2ee50d64c150a804c66e09f7b", + "mixHash" : "e6057734a7878e44f7a825f57d1a750cc468a6fe4426501b4cd1254e8905962e", + "nonce" : "5ec9808a5ccff56b", + "number" : "0x01", + "parentHash" : "e4a20be00ea735fa164d36b5445910a424fe1daa7104ae1ac4b4493c83f4141f", + "receiptTrie" : "6e53faca3f080356ccc2032164edd80302217bb9febba7ef38f0198b32cfc598", + "stateRoot" : "6b3b817b850fbe23731c5f9f0a49780cb371aff4cd34dddf231b0ba0159a556a", + "timestamp" : "0x5635012a", + "transactionsTrie" : "da4ff51d21fb53978f91cc0bae0c01cfe4ed3485b999e4ef55d16441198223b5", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "1", + "chainname" : "B", + "rlp" : "0xf90261f901f9a0e4a20be00ea735fa164d36b5445910a424fe1daa7104ae1ac4b4493c83f4141fa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a06b3b817b850fbe23731c5f9f0a49780cb371aff4cd34dddf231b0ba0159a556aa0da4ff51d21fb53978f91cc0bae0c01cfe4ed3485b999e4ef55d16441198223b5a06e53faca3f080356ccc2032164edd80302217bb9febba7ef38f0198b32cfc598b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001832fefd8825208845635012a80a0e6057734a7878e44f7a825f57d1a750cc468a6fe4426501b4cd1254e8905962e885ec9808a5ccff56bf862f86080018304cb2f94a95e7baea6a6c7c4c2dfeb977efac326af552d8764801ba08d9a64385e3a24e9f6fdd49256c9f7d23cd501deaa55c5b4283fc58b2a601039a02518fdccd38aa1caaf4b49c907f750961f325d3d70104a22700b16d9af0d0557c0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04cb2f", + "gasPrice" : "0x01", + "nonce" : "0x00", + "r" : "0x8d9a64385e3a24e9f6fdd49256c9f7d23cd501deaa55c5b4283fc58b2a601039", + "s" : "0x2518fdccd38aa1caaf4b49c907f750961f325d3d70104a22700b16d9af0d0557", + "to" : "a95e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1b", + "value" : "0x64" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020040", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0xa0b7", + "hash" : "cdb6183fee864e854f72db8f37f6d4df928a42c48d3640df108334eb7e8f0bc8", + "mixHash" : "ea68ae38156b9889fc171d035f97ff43cc3a1cd01d54578cb695e50502402a4d", + "nonce" : "cac4a75c76fff06d", + "number" : "0x02", + "parentHash" : "2bd5b44505f34000b3eb344a4884e7fee6f320a2ee50d64c150a804c66e09f7b", + "receiptTrie" : "8f9c0d4061c84b9911274a5367ea468825d8290f1cd3c0f00df7e0d284fe17c7", + "stateRoot" : "6e4b2007f4452ded67217523cea559188d156ef0d711eff7c4206f534cd67f25", + "timestamp" : "0x5635012c", + "transactionsTrie" : "7d90b54544a650e638e06d360a7dc2eee226c40373df61476b792ca3eccae35b", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "2", + "chainname" : "B", + "rlp" : "0xf90261f901f9a02bd5b44505f34000b3eb344a4884e7fee6f320a2ee50d64c150a804c66e09f7ba01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a06e4b2007f4452ded67217523cea559188d156ef0d711eff7c4206f534cd67f25a07d90b54544a650e638e06d360a7dc2eee226c40373df61476b792ca3eccae35ba08f9c0d4061c84b9911274a5367ea468825d8290f1cd3c0f00df7e0d284fe17c7b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302004002832fefd882a0b7845635012c80a0ea68ae38156b9889fc171d035f97ff43cc3a1cd01d54578cb695e50502402a4d88cac4a75c76fff06df862f86001018304bb2b94095e7baea6a6c7c4c2dfeb977efac326af552d8764801ca0b66e1a2ee26689bdbb87af26141f167ded19e6b2041407bf4f80a36ce30a1b1ba0084e5def3deddc4ba0bd7dd8cebf184a8c3a3c2d5d9af5cb642bdf819d2e0be4c0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04bb2b", + "gasPrice" : "0x01", + "nonce" : "0x01", + "r" : "0xb66e1a2ee26689bdbb87af26141f167ded19e6b2041407bf4f80a36ce30a1b1b", + "s" : "0x084e5def3deddc4ba0bd7dd8cebf184a8c3a3c2d5d9af5cb642bdf819d2e0be4", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1c", + "value" : "0x64" + } + ], + "uncleHeaders" : [ + ] + }, + { + "blockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020080", + "extraData" : "0x", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x661f", + "hash" : "7918ad3bbd992c246a06fbe2b5fd343429ecb36146035991934e5c71ae08d505", + "mixHash" : "ccce38b6c51ae562b753b0ffa3040b1de06da2991aee235f8a30274221f878bc", + "nonce" : "f5caf918a5c656f6", + "number" : "0x03", + "parentHash" : "cdb6183fee864e854f72db8f37f6d4df928a42c48d3640df108334eb7e8f0bc8", + "receiptTrie" : "4c3cb4b6fa89b2488e6abb64dbb714214c36daa178d85dcdeb19c5a93b52c127", + "stateRoot" : "0c8878763b3e881717a22d0ab6bcb93316e61958bf81aaf5a8d4a496d3827ef7", + "timestamp" : "0x56350130", + "transactionsTrie" : "2bcc69b52ae6b6e2aca544608d302ea49078786bdc26a35220b67c81fa39b996", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "blocknumber" : "3", + "chainname" : "B", + "rlp" : "0xf90261f901f9a0cdb6183fee864e854f72db8f37f6d4df928a42c48d3640df108334eb7e8f0bc8a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a00c8878763b3e881717a22d0ab6bcb93316e61958bf81aaf5a8d4a496d3827ef7a02bcc69b52ae6b6e2aca544608d302ea49078786bdc26a35220b67c81fa39b996a04c3cb4b6fa89b2488e6abb64dbb714214c36daa178d85dcdeb19c5a93b52c127b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302008003832fefd882661f845635013080a0ccce38b6c51ae562b753b0ffa3040b1de06da2991aee235f8a30274221f878bc88f5caf918a5c656f6f862f86002018304bb2b94095e7baea6a6c7c4c2dfeb977efac326af552d8764801ba09e440c52e3bbb810164fb44c2f5b1882b5e9ae50a072737fe74a0a9152f7b973a070d7c1e0cb08639654481bdb953f7f73e4c16f75db1f7bb62fa2ce82bc4801c5c0", + "transactions" : [ + { + "data" : "0x", + "gasLimit" : "0x04bb2b", + "gasPrice" : "0x01", + "nonce" : "0x02", + "r" : "0x9e440c52e3bbb810164fb44c2f5b1882b5e9ae50a072737fe74a0a9152f7b973", + "s" : "0x70d7c1e0cb08639654481bdb953f7f73e4c16f75db1f7bb62fa2ce82bc4801c5", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "v" : "0x1b", + "value" : "0x64" + } + ], + "uncleHeaders" : [ + ] + } + ], + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "0x020000", + "extraData" : "0x42", + "gasLimit" : "0x2fefd8", + "gasUsed" : "0x00", + "hash" : "e4a20be00ea735fa164d36b5445910a424fe1daa7104ae1ac4b4493c83f4141f", + "mixHash" : "18ff07126cac06690dab5957eb31b24a93d48fcefdc041ac9d452eb114308e19", + "nonce" : "a7284375c24d0f33", + "number" : "0x00", + "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "e54c7b09c9fff198fe133bc102afb1a630d3615e28756e67317df7afc4d0dc31", + "timestamp" : "0x54c98c81", + "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "genesisRLP" : "0xf901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0e54c7b09c9fff198fe133bc102afb1a630d3615e28756e67317df7afc4d0dc31a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000080832fefd8808454c98c8142a018ff07126cac06690dab5957eb31b24a93d48fcefdc041ac9d452eb114308e1988a7284375c24d0f33c0c0", + "lastblockhash" : "7918ad3bbd992c246a06fbe2b5fd343429ecb36146035991934e5c71ae08d505", + "postState" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x09184e72a0c8", + "code" : "0x63c0406226600052604060006004601c600073ec0e71ad0a90ffe1909d27dac207f7680abba42d620249f0f25060005160015401600155", + "nonce" : "0x00", + "storage" : { + "0x01" : "0x018080c44c" + } + }, + "8888f1f195afa192cfee860698584c030f4c9db1" : { + "balance" : "0xd02ab486cedd58de", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x09184e7145f6", + "code" : "0x", + "nonce" : "0x03", + "storage" : { + } + }, + "a95e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x64", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x09184e72a000", + "code" : "0x63c0406226600052604060006004601c600073ec0e71ad0a90ffe1909d27dac207f7680abba42d620249f0f25060005160015401600155", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x09184e72a000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + } + }, "OOGStateCopyContainingDeletedContract" : { "blocks" : [ { @@ -9,18 +636,18 @@ "extraData" : "0x", "gasLimit" : "0x2fefd8", "gasUsed" : "0x021ed0", - "hash" : "014b39d133f9d4c8c7bdcee836d4fe604c756631b7898b460a617a421543e280", - "mixHash" : "da18471f32318c815ec959b86d97c24c65fae58e3a902ebd5b7c284392560ad8", - "nonce" : "1ac71d069dca27a7", + "hash" : "d417b685c098fea4b52fe20f0ab30c657ffa823f566132ce8f2a22e6a37133ed", + "mixHash" : "13a07c7ffeecf8c0a263457462c6582f7808e268c894e8321a8783b76c862d5d", + "nonce" : "258881cb5a28da1e", "number" : "0x01", - "parentHash" : "86cd7aadbf4f477ea464777479de88b172152fedacf5c7890c28b78254b6db5f", + "parentHash" : "e9d7655b8d6f19e3f8db65e178aeb2b21f28ee999224552738085f5d144f2f83", "receiptTrie" : "3e21fb330e6981a4657f97fc2ace223c75f17d83f0fa017586d5b872b48b4824", "stateRoot" : "042cf0272a105f572ee8a5a3014aef7fff760fc3ce18c2aedac0cc55c152a4b9", - "timestamp" : "0x561bbe06", + "timestamp" : "0x56350135", "transactionsTrie" : "5c3eb7e26c39308ede0b5a0b9b403fb89c3369deda106c32faf7d0def6f421d2", "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "rlp" : "0xf902eef901faa086cd7aadbf4f477ea464777479de88b172152fedacf5c7890c28b78254b6db5fa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0042cf0272a105f572ee8a5a3014aef7fff760fc3ce18c2aedac0cc55c152a4b9a05c3eb7e26c39308ede0b5a0b9b403fb89c3369deda106c32faf7d0def6f421d2a03e21fb330e6981a4657f97fc2ace223c75f17d83f0fa017586d5b872b48b4824b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008303863001832fefd883021ed084561bbe0680a0da18471f32318c815ec959b86d97c24c65fae58e3a902ebd5b7c284392560ad8881ac71d069dca27a7f8eef864800a830493e09464306ec3f51a26dcf19f5da0c043040f54f4eca501840c5feb5d1ba00cf2cc4de3013273d0aae3cf36cdb6cf152573f7a5b99fe2c514a845bbb98a93a048f4aa20b37303bf4f2c0e7e5f6c178814f99ab4d3d98cf9382185f1ae256b7ff886010a830493e0942e0de3fc10a88911ff857126db1a5f0da6f251738203eaa4fc49c80e00000000000000000000000064306ec3f51a26dcf19f5da0c043040f54f4eca51ca0c9f11f1b4aedd9c1d99a6e2aea6f9ce90bdd6bb6063193715fdb43e77029346fa03440044e3aa54293e887f1751146bf915e73c39eae7da82b75a6d2c7a31d252bc0", + "rlp" : "0xf902eef901faa0e9d7655b8d6f19e3f8db65e178aeb2b21f28ee999224552738085f5d144f2f83a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0042cf0272a105f572ee8a5a3014aef7fff760fc3ce18c2aedac0cc55c152a4b9a05c3eb7e26c39308ede0b5a0b9b403fb89c3369deda106c32faf7d0def6f421d2a03e21fb330e6981a4657f97fc2ace223c75f17d83f0fa017586d5b872b48b4824b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008303863001832fefd883021ed0845635013580a013a07c7ffeecf8c0a263457462c6582f7808e268c894e8321a8783b76c862d5d88258881cb5a28da1ef8eef864800a830493e09464306ec3f51a26dcf19f5da0c043040f54f4eca501840c5feb5d1ba00cf2cc4de3013273d0aae3cf36cdb6cf152573f7a5b99fe2c514a845bbb98a93a048f4aa20b37303bf4f2c0e7e5f6c178814f99ab4d3d98cf9382185f1ae256b7ff886010a830493e0942e0de3fc10a88911ff857126db1a5f0da6f251738203eaa4fc49c80e00000000000000000000000064306ec3f51a26dcf19f5da0c043040f54f4eca51ca0c9f11f1b4aedd9c1d99a6e2aea6f9ce90bdd6bb6063193715fdb43e77029346fa03440044e3aa54293e887f1751146bf915e73c39eae7da82b75a6d2c7a31d252bc0", "transactions" : [ { "data" : "0x0c5feb5d", @@ -56,9 +683,9 @@ "extraData" : "0x42", "gasLimit" : "0x2fefd8", "gasUsed" : "0x00", - "hash" : "86cd7aadbf4f477ea464777479de88b172152fedacf5c7890c28b78254b6db5f", - "mixHash" : "74b52d9518d9bf2a1ca37de5defc10ced5f94712cf550af50abf15907f4f4450", - "nonce" : "bffdbdd2a34e324c", + "hash" : "e9d7655b8d6f19e3f8db65e178aeb2b21f28ee999224552738085f5d144f2f83", + "mixHash" : "34e0efd31ff30732e7d4e0786a89c28e2c2c0229bdc061854ddd32678c818614", + "nonce" : "c7fd8fd9192ddfc0", "number" : "0x00", "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000", "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", @@ -67,8 +694,8 @@ "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "genesisRLP" : "0xf901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a02b9f478fe39744a8c17eb48ae7bf86f6a47031a823a632f9bd661b59978aeefda056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830386a080832fefd8808454c98c8142a074b52d9518d9bf2a1ca37de5defc10ced5f94712cf550af50abf15907f4f445088bffdbdd2a34e324cc0c0", - "lastblockhash" : "014b39d133f9d4c8c7bdcee836d4fe604c756631b7898b460a617a421543e280", + "genesisRLP" : "0xf901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a02b9f478fe39744a8c17eb48ae7bf86f6a47031a823a632f9bd661b59978aeefda056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830386a080832fefd8808454c98c8142a034e0efd31ff30732e7d4e0786a89c28e2c2c0229bdc061854ddd32678c81861488c7fd8fd9192ddfc0c0c0", + "lastblockhash" : "d417b685c098fea4b52fe20f0ab30c657ffa823f566132ce8f2a22e6a37133ed", "postState" : { "2e0de3fc10a88911ff857126db1a5f0da6f25173" : { "balance" : "0x03eb", @@ -134,18 +761,18 @@ "extraData" : "0x", "gasLimit" : "0x2fefd8", "gasUsed" : "0xcdc7", - "hash" : "31a2017106ea3824e38473942bd2e3b2821c8b3180eb64b25f9beb00a8a1fcb7", - "mixHash" : "a713c7d424b0945b3e2212c9710efe7c704750fa5553c6b7eb86d2a1a19d1f79", - "nonce" : "89725425afc4aff2", + "hash" : "6c127a1d91e8b8a0fb8a599de33543f45e7117ae331b39c0888d3633a46fc2e1", + "mixHash" : "3b80d86b0152f2d4dce75c4fbd80d65c4f89316942c929ac072bfe93246649d2", + "nonce" : "78f64b89b638a158", "number" : "0x01", - "parentHash" : "577f0011f92e09511e4ab256b72e1ac11610c3728179e0b7bd76aad4426adb92", + "parentHash" : "8eac9bbc9794f3a90c6d846528c4f505204797b19accafee93a909ee2fe075f4", "receiptTrie" : "56e592ae6cf92b6c205e50d9cdbf1d3c5fe7f9fbc2bf219b93855107518e7e7f", "stateRoot" : "7564aa479e81b3f9a05b0f99193fdd7367ccc0e74d140249d943ce0df904ba02", - "timestamp" : "0x561bbe0b", + "timestamp" : "0x56350139", "transactionsTrie" : "fcfe9f2203bd98342867117fa3de299a09578371efd04fc9e76a46f7f1fda4bb", "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "rlp" : "0xf9032ef901f9a0577f0011f92e09511e4ab256b72e1ac11610c3728179e0b7bd76aad4426adb92a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a07564aa479e81b3f9a05b0f99193fdd7367ccc0e74d140249d943ce0df904ba02a0fcfe9f2203bd98342867117fa3de299a09578371efd04fc9e76a46f7f1fda4bba056e592ae6cf92b6c205e50d9cdbf1d3c5fe7f9fbc2bf219b93855107518e7e7fb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008303863001832fefd882cdc784561bbe0b80a0a713c7d424b0945b3e2212c9710efe7c704750fa5553c6b7eb86d2a1a19d1f798889725425afc4aff2f9012ef866800a8307a120948888f1f195afa192cfee860698584c030f4c9db18203e9840c55699c1ba091fc4c402ced19b984e953546d3fc786c46a79c9f0c7918b8f3343dc529ef0e5a0546d89230c90ca8bf7988a826430d4771ab3a67cc0f3cb8019d67ab10ec10524f861010a82c3509400000000000000000000000000000000000000008203e8801ba0b03ab16ed211bf447ac030216ab088f18367ee51303545d2957990e9d3a28f10a07f18dd055139f7ac5558997b80ccae799ab6fbad2326799db509a9d4e5a52d72f861020a82c3509400000000000000000000000000000000000000008203ea801ba00925abd1221d388622138f4bae46803313f297001e96fec22dc4268fca5b5a82a055cd8142bcec39f80b359aa089f6a70568d23a67048026703981fad9339ef5d4c0", + "rlp" : "0xf9032ef901f9a08eac9bbc9794f3a90c6d846528c4f505204797b19accafee93a909ee2fe075f4a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a07564aa479e81b3f9a05b0f99193fdd7367ccc0e74d140249d943ce0df904ba02a0fcfe9f2203bd98342867117fa3de299a09578371efd04fc9e76a46f7f1fda4bba056e592ae6cf92b6c205e50d9cdbf1d3c5fe7f9fbc2bf219b93855107518e7e7fb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008303863001832fefd882cdc7845635013980a03b80d86b0152f2d4dce75c4fbd80d65c4f89316942c929ac072bfe93246649d28878f64b89b638a158f9012ef866800a8307a120948888f1f195afa192cfee860698584c030f4c9db18203e9840c55699c1ba091fc4c402ced19b984e953546d3fc786c46a79c9f0c7918b8f3343dc529ef0e5a0546d89230c90ca8bf7988a826430d4771ab3a67cc0f3cb8019d67ab10ec10524f861010a82c3509400000000000000000000000000000000000000008203e8801ba0b03ab16ed211bf447ac030216ab088f18367ee51303545d2957990e9d3a28f10a07f18dd055139f7ac5558997b80ccae799ab6fbad2326799db509a9d4e5a52d72f861020a82c3509400000000000000000000000000000000000000008203ea801ba00925abd1221d388622138f4bae46803313f297001e96fec22dc4268fca5b5a82a055cd8142bcec39f80b359aa089f6a70568d23a67048026703981fad9339ef5d4c0", "transactions" : [ { "data" : "0x0c55699c", @@ -192,9 +819,9 @@ "extraData" : "0x42", "gasLimit" : "0x2fefd8", "gasUsed" : "0x00", - "hash" : "577f0011f92e09511e4ab256b72e1ac11610c3728179e0b7bd76aad4426adb92", - "mixHash" : "7d92760f89c04bc4d1b3716423d0cc5c89244a513e960979149cea0b5162ea91", - "nonce" : "a35294f86be5ddb3", + "hash" : "8eac9bbc9794f3a90c6d846528c4f505204797b19accafee93a909ee2fe075f4", + "mixHash" : "5a19e3e9b4eea5cfe73795f2a499d99ad6e959445d71bf272dbe18d65cbd8927", + "nonce" : "c06ebf5900068792", "number" : "0x00", "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000", "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", @@ -203,8 +830,8 @@ "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "genesisRLP" : "0xf901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a04941fba20142b10d43d0a893dfa4f5eedcbcb4b55c8554efd71e226624d9b37ca056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830386a080832fefd8808454c98c8142a07d92760f89c04bc4d1b3716423d0cc5c89244a513e960979149cea0b5162ea9188a35294f86be5ddb3c0c0", - "lastblockhash" : "31a2017106ea3824e38473942bd2e3b2821c8b3180eb64b25f9beb00a8a1fcb7", + "genesisRLP" : "0xf901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a04941fba20142b10d43d0a893dfa4f5eedcbcb4b55c8554efd71e226624d9b37ca056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830386a080832fefd8808454c98c8142a05a19e3e9b4eea5cfe73795f2a499d99ad6e959445d71bf272dbe18d65cbd892788c06ebf5900068792c0c0", + "lastblockhash" : "6c127a1d91e8b8a0fb8a599de33543f45e7117ae331b39c0888d3633a46fc2e1", "postState" : { "0000000000000000000000000000000000000000" : { "balance" : "0x07d2", @@ -255,18 +882,18 @@ "extraData" : "0x", "gasLimit" : "0x2fefd8", "gasUsed" : "0x2906", - "hash" : "8ef175b4e1686b5356e5dcd67d011ba533930c5b9c71299ed290a0760094e471", - "mixHash" : "d09d59d77aa2d58a4c0467c2e154e4196c48d4e798053707672566b4939bd5d8", - "nonce" : "e1801fd770254ee7", + "hash" : "063cc5824b146fe167103c10f9752f94832017e8df1cf008387b7eeed4b57d90", + "mixHash" : "9f93156773ad3198bd97392034b6fd6145115431860bbfd1b56cd091d16f54d6", + "nonce" : "2c38c3edd4a8925a", "number" : "0x01", - "parentHash" : "db30263a5f8d24f8b8eed1a1145188e137f0b54c4383cb7691a1a792abf2b33e", + "parentHash" : "24b1e2b08b6f4cbe86f29681003cff67ff65ae5ac826743734c2a20f29be124d", "receiptTrie" : "45a1e5d92294ba129a8dcd41456fd5ffc2eadb690b16916783910b77d05e61c8", "stateRoot" : "2634dc0c8fab13c3e11d813a506945f50b03f86221b1713ee7a33229da24f943", - "timestamp" : "0x561bbe10", + "timestamp" : "0x5635013d", "transactionsTrie" : "53d5b71a8fbb9590de82d69dfa4ac31923b0c8afce0d30d0d8d1e931f25030dc", "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "rlp" : "0xf90260f901f9a0db30263a5f8d24f8b8eed1a1145188e137f0b54c4383cb7691a1a792abf2b33ea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a02634dc0c8fab13c3e11d813a506945f50b03f86221b1713ee7a33229da24f943a053d5b71a8fbb9590de82d69dfa4ac31923b0c8afce0d30d0d8d1e931f25030dca045a1e5d92294ba129a8dcd41456fd5ffc2eadb690b16916783910b77d05e61c8b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008303863001832fefd882290684561bbe1080a0d09d59d77aa2d58a4c0467c2e154e4196c48d4e798053707672566b4939bd5d888e1801fd770254ee7f861f85f800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba0f3266921c93d600c43f6fa4724b7abae079b35b9e95df592f95f9f3445e94c88a012f977552ebdb7a492cf35f3106df16ccb4576ebad4113056ee1f52cbe4978c1c0", + "rlp" : "0xf90260f901f9a024b1e2b08b6f4cbe86f29681003cff67ff65ae5ac826743734c2a20f29be124da01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a02634dc0c8fab13c3e11d813a506945f50b03f86221b1713ee7a33229da24f943a053d5b71a8fbb9590de82d69dfa4ac31923b0c8afce0d30d0d8d1e931f25030dca045a1e5d92294ba129a8dcd41456fd5ffc2eadb690b16916783910b77d05e61c8b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008303863001832fefd8822906845635013d80a09f93156773ad3198bd97392034b6fd6145115431860bbfd1b56cd091d16f54d6882c38c3edd4a8925af861f85f800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba0f3266921c93d600c43f6fa4724b7abae079b35b9e95df592f95f9f3445e94c88a012f977552ebdb7a492cf35f3106df16ccb4576ebad4113056ee1f52cbe4978c1c0", "transactions" : [ { "data" : "0x", @@ -291,18 +918,18 @@ "extraData" : "0x", "gasLimit" : "0x2fefd8", "gasUsed" : "0x5208", - "hash" : "931242008fdd7af531ca0a94fe481592a2ec46813d67c246e6d53f5a09cdf2b1", - "mixHash" : "d7cd6cc9a86a3f8818843fa8ee25c55f62f491d6246bb248613c810d7b3c5423", - "nonce" : "f32510acc0379d94", + "hash" : "e25d932ffcff8693f7b4bd621b6f27cd1ebe0584d6fc65bd7d21ab55473cb22c", + "mixHash" : "3602c3d7ec0bf7e052f3e4e6e3376745516487e716e1d13a7525fb96f872875f", + "nonce" : "70ea52ba60044044", "number" : "0x02", - "parentHash" : "8ef175b4e1686b5356e5dcd67d011ba533930c5b9c71299ed290a0760094e471", + "parentHash" : "063cc5824b146fe167103c10f9752f94832017e8df1cf008387b7eeed4b57d90", "receiptTrie" : "6952621e59f670b82f765b40711cfbc3fff5eb3ca56c6c1509cb8bf915ae94da", "stateRoot" : "600002151e3bc50cd8136dcbfbc8dedf3ec063710d46e5ba1cc6f5d1796f1ea5", - "timestamp" : "0x561bbe13", + "timestamp" : "0x56350141", "transactionsTrie" : "326814571a40c9c7db48527b6819d6a25c03735dd63a9762911729510d07a45c", "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "rlp" : "0xf90262f901f9a08ef175b4e1686b5356e5dcd67d011ba533930c5b9c71299ed290a0760094e471a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0600002151e3bc50cd8136dcbfbc8dedf3ec063710d46e5ba1cc6f5d1796f1ea5a0326814571a40c9c7db48527b6819d6a25c03735dd63a9762911729510d07a45ca06952621e59f670b82f765b40711cfbc3fff5eb3ca56c6c1509cb8bf915ae94dab9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830386a002832fefd882520884561bbe1380a0d7cd6cc9a86a3f8818843fa8ee25c55f62f491d6246bb248613c810d7b3c542388f32510acc0379d94f863f861010a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d878203e8801ba0823762ef8e6fc0498753553d5defe18004462e636cf76eb06515c7652aac3040a07239c31a3df7ea1e894d71558ac36179c97446bc630f3f4b8d035ee436b6ad46c0", + "rlp" : "0xf90262f901f9a0063cc5824b146fe167103c10f9752f94832017e8df1cf008387b7eeed4b57d90a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0600002151e3bc50cd8136dcbfbc8dedf3ec063710d46e5ba1cc6f5d1796f1ea5a0326814571a40c9c7db48527b6819d6a25c03735dd63a9762911729510d07a45ca06952621e59f670b82f765b40711cfbc3fff5eb3ca56c6c1509cb8bf915ae94dab9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830386a002832fefd8825208845635014180a03602c3d7ec0bf7e052f3e4e6e3376745516487e716e1d13a7525fb96f872875f8870ea52ba60044044f863f861010a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d878203e8801ba0823762ef8e6fc0498753553d5defe18004462e636cf76eb06515c7652aac3040a07239c31a3df7ea1e894d71558ac36179c97446bc630f3f4b8d035ee436b6ad46c0", "transactions" : [ { "data" : "0x", @@ -327,9 +954,9 @@ "extraData" : "0x42", "gasLimit" : "0x2fefd8", "gasUsed" : "0x00", - "hash" : "db30263a5f8d24f8b8eed1a1145188e137f0b54c4383cb7691a1a792abf2b33e", - "mixHash" : "30ff6ec57e2a78935672f5bc465560aaea35ec4d0205d6782b5f8d75c8223204", - "nonce" : "0727621fcf9d0354", + "hash" : "24b1e2b08b6f4cbe86f29681003cff67ff65ae5ac826743734c2a20f29be124d", + "mixHash" : "f2f6fd4d5804fd2757e4b0b435433731f995ca5724e5b815270d3df71dc3ae03", + "nonce" : "a97c07a113c1d438", "number" : "0x00", "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000", "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", @@ -338,8 +965,8 @@ "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "genesisRLP" : "0xf901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0c53ee8f6624173f7efcc6c8a9bd54181fb079a52e0e1a78e16de4a6a5b74071ba056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830386a080832fefd8808454c98c8142a030ff6ec57e2a78935672f5bc465560aaea35ec4d0205d6782b5f8d75c8223204880727621fcf9d0354c0c0", - "lastblockhash" : "931242008fdd7af531ca0a94fe481592a2ec46813d67c246e6d53f5a09cdf2b1", + "genesisRLP" : "0xf901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0c53ee8f6624173f7efcc6c8a9bd54181fb079a52e0e1a78e16de4a6a5b74071ba056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830386a080832fefd8808454c98c8142a0f2f6fd4d5804fd2757e4b0b435433731f995ca5724e5b815270d3df71dc3ae0388a97c07a113c1d438c0c0", + "lastblockhash" : "e25d932ffcff8693f7b4bd621b6f27cd1ebe0584d6fc65bd7d21ab55473cb22c", "postState" : { "0000000000000000000000000000000000000080" : { "balance" : "0x0186aa", diff --git a/tests/files/StateTests/stPreCompiledContracts.json b/tests/files/StateTests/stPreCompiledContracts.json index 7af011873..981e66b66 100644 --- a/tests/files/StateTests/stPreCompiledContracts.json +++ b/tests/files/StateTests/stPreCompiledContracts.json @@ -3498,6 +3498,150 @@ "value" : "0x0186a0" } }, + "CallEcrecoverCheckLength" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x989680", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "logs" : [ + ], + "out" : "0x", + "post" : { + "0000000000000000000000000000000000000001" : { + "balance" : "0x00", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x0132b3a0", + "code" : "0x7f11223344556677889900112233445566778899001122334455667788990011226080527f18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c600052601c6020527f73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f6040527feeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549606052602060806080600060006001620493e0f16002556080516000556080600155", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "0x01" : "0x80", + "0x02" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0x01aa53", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a760cf0d", + "code" : "0x", + "nonce" : "0x01", + "storage" : { + } + } + }, + "postStateRoot" : "64f7a0ea764350db949d9a9f9ec5e5400acef5bad92ed340011266791ad5b74b", + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x01312d00", + "code" : "0x7f11223344556677889900112233445566778899001122334455667788990011226080527f18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c600052601c6020527f73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f6040527feeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549606052602060806080600060006001620493e0f16002556080516000556080600155", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "0x37ba90", + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "0x0186a0" + } + }, + "CallEcrecoverCheckLengthWrongV" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x989680", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "logs" : [ + ], + "out" : "0x", + "post" : { + "0000000000000000000000000000000000000001" : { + "balance" : "0x00", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x0132b3a0", + "code" : "0x7f11223344556677889900112233445566778899001122334455667788990011226080527f18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c600052601d6020527f73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f6040527feeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549606052602060806080600060006001620493e0f16002556080516000556080600155", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x1122334455667788990011223344556677889900112233445566778899001122", + "0x01" : "0x80", + "0x02" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0x01aa53", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a760cf0d", + "code" : "0x", + "nonce" : "0x01", + "storage" : { + } + } + }, + "postStateRoot" : "67af1f3bd8f8619c936e56b87b5910c8beeb8035be00fddeeb3346a5aa31e230", + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x01312d00", + "code" : "0x7f11223344556677889900112233445566778899001122334455667788990011226080527f18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c600052601d6020527f73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f6040527feeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549606052602060806080600060006001620493e0f16002556080516000556080600155", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "0x37ba90", + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "0x0186a0" + } + }, "CallEcrecoverH_prefixed0" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", diff --git a/tests/files/StateTests/stSystemOperationsTest.json b/tests/files/StateTests/stSystemOperationsTest.json index 7f7cb1220..94ca013e3 100644 --- a/tests/files/StateTests/stSystemOperationsTest.json +++ b/tests/files/StateTests/stSystemOperationsTest.json @@ -18676,6 +18676,61 @@ "value" : "0x0186a0" } }, + "suicideSendEtherPostDeath" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x989680", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "logs" : [ + ], + "out" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "post" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0x2aa8", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7624eb8", + "code" : "0x", + "nonce" : "0x01", + "storage" : { + } + } + }, + "postStateRoot" : "9f3c63ff818c14e4b56e5fa1fc03a76725f598bcac256668185ec51dfc1d7f5f", + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60606040526000357c01000000000000000000000000000000000000000000000000000000009004806335f46994146100445780634d536fe31461005157610042565b005b61004f600450610072565b005b61005c60045061008d565b6040518082815260200191505060405180910390f35b3073ffffffffffffffffffffffffffffffffffffffff16ff5b565b600060003073ffffffffffffffffffffffffffffffffffffffff166335f46994604051817c01000000000000000000000000000000000000000000000000000000000281526004018090506000604051808303816000876161da5a03f115610002575050503073ffffffffffffffffffffffffffffffffffffffff163190503373ffffffffffffffffffffffffffffffffffffffff16600082604051809050600060405180830381858888f1935050505050809150610147565b509056", + "nonce" : "0x00", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : "0x4d536fe3", + "gasLimit" : "0x2dc6c0", + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "0x0186a0" + } + }, "suicideSendEtherToMe" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", diff --git a/xeth/xeth.go b/xeth/xeth.go index ae9f1fe47..19c42a9a3 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -879,6 +879,60 @@ func (self *XEth) Frontend() Frontend { return self.frontend } +func (self *XEth) SignTransaction(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceStr, codeStr string) (*types.Transaction, error) { + if len(toStr) > 0 && toStr != "0x" && !isAddress(toStr) { + return nil, errors.New("Invalid address") + } + + var ( + from = common.HexToAddress(fromStr) + to = common.HexToAddress(toStr) + value = common.Big(valueStr) + gas *big.Int + price *big.Int + data []byte + contractCreation bool + ) + + if len(gasStr) == 0 { + gas = DefaultGas() + } else { + gas = common.Big(gasStr) + } + + if len(gasPriceStr) == 0 { + price = self.DefaultGasPrice() + } else { + price = common.Big(gasPriceStr) + } + + data = common.FromHex(codeStr) + if len(toStr) == 0 { + contractCreation = true + } + + var nonce uint64 + if len(nonceStr) != 0 { + nonce = common.Big(nonceStr).Uint64() + } else { + state := self.backend.TxPool().State() + nonce = state.GetNonce(from) + } + var tx *types.Transaction + if contractCreation { + tx = types.NewContractCreation(nonce, value, gas, price, data) + } else { + tx = types.NewTransaction(nonce, to, value, gas, price, data) + } + + signed, err := self.sign(tx, from, false) + if err != nil { + return nil, err + } + + return signed, nil +} + func (self *XEth) Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceStr, codeStr string) (string, error) { // this minimalistic recoding is enough (works for natspec.js) |