diff options
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | CONTRIBUTING.md | 9 | ||||
-rw-r--r-- | README.md | 45 | ||||
-rwxr-xr-x | build/test-global-coverage.sh | 33 | ||||
-rw-r--r-- | core/block_processor.go | 8 | ||||
-rw-r--r-- | core/chain_manager.go | 4 | ||||
-rw-r--r-- | core/filter.go | 4 | ||||
-rw-r--r-- | miner/worker.go | 7 |
8 files changed, 56 insertions, 58 deletions
diff --git a/.travis.yml b/.travis.yml index 2b3ff92f6..13211f736 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ install: # - go get code.google.com/p/go.tools/cmd/goimports # - go get github.com/golang/lint/golint # - go get golang.org/x/tools/cmd/vet - - go get golang.org/x/tools/cmd/cover github.com/mattn/goveralls + - go get golang.org/x/tools/cmd/cover before_script: # - gofmt -l -w . # - goimports -l -w . @@ -15,7 +15,7 @@ before_script: script: - make travis-test-with-coverage after_success: - - if [ "$COVERALLS_TOKEN" ]; then goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN; fi + - bash <(curl -s https://codecov.io/bash) env: global: - secure: "U2U1AmkU4NJBgKR/uUAebQY87cNL0+1JHjnLOmmXwxYYyj5ralWb1aSuSH3qSXiT93qLBmtaUkuv9fberHVqrbAeVlztVdUsKAq7JMQH+M99iFkC9UiRMqHmtjWJ0ok4COD1sRYixxi21wb/JrMe3M1iL4QJVS61iltjHhVdM64=" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..918a2c154 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,9 @@ +If you'd like to contribute to go-ethereum please fork, fix, commit and +send a pull request. Commits who do not comply with the coding standards +are ignored (use gofmt!). If you send pull requests make absolute sure that you +commit on the `develop` branch and that you do not merge to master. +Commits that are directly based on master are simply ignored. + +See [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/Developers'-Guide) +for more details on configuring your environment, testing, and +dependency management. @@ -1,19 +1,18 @@ ## Ethereum Go -Ethereum Go Client, by Jeffrey Wilcke (and some other people). +Official golang implementation of the Ethereum protocol | Linux | OSX | ARM | Windows | Tests ----------|---------|-----|-----|---------|------ -develop | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20develop%20branch)](https://build.ethdev.com/builders/Linux%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20develop%20branch)](https://build.ethdev.com/builders/OSX%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=ARM%20Go%20develop%20branch)](https://build.ethdev.com/builders/ARM%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Windows%20Go%20develop%20branch)](https://build.ethdev.com/builders/Windows%20Go%20develop%20branch/builds/-1) | [![Buildr+Status](https://travis-ci.org/ethereum/go-ethereum.svg?branch=develop)](https://travis-ci.org/ethereum/go-ethereum) [![Coverage Status](https://coveralls.io/repos/ethereum/go-ethereum/badge.svg?branch=develop)](https://coveralls.io/r/ethereum/go-ethereum?branch=develop) -master | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20master%20branch)](https://build.ethdev.com/builders/Linux%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=OSX%20Go%20master%20branch)](https://build.ethdev.com/builders/OSX%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=ARM%20Go%20master%20branch)](https://build.ethdev.com/builders/ARM%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Windows%20Go%20master%20branch)](https://build.ethdev.com/builders/Windows%20Go%20master%20branch/builds/-1) | [![Buildr+Status](https://travis-ci.org/ethereum/go-ethereum.svg?branch=master)](https://travis-ci.org/ethereum/go-ethereum) [![Coverage Status](https://coveralls.io/repos/ethereum/go-ethereum/badge.svg?branch=master)](https://coveralls.io/r/ethereum/go-ethereum?branch=master) +develop | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20develop%20branch)](https://build.ethdev.com/builders/Linux%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20develop%20branch)](https://build.ethdev.com/builders/OSX%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=ARM%20Go%20develop%20branch)](https://build.ethdev.com/builders/ARM%20Go%20develop%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Windows%20Go%20develop%20branch)](https://build.ethdev.com/builders/Windows%20Go%20develop%20branch/builds/-1) | [![Buildr+Status](https://travis-ci.org/ethereum/go-ethereum.svg?branch=develop)](https://travis-ci.org/ethereum/go-ethereum) [![codecov.io](http://codecov.io/github/ethereum/go-ethereum/coverage.svg?branch=develop)](http://codecov.io/github/ethereum/go-ethereum?branch=develop) +master | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20master%20branch)](https://build.ethdev.com/builders/Linux%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=OSX%20Go%20master%20branch)](https://build.ethdev.com/builders/OSX%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=ARM%20Go%20master%20branch)](https://build.ethdev.com/builders/ARM%20Go%20master%20branch/builds/-1) | [![Build+Status](https://build.ethdev.com/buildstatusimage?builder=Windows%20Go%20master%20branch)](https://build.ethdev.com/builders/Windows%20Go%20master%20branch/builds/-1) | [![Buildr+Status](https://travis-ci.org/ethereum/go-ethereum.svg?branch=master)](https://travis-ci.org/ethereum/go-ethereum) [![codecov.io](http://codecov.io/github/ethereum/go-ethereum/coverage.svg?branch=master)](http://codecov.io/github/ethereum/go-ethereum?branch=master) -[![Bugs](https://badge.waffle.io/ethereum/go-ethereum.png?label=bug&title=Bugs)](https://waffle.io/ethereum/go-ethereum) -[![Stories in Ready](https://badge.waffle.io/ethereum/go-ethereum.png?label=ready&title=Ready)](https://waffle.io/ethereum/go-ethereum) -[![Stories in Progress](https://badge.waffle.io/ethereum/go-ethereum.svg?label=in%20progress&title=In Progress)](http://waffle.io/ethereum/go-ethereum) +[![API Reference]( +https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667 +)](https://godoc.org/github.com/ethereum/go-ethereum) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/go-ethereum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -Automated development builds -====================== +## Automated development builds The following builds are build automatically by our build servers after each push to the [develop](https://github.com/ethereum/go-ethereum/tree/develop) branch. @@ -25,8 +24,7 @@ The following builds are build automatically by our build servers after each pus * [Windows 64-bit](https://build.ethdev.com/builds/Windows%20Go%20develop%20branch/Geth-Win64-latest.zip) * [ARM](https://build.ethdev.com/builds/ARM%20Go%20develop%20branch/geth-ARM-latest.tar.bz2) -Building the source -=================== +## Building the source For prerequisites and detailed build instructions please read the [Installation Instructions](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum) @@ -38,34 +36,31 @@ Once the dependencies are installed, run make geth -Executables -=========== +## Executables Go Ethereum comes with several wrappers/executables found in [the `cmd` directory](https://github.com/ethereum/go-ethereum/tree/develop/cmd): -* `geth` Ethereum CLI (ethereum command line interface client) -* `bootnode` runs a bootstrap node for the Discovery Protocol -* `ethtest` test tool which runs with the [tests](https://github.com/ethereum/tests) suite: - `/path/to/test.json > ethtest --test BlockTests --stdin`. -* `evm` is a generic Ethereum Virtual Machine: `evm -code 60ff60ff -gas - 10000 -price 0 -dump`. See `-h` for a detailed description. -* `disasm` disassembles EVM code: `echo "6001" | disasm` -* `rlpdump` prints RLP structures + Command | | +----------|---------| +`geth` | Ethereum CLI (ethereum command line interface client) | +`bootnode` | runs a bootstrap node for the Discovery Protocol | +`ethtest` | test tool which runs with the [tests](https://github.com/ethereum/tests) suite: `/path/to/test.json > ethtest --test BlockTests --stdin`. +`evm` | is a generic Ethereum Virtual Machine: `evm -code 60ff60ff -gas 10000 -price 0 -dump`. See `-h` for a detailed description. | +`disasm` | disassembles EVM code: `echo "6001" | disasm` | +`rlpdump` | prints RLP structures | -Command line options -==================== +## Command line options `geth` can be configured via command line options, environment variables and config files. To get the options available: - geth --help + geth help For further details on options, see the [wiki](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options) -Contribution -============ +## Contribution If you'd like to contribute to go-ethereum please fork, fix, commit and send a pull request. Commits who do not comply with the coding standards diff --git a/build/test-global-coverage.sh b/build/test-global-coverage.sh index 5bb233a31..a51b6a9e5 100755 --- a/build/test-global-coverage.sh +++ b/build/test-global-coverage.sh @@ -1,26 +1,15 @@ -#!/bin/bash - -# This script runs all package tests and merges the resulting coverage -# profiles. Coverage is accounted per package under test. +#!/usr/bin/env bash set -e - -if [ ! -f "build/env.sh" ]; then - echo "$0 must be run from the root of the repository." - exit 2 -fi - -echo "mode: count" > profile.cov - -for pkg in $(go list ./...); do - # drop the namespace prefix. - dir=${pkg##github.com/ethereum/go-ethereum/} - - if [[ $dir != "tests" ]]; then - go test -covermode=count -coverprofile=$dir/profile.tmp $pkg - fi - if [[ -f $dir/profile.tmp ]]; then - tail -n +2 $dir/profile.tmp >> profile.cov - rm $dir/profile.tmp +echo "" > coverage.txt + +for d in $(find ./* -maxdepth 10 -type d -not -path "./build" -not -path "./Godeps/*" ); do + if ls $d/*.go &> /dev/null; then + go test -coverprofile=profile.out -covermode=atomic $d + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + echo '<<<<<< EOF' >> coverage.txt + rm profile.out + fi fi done diff --git a/core/block_processor.go b/core/block_processor.go index 829e4314c..dd7fe8962 100644 --- a/core/block_processor.go +++ b/core/block_processor.go @@ -349,11 +349,9 @@ func (sm *BlockProcessor) GetBlockReceipts(bhash common.Hash) types.Receipts { // the depricated way by re-processing the block. func (sm *BlockProcessor) GetLogs(block *types.Block) (logs state.Logs, err error) { receipts := GetBlockReceipts(sm.chainDb, block.Hash()) - if len(receipts) > 0 { - // coalesce logs - for _, receipt := range receipts { - logs = append(logs, receipt.Logs()...) - } + // coalesce logs + for _, receipt := range receipts { + logs = append(logs, receipt.Logs()...) } return logs, nil } diff --git a/core/chain_manager.go b/core/chain_manager.go index 1647031b1..cf5b8bd78 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -647,7 +647,9 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) { queue[i] = ChainSplitEvent{block, logs} queueEvent.splitCount++ } - PutBlockReceipts(self.chainDb, block, receipts) + if err := PutBlockReceipts(self.chainDb, block, receipts); err != nil { + glog.V(logger.Warn).Infoln("error writing block receipts:", err) + } stats.processed++ } diff --git a/core/filter.go b/core/filter.go index 8a876396b..c34d6ff6c 100644 --- a/core/filter.go +++ b/core/filter.go @@ -22,6 +22,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/logger/glog" ) type AccountChange struct { @@ -111,7 +113,7 @@ done: // Get the logs of the block unfiltered, err := self.eth.BlockProcessor().GetLogs(block) if err != nil { - chainlogger.Warnln("err: filter get logs ", err) + glog.V(logger.Warn).Infoln("err: filter get logs ", err) break } diff --git a/miner/worker.go b/miner/worker.go index df3681470..aa2132a51 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -297,14 +297,17 @@ func (self *worker) wait() { } // broadcast before waiting for validation - go func(block *types.Block, logs state.Logs) { + go func(block *types.Block, logs state.Logs, receipts []*types.Receipt) { self.mux.Post(core.NewMinedBlockEvent{block}) self.mux.Post(core.ChainEvent{block, block.Hash(), logs}) if stat == core.CanonStatTy { self.mux.Post(core.ChainHeadEvent{block}) self.mux.Post(logs) } - }(block, work.state.Logs()) + if err := core.PutBlockReceipts(self.chainDb, block, receipts); err != nil { + glog.V(logger.Warn).Infoln("error writing block receipts:", err) + } + }(block, work.state.Logs(), work.receipts) } // check staleness and display confirmation |