Skip to content

Commit 2e778f9

Browse files
authored
Merge pull request ethereum#182 from nextyio/merge
Merge latest code from go-ethereum to gonex
2 parents cabc461 + 2ffe3cc commit 2e778f9

File tree

942 files changed

+182273
-70655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

942 files changed

+182273
-70655
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,12 @@ accounts/abi @gballet
66
consensus @karalabe
77
core/ @karalabe @holiman
88
eth/ @karalabe
9+
graphql/ @gballet
910
les/ @zsfelfoldi
1011
light/ @zsfelfoldi
1112
mobile/ @karalabe
1213
p2p/ @fjl @zsfelfoldi
13-
p2p/simulations @lmars
14-
p2p/protocols @zelig
15-
swarm/api/http @justelad
16-
swarm/bmt @zelig
17-
swarm/dev @lmars
18-
swarm/fuse @jmozah @holisticode
19-
swarm/grafana_dashboards @nonsense
20-
swarm/metrics @nonsense @holisticode
21-
swarm/multihash @nolash
22-
swarm/network/bitvector @zelig @janos
23-
swarm/network/priorityqueue @zelig @janos
24-
swarm/network/simulations @zelig @janos
25-
swarm/network/stream @janos @zelig @holisticode @justelad
26-
swarm/network/stream/intervals @janos
27-
swarm/network/stream/testing @zelig
28-
swarm/pot @zelig
29-
swarm/pss @nolash @zelig @nonsense
30-
swarm/services @zelig
31-
swarm/state @justelad
32-
swarm/storage/encryption @zelig @nagydani
33-
swarm/storage/mock @janos
34-
swarm/storage/feed @nolash @jpeletier
35-
swarm/testutil @lmars
14+
p2p/simulations @zelig @nonsense @janos @justelad
15+
p2p/protocols @zelig @nonsense @janos @justelad
16+
p2p/testing @zelig @nonsense @janos @justelad
3617
whisper/ @gballet @gluk256

.github/no-response.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Number of days of inactivity before an Issue is closed for lack of response
22
daysUntilClose: 30
33
# Label requiring a response
4-
responseRequiredLabel: more-information-needed
4+
responseRequiredLabel: "need:more-information"
55
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
66
closeComment: >
77
This issue has been automatically closed because there has been no response

.github/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exemptLabels:
77
- pinned
88
- security
99
# Label to use when marking an issue as stale
10-
staleLabel: stale
10+
staleLabel: "status:inactive"
1111
# Comment to post when marking an issue as stale. Set to `false` to disable
1212
markComment: >
1313
This issue has been automatically marked as stale because it has not had

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ profile.cov
4444
/dashboard/assets/node_modules
4545
/dashboard/assets/stats.json
4646
/dashboard/assets/bundle.js
47+
/dashboard/assets/bundle.js.map
4748
/dashboard/assets/package-lock.json
4849

4950
**/yarn-error.log
50-
51-
# testnet
52-
*.log
53-
passwd
54-
55-
*.exe

.travis.yml

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ matrix:
1414
- go run build/ci.go install
1515
- go run build/ci.go test -coverage $TEST_PACKAGES
1616

17-
# These are the latest Go versions.
1817
- os: linux
1918
dist: trusty
2019
sudo: required
@@ -26,8 +25,20 @@ matrix:
2625
- go run build/ci.go install
2726
- go run build/ci.go test -coverage $TEST_PACKAGES
2827

28+
# These are the latest Go versions.
29+
- os: linux
30+
dist: trusty
31+
sudo: required
32+
go: 1.12.x
33+
script:
34+
- sudo modprobe fuse
35+
- sudo chmod 666 /dev/fuse
36+
- sudo chown root:$USER /etc/fuse.conf
37+
- go run build/ci.go install
38+
- go run build/ci.go test -coverage $TEST_PACKAGES
39+
2940
- os: osx
30-
go: 1.11.x
41+
go: 1.12.x
3142
script:
3243
- echo "Increase the maximum number of open file descriptors on macOS"
3344
- NOFILE=20480
@@ -44,7 +55,7 @@ matrix:
4455
# This builder only tests code linters on latest version of Go
4556
- os: linux
4657
dist: trusty
47-
go: 1.11.x
58+
go: 1.12.x
4859
env:
4960
- lint
5061
git:
@@ -53,10 +64,10 @@ matrix:
5364
- go run build/ci.go lint
5465

5566
# This builder does the Ubuntu PPA upload
56-
- if: type = push
67+
- if: repo = ethereum/go-ethereum AND type = push
5768
os: linux
5869
dist: trusty
59-
go: 1.11.x
70+
go: 1.12.x
6071
env:
6172
- ubuntu-ppa
6273
git:
@@ -71,14 +82,15 @@ matrix:
7182
- python-bzrlib
7283
- python-paramiko
7384
script:
85+
- echo '|1|7SiYPr9xl3uctzovOTj4gMwAC1M=|t6ReES75Bo/PxlOPJ6/GsGbTrM0= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0aKz5UTUndYgIGG7dQBV+HaeuEZJ2xPHo2DS2iSKvUL4xNMSAY4UguNW+pX56nAQmZKIZZ8MaEvSj6zMEDiq6HFfn5JcTlM80UwlnyKe8B8p7Nk06PPQLrnmQt5fh0HmEcZx+JU9TZsfCHPnX7MNz4ELfZE6cFsclClrKim3BHUIGq//t93DllB+h4O9LHjEUsQ1Sr63irDLSutkLJD6RXchjROXkNirlcNVHH/jwLWR5RcYilNX7S5bIkK8NlWPjsn/8Ua5O7I9/YoE97PpO6i73DTGLh5H9JN/SITwCKBkgSDWUt61uPK3Y11Gty7o2lWsBjhBUm2Y38CBsoGmBw==' >> ~/.ssh/known_hosts
7486
- go run build/ci.go debsrc -upload ethereum/ethereum -sftp-user geth-ci -signer "Go Ethereum Linux Builder <[email protected]>"
7587

7688
# This builder does the Linux Azure uploads
77-
- if: type = push
89+
- if: repo = ethereum/go-ethereum AND type = push
7890
os: linux
7991
dist: trusty
8092
sudo: required
81-
go: 1.11.x
93+
go: 1.12.x
8294
env:
8395
- azure-linux
8496
git:
@@ -108,12 +120,12 @@ matrix:
108120
- go run build/ci.go archive -arch arm64 -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
109121

110122
# This builder does the Linux Azure MIPS xgo uploads
111-
- if: type = push
123+
- if: repo = ethereum/go-ethereum AND type = push
112124
os: linux
113125
dist: trusty
114126
services:
115127
- docker
116-
go: 1.11.x
128+
go: 1.12.x
117129
env:
118130
- azure-linux-mips
119131
git:
@@ -136,7 +148,7 @@ matrix:
136148
- go run build/ci.go archive -arch mips64le -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
137149

138150
# This builder does the Android Maven and Azure uploads
139-
- if: type = push
151+
- if: repo = ethereum/go-ethereum AND type = push
140152
os: linux
141153
dist: trusty
142154
addons:
@@ -158,25 +170,24 @@ matrix:
158170
git:
159171
submodules: false # avoid cloning ethereum/tests
160172
before_install:
161-
- curl https://storage.googleapis.com/golang/go1.11.5.linux-amd64.tar.gz | tar -xz
173+
- curl https://dl.google.com/go/go1.12.linux-amd64.tar.gz | tar -xz
162174
- export PATH=`pwd`/go/bin:$PATH
163175
- export GOROOT=`pwd`/go
164176
- export GOPATH=$HOME/go
165177
script:
166178
# Build the Android archive and upload it to Maven Central and Azure
167-
- curl https://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip -o android-ndk-r17b.zip
168-
- unzip -q android-ndk-r17b.zip && rm android-ndk-r17b.zip
169-
- mv android-ndk-r17b $HOME
170-
- export ANDROID_NDK=$HOME/android-ndk-r17b
179+
- curl https://dl.google.com/android/repository/android-ndk-r19b-linux-x86_64.zip -o android-ndk-r19b.zip
180+
- unzip -q android-ndk-r19b.zip && rm android-ndk-r19b.zip
181+
- mv android-ndk-r19b $ANDROID_HOME/ndk-bundle
171182

172183
- mkdir -p $GOPATH/src/github.com/ethereum
173-
- ln -s `pwd` $GOPATH/src/github.com/ethereum
184+
- ln -s `pwd` $GOPATH/src/github.com/ethereum/go-ethereum
174185
- go run build/ci.go aar -signer ANDROID_SIGNING_KEY -deploy https://oss.sonatype.org -upload gethstore/builds
175186

176187
# This builder does the OSX Azure, iOS CocoaPods and iOS Azure uploads
177-
- if: type = push
188+
- if: repo = ethereum/go-ethereum AND type = push
178189
os: osx
179-
go: 1.11.x
190+
go: 1.12.x
180191
env:
181192
- azure-osx
182193
- azure-ios
@@ -203,13 +214,22 @@ matrix:
203214
- go run build/ci.go xcode -signer IOS_SIGNING_KEY -deploy trunk -upload gethstore/builds
204215

205216
# This builder does the Azure archive purges to avoid accumulating junk
206-
- if: type = cron
217+
- if: repo = ethereum/go-ethereum AND type = cron
207218
os: linux
208219
dist: trusty
209-
go: 1.11.x
220+
go: 1.12.x
210221
env:
211222
- azure-purge
212223
git:
213224
submodules: false # avoid cloning ethereum/tests
214225
script:
215-
- go run build/ci.go purge -store gethstore/builds -days 14
226+
- go run build/ci.go purge -store gethstore/builds -days 14
227+
228+
- name: Race Detector for Swarm
229+
if: repo = ethersphere/go-ethereum
230+
os: linux
231+
dist: trusty
232+
go: 1.12.x
233+
git:
234+
submodules: false # avoid cloning ethereum/tests
235+
script: ./build/travis_keepalive.sh go test -timeout 20m -race ./swarm... ./p2p/{protocols,simulations,testing}/...

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build Geth in a stock Go builder container
2-
FROM golang:1.11-alpine as builder
2+
FROM golang:1.12-alpine as builder
33

44
RUN apk add --no-cache make gcc musl-dev linux-headers
55

Dockerfile.alltools

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build Geth in a stock Go builder container
2-
FROM golang:1.11-alpine as builder
2+
FROM golang:1.12-alpine as builder
33

44
RUN apk add --no-cache make gcc musl-dev linux-headers
55

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Go Ethereum
22

3-
Official golang implementation of the Ethereum protocol.
3+
Official Golang implementation of the Ethereum protocol.
44

55
[![API Reference](
66
https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667
@@ -18,7 +18,7 @@ For prerequisites and detailed build instructions please read the
1818
[Installation Instructions](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum)
1919
on the wiki.
2020

21-
Building geth requires both a Go (version 1.9 or later) and a C compiler.
21+
Building geth requires both a Go (version 1.10 or later) and a C compiler.
2222
You can install them using your favourite package manager.
2323
Once the dependencies are installed, run
2424

@@ -35,12 +35,12 @@ The go-ethereum project comes with several wrappers/executables found in the `cm
3535
| Command | Description |
3636
|:----------:|-------------|
3737
| **`geth`** | Our main Ethereum CLI client. It is the entry point into the Ethereum network (main-, test- or private net), capable of running as a full node (default), archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as a gateway into the Ethereum network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. `geth --help` and the [CLI Wiki page](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options) for command line options. |
38-
| `abigen` | Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) with expanded functionality if the contract bytecode is also available. However it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts) wiki page for details. |
38+
| `abigen` | Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) with expanded functionality if the contract bytecode is also available. However, it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts) wiki page for details. |
3939
| `bootnode` | Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. |
4040
| `evm` | Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow isolated, fine-grained debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug`). |
4141
| `gethrpctest` | Developer utility tool to support our [ethereum/rpc-test](https://github.com/ethereum/rpc-tests) test suite which validates baseline conformity to the [Ethereum JSON RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC) specs. Please see the [test suite's readme](https://github.com/ethereum/rpc-tests/blob/master/README.md) for details. |
42-
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/ethereum/wiki/wiki/RLP)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
43-
| `swarm` | Swarm daemon and tools. This is the entrypoint for the Swarm network. `swarm --help` for command line options and subcommands. See [Swarm README](https://github.com/ethereum/go-ethereum/tree/master/swarm) for more information. |
42+
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/ethereum/wiki/wiki/RLP)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user-friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
43+
| `swarm` | Swarm daemon and tools. This is the entry point for the Swarm network. `swarm --help` for command line options and subcommands. See [Swarm README](https://github.com/ethereum/go-ethereum/tree/master/swarm) for more information. |
4444
| `puppeth` | a CLI wizard that aids in creating a new Ethereum network. |
4545

4646
## Running geth
@@ -72,7 +72,7 @@ This command will:
7272
This tool is optional and if you leave it out you can always attach to an already running Geth instance
7373
with `geth attach`.
7474

75-
### Full node on the Ethereum test network
75+
### A Full node on the Ethereum test network
7676

7777
Transitioning towards developers, if you'd like to play around with creating Ethereum contracts, you
7878
almost certainly would like to do that without any real money involved until you get the hang of the
@@ -83,10 +83,10 @@ network with your node, which is fully equivalent to the main network, but with
8383
$ geth --testnet console
8484
```
8585

86-
The `console` subcommand have the exact same meaning as above and they are equally useful on the
87-
testnet too. Please see above for their explanations if you've skipped to here.
86+
The `console` subcommand has the exact same meaning as above and they are equally useful on the
87+
testnet too. Please see above for their explanations if you've skipped here.
8888

89-
Specifying the `--testnet` flag however will reconfigure your Geth instance a bit:
89+
Specifying the `--testnet` flag, however, will reconfigure your Geth instance a bit:
9090

9191
* Instead of using the default data directory (`~/.ethereum` on Linux for example), Geth will nest
9292
itself one level deeper into a `testnet` subfolder (`~/.ethereum/testnet` on Linux). Note, on OSX
@@ -103,7 +103,7 @@ separate the two networks and will not make any accounts available between them.
103103

104104
### Full node on the Rinkeby test network
105105

106-
The above test network is a cross client one based on the ethash proof-of-work consensus algorithm. As such, it has certain extra overhead and is more susceptible to reorganization attacks due to the network's low difficulty / security. Go Ethereum also supports connecting to a proof-of-authority based test network called [*Rinkeby*](https://www.rinkeby.io) (operated by members of the community). This network is lighter, more secure, but is only supported by go-ethereum.
106+
The above test network is a cross-client one based on the ethash proof-of-work consensus algorithm. As such, it has certain extra overhead and is more susceptible to reorganization attacks due to the network's low difficulty/security. Go Ethereum also supports connecting to a proof-of-authority based test network called [*Rinkeby*](https://www.rinkeby.io) (operated by members of the community). This network is lighter, more secure, but is only supported by go-ethereum.
107107

108108
```
109109
$ geth --rinkeby console
@@ -139,13 +139,13 @@ This will start geth in fast-sync mode with a DB memory allowance of 1GB just as
139139

140140
Do not forget `--rpcaddr 0.0.0.0`, if you want to access RPC from other containers and/or hosts. By default, `geth` binds to the local interface and RPC endpoints is not accessible from the outside.
141141

142-
### Programatically interfacing Geth nodes
142+
### Programmatically interfacing Geth nodes
143143

144144
As a developer, sooner rather than later you'll want to start interacting with Geth and the Ethereum
145145
network via your own programs and not manually through the console. To aid this, Geth has built-in
146146
support for a JSON-RPC based APIs ([standard APIs](https://github.com/ethereum/wiki/wiki/JSON-RPC) and
147147
[Geth specific APIs](https://github.com/ethereum/go-ethereum/wiki/Management-APIs)). These can be
148-
exposed via HTTP, WebSockets and IPC (unix sockets on unix based platforms, and named pipes on Windows).
148+
exposed via HTTP, WebSockets and IPC (UNIX sockets on UNIX based platforms, and named pipes on Windows).
149149

150150
The IPC interface is enabled by default and exposes all the APIs supported by Geth, whereas the HTTP
151151
and WS interfaces need to manually be enabled and only expose a subset of APIs due to security reasons.
@@ -173,7 +173,7 @@ on all transports. You can reuse the same connection for multiple requests!
173173

174174
**Note: Please understand the security implications of opening up an HTTP/WS based transport before
175175
doing so! Hackers on the internet are actively trying to subvert Ethereum nodes with exposed APIs!
176-
Further, all browser tabs can access locally running webservers, so malicious webpages could try to
176+
Further, all browser tabs can access locally running web servers, so malicious web pages could try to
177177
subvert locally available APIs!**
178178

179179
### Operating a private network
@@ -241,7 +241,7 @@ that other nodes can use to connect to it and exchange peer information. Make su
241241
displayed IP address information (most probably `[::]`) with your externally accessible IP to get the
242242
actual `enode` URL.
243243

244-
*Note: You could also use a full fledged Geth node as a bootnode, but it's the less recommended way.*
244+
*Note: You could also use a full-fledged Geth node as a bootnode, but it's the less recommended way.*
245245

246246
#### Starting up your member nodes
247247

@@ -264,7 +264,7 @@ an OpenCL or CUDA enabled `ethminer` instance. For information on such a setup,
264264
[EtherMining subreddit](https://www.reddit.com/r/EtherMining/) and the [Genoil miner](https://github.com/Genoil/cpp-ethereum)
265265
repository.
266266

267-
In a private network setting however, a single CPU miner instance is more than enough for practical
267+
In a private network setting, however a single CPU miner instance is more than enough for practical
268268
purposes as it can produce a stable stream of blocks at the correct intervals without needing heavy
269269
resources (consider running on a single thread, no need for multiple ones either). To start a Geth
270270
instance for mining, run it with all your usual flags, extended by:
@@ -298,7 +298,7 @@ Please make sure your contributions adhere to our coding guidelines:
298298
* E.g. "eth, rpc: make trace configs optional"
299299

300300
Please see the [Developers' Guide](https://github.com/ethereum/go-ethereum/wiki/Developers'-Guide)
301-
for more details on configuring your environment, managing project dependencies and testing procedures.
301+
for more details on configuring your environment, managing project dependencies, and testing procedures.
302302

303303
## License
304304

accounts/abi/abi.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,11 @@ func (abi ABI) Pack(name string, args ...interface{}) ([]byte, error) {
5858
return nil, err
5959
}
6060
return arguments, nil
61-
6261
}
6362
method, exist := abi.Methods[name]
6463
if !exist {
6564
return nil, fmt.Errorf("method '%s' not found", name)
6665
}
67-
6866
arguments, err := method.Inputs.Pack(args...)
6967
if err != nil {
7068
return nil, err
@@ -138,7 +136,7 @@ func (abi *ABI) UnmarshalJSON(data []byte) error {
138136
// returns nil if none found
139137
func (abi *ABI) MethodById(sigdata []byte) (*Method, error) {
140138
if len(sigdata) < 4 {
141-
return nil, fmt.Errorf("data too short (% bytes) for abi method lookup", len(sigdata))
139+
return nil, fmt.Errorf("data too short (%d bytes) for abi method lookup", len(sigdata))
142140
}
143141
for _, method := range abi.Methods {
144142
if bytes.Equal(method.Id(), sigdata[:4]) {

0 commit comments

Comments
 (0)