Commit Graph

11426 Commits

Author SHA1 Message Date
Felix Lange
1314aeebdb build: use golangci-lint (#20295)
* build: use golangci-lint

This changes build/ci.go to download and run golangci-lint instead
of gometalinter.

* core/state: fix unnecessary conversion

* p2p/simulations: fix lock copying (found by go vet)

* signer/core: fix unnecessary conversions

* crypto/ecies: remove unused function cmpPublic

* core/rawdb: remove unused function print

* core/state: remove unused function xTestFuzzCutter

* core/vm: disable TestWriteExpectedValues in a different way

* core/forkid: remove unused function checksum

* les: remove unused type proofsData

* cmd/utils: remove unused functions prefixedNames, prefixFor

* crypto/bn256: run goimports

* p2p/nat: fix goimports lint issue

* cmd/clef: avoid using unkeyed struct fields

* les: cancel context in testRequest

* rlp: delete unreachable code

* core: gofmt

* internal/build: simplify DownloadFile for Go 1.11 compatibility

* build: remove go test --short flag

* .travis.yml: disable build cache

* whisper/whisperv6: fix ineffectual assignment in TestWhisperIdentityManagement

* .golangci.yml: enable goconst and ineffassign linters

* build: print message when there are no lint issues

* internal/build: refactor download a bit
2019-12-03 13:38:59 +01:00
Felix Lange
2167e1455e rpc, p2p/simulations: use github.com/gorilla/websocket (#20289)
* rpc: improve codec abstraction

rpc.ServerCodec is an opaque interface. There was only one way to get a
codec using existing APIs: rpc.NewJSONCodec. This change exports
newCodec (as NewFuncCodec) and NewJSONCodec (as NewCodec). It also makes
all codec methods non-public to avoid showing internals in godoc.

While here, remove codec options in tests because they are not
supported anymore.

* p2p/simulations: use github.com/gorilla/websocket

This package was the last remaining user of golang.org/x/net/websocket.
Migrating to the new library wasn't straightforward because it is no
longer possible to treat WebSocket connections as a net.Conn.

* vendor: delete golang.org/x/net/websocket

* rpc: fix godoc comments and run gofmt
2019-12-03 13:37:18 +01:00
Michael Forney
1f01ebb26c cmd/evm: Allow loading input from file (#20273)
Make it possible to load input from a file. Simlar to `--code` / `--codefile`, have `--input`/`--inputfile`.
2019-12-03 13:36:01 +01:00
Martin Holst Swende
0e0ed4ec64 internal/ethapi: don't query wallets at every execution of gas estimation 2019-12-03 13:32:36 +01:00
nebojsa94
7b91786136 core/vm: fix tracer interface parameter name (#20294) 2019-12-03 13:32:21 +01:00
meowsbits
ebbb7db055 params: finish sentence in comment (#20291) 2019-12-03 13:31:20 +01:00
Guillaume Ballet
a564a7569d build: gather info to investigate why builds fail on ARM (#20281) 2019-12-03 13:31:10 +01:00
Guillaume Ballet
b7216cfc8a whisper/whisperv6: fix staticcheck issues (#20288) 2019-12-03 13:30:23 +01:00
Felix Lange
745897e61a dashboard: remove the dashboard (#20279)
This removes the dashboard project. The dashboard was an experimental
browser UI for geth which displayed metrics and chain information in
real time. We are removing it because it has marginal utility and nobody
on the team can maintain it.

Removing the dashboard removes a lot of dependency code and shaves
6 MB off the geth binary size.
2019-12-03 13:30:03 +01:00
Felix Lange
9d7e7062b4 p2p/enode: mock DNS resolver in URL parsing test (#20252) 2019-12-03 13:27:33 +01:00
Jorropo
a55685bd47 rpc: fix typo example code (#20284) 2019-12-03 13:27:00 +01:00
gary rong
a430b92ea2 accounts/abi/bind, cmd/abigen: implement alias for abigen (#20244)
* accounts/abi/bind, cmd/abigen: implement alias for abigen

* accounts/abi/bind: minor fixes

* accounts/abi/bind: address comments

* cmd/abigen: address comments

* accounts/abi/bind: print error log when identifier collision

* accounts/abi/bind: address comments

* accounts/abi/bind: address comment
2019-12-03 13:26:50 +01:00
Felföldi Zsolt
af7a1df2ff les: implement server priority API (#20070)
This PR implements the LES server RPC API. Methods for server
capacity, client balance and client priority management are provided.
2019-12-03 13:26:36 +01:00
Guillaume Ballet
e0298f4347 miner: increase worker test timeout (#20268)
TestEmptyWork* occasionally fails due to timeout. Increase the timeout.
2019-12-03 13:26:00 +01:00
Kurkó Mihály
5a022eff02 dashboard: send current block to the dashboard client (#19762)
This adds all dashboard changes from the last couple months.
We're about to remove the dashboard, but decided that we should
get all the recent work in first in case anyone wants to pick up this
project later on.

* cmd, dashboard, eth, p2p: send peer info to the dashboard
* dashboard: update npm packages, improve UI, rebase
* dashboard, p2p: remove println, change doc
* cmd, dashboard, eth, p2p: cleanup after review
* dashboard: send current block to the dashboard client
2019-12-03 13:25:45 +01:00
Rick
3cffe15beb p2p: fix bug in TestPeerDisconnect (#20277) 2019-12-03 13:24:43 +01:00
Guillaume Ballet
e7111b18b2 travis: enable test suite on ARM64 (#20219)
* travis: Enable ARM support

* Include fixes from 20039

* Add a trace to debug the invalid lookup issue

* Try increasing the timeout to see if the arm test passes

* Investigate the resolver issue

* Increase arm64 timeout for clique test

* increase timeout in tests for arm64

* Only test the failing tests

* Review feedback: don't export epsilon

* Remove investigation tricks+include fjl's feeback

* Revert the retry ahead of using the mock resolver

* Fix rebase errors
2019-12-03 13:24:34 +01:00
Felix Lange
5325c8a283 p2p/enode: mock DNS resolver in URL parsing test (#20252) 2019-12-03 13:24:17 +01:00
Péter Szilágyi
8d6551bc67 params: begin v1.9.8 release cycle 2019-12-03 13:23:25 +01:00
Péter Szilágyi
ed19b80a40 params: release Geth v1.9.7 2019-12-03 13:23:16 +01:00
gary rong
a5b9166434 accounts/abi: add internalType information and fix issues (#20179)
* accounts/abi: fix various issues

The fixed issues include:

(1) If there is no return in a call function, unpack should
return nil error

(2) For some functions which have struct array as parameter,
it will also be detected and generate the struct definition

(3) For event, if it has non-indexed parameter, the parameter
name will also be assigned if empty. Also the internal struct
will be detected and generate struct defition if not exist.

(4) Fix annotation generation in event function

* accounts/abi: add new abi field internalType

* accounts: address comments and add tests

* accounts/abi: replace strings.ReplaceAll with strings.Replace
2019-12-03 13:23:00 +01:00
Péter Szilágyi
c008e97439 params: hard-code new CHTs for the 1.9.7 release 2019-12-03 13:22:22 +01:00
Péter Szilágyi
2b277543ba travis: bump linter to Go 1.13.x 2019-12-03 13:22:13 +01:00
Péter Szilágyi
c8da16736c travis, build, internal: use own Go bundle for PPA builds (#20240)
* build: bump PPAs to Go 1.13 (via longsleep), keep Trusty on 1.11

* travis, build, vendor: use own Go bundle for PPA builds

* travis, build, internal, vendor: smarter Go bundler, own untar

* build: updated ci-notes with new Go bundling, only make, don't test
2019-12-03 13:21:54 +01:00
Martin Holst Swende
1aaa4da98e core/evm: avoid copying memory for input in calls (#20177)
* core/evm, contracts: avoid copying memory for input in calls + make ecrecover not modify input buffer

* core/vm: optimize mstore a bit

* core/vm: change Get -> GetCopy in vm memory access
2019-12-03 13:21:13 +01:00
gary rong
052e52ddf4 cmd/puppeth: integrate istanbul into puppeth (#19926)
* cmd/puppeth: integrate istanbul into puppeth

* cmd/puppeth: address comment

* cmd/puppeth: use hexutil.Big for fork indicator

* cmd/puppeth: finalize istanbul fork

* cmd/puppeth: fix 2200 for parity, rename is to eip1283ReenableTransition

* cmd/puppeth: fix eip1108

* cmd/puppeth: add blake2f for parity

* cmd/puppeth: add aleth istanbul precompiled

* cmd/puppeth: use hexutil.Big

* cmd/puppeth: fix unit tests

* cmd/puppeth: update testdata
2019-12-03 13:20:11 +01:00
gary rong
4044d8e4e4 les: rework clientpool (#20077)
* les: rework clientpool
2019-12-03 13:17:25 +01:00
Samuel Marks
ea94cf6575 appveyor: bump to Go 1.13.4 2019-12-03 13:16:42 +01:00
gary rong
a1e263a9c9 accounts/abi: add internalType information and fix issues (#20179)
* accounts/abi: fix various issues

The fixed issues include:

(1) If there is no return in a call function, unpack should
return nil error

(2) For some functions which have struct array as parameter,
it will also be detected and generate the struct definition

(3) For event, if it has non-indexed parameter, the parameter
name will also be assigned if empty. Also the internal struct
will be detected and generate struct defition if not exist.

(4) Fix annotation generation in event function

* accounts/abi: add new abi field internalType

* accounts: address comments and add tests

* accounts/abi: replace strings.ReplaceAll with strings.Replace
2019-12-03 13:16:25 +01:00
Martin Holst Swende
54cf44f46d params, core/forkid: configure mainnet istanbul block 9069K (#20222)
* params: configure mainnet istanbul block 9069K

* core/forkid: add some more test items for mainnet istanbul
2019-12-03 13:14:58 +01:00
Péter Szilágyi
9fb7ac8d3e cmd/devp2p, core/forkid: make forkid.Filter API uniform 2019-12-03 13:14:45 +01:00
gary rong
71a4fb4195 miner: increase import time allowance (#20217)
Fix the block import unit test which can time out sometimes.
2019-12-03 13:14:31 +01:00
Péter Szilágyi
78f4e1a457 core/forkid: add two clauses for more precise validation (#20220) 2019-12-03 13:14:21 +01:00
Péter Szilágyi
1540e9c83b eth: eth/64 - extend handshake packet with fork id 2019-12-03 13:13:36 +01:00
Felix Lange
0016180259 cmd/devp2p, p2p: dial using node iterator, discovery crawler (#20132)
* p2p/enode: add Iterator and associated utilities

* p2p/discover: add RandomNodes iterator

* p2p: dial using iterator

* cmd/devp2p: add discv4 crawler

* cmd/devp2p: WIP nodeset filter

* cmd/devp2p: fixup lesFilter

* core/forkid: add NewStaticFilter

* cmd/devp2p: make -eth-network filter actually work

* cmd/devp2p: improve crawl timestamp handling

* cmd/devp2p: fix typo

* p2p/enode: fix comment typos

* p2p/discover: fix comment typos

* p2p/discover: rename lookup.next to 'advance'

* p2p: lower discovery mixer timeout

* p2p/enode: implement dynamic FairMix timeouts

* cmd/devp2p: add ropsten support in -eth-network filter

* cmd/devp2p: tweak crawler log message
2019-12-03 13:08:33 +01:00
Martin Holst Swende
7df0db66d6 eth/downloader: fix data race in downloader 2019-12-03 13:06:36 +01:00
Michael Forney
ccbacdf8e1 core/asm: assembly parser label fixes (#20210)
* core/asm: Fix encoding of pushed labels

EVM uses big-endian byte-order, so to pad a label value to 4 bytes,
zeros must be added to the front, not the end.

* core/asm: Fix PC calculations when a label is pushed

Incrementing PC by 5 is only correct if the label appears after a jump,
in which case there is an implicit push. When it appears after an explicit
push, PC should only be incremented by 4.

* core/asm: Allow JUMP with no argument

This way, a label can be pushed explicitly, or loaded from memory to
implement a jump table.
2019-12-03 13:05:34 +01:00
gary rong
dec8b5cf64 cmd/evm: remove surrounding whitespace in hex input code (#20211)
This way, the output of `evm compile` can be used directly in `evm
--codefile code.txt run`, without stripping the trailing newline first.
2019-12-03 13:05:14 +01:00
Michael Forney
206ba4ea54 cmd/evm: remove surrounding whitespace in hex input code (#20211)
This way, the output of `evm compile` can be used directly in `evm
--codefile code.txt run`, without stripping the trailing newline first.
2019-12-03 13:03:44 +01:00
Guillaume Ballet
148321fa17 consensus: fix possessives in comments. (#20209) 2019-12-03 13:02:57 +01:00
Martin Holst Swende
4e93af5661 clef: resolve windows pipes, fixes #20121 (#20166) 2019-12-03 13:02:45 +01:00
Piotr Dyraga
4baf9215b1 accounts/abi/bind: take into account gas price during gas estimation (#20189)
The gas price was not passed to the `EstimateGas` function. As a result,
conditional execution paths depending on `tx.gasprice` could be not
correctly processed and we could get invalid gas estimates for contract
function calls.
2019-12-03 13:02:34 +01:00
gary rong
5f494b1639 miner: add generate and import unit test (#20111)
This PR adds a new unit test in miner package which will create some blocks from miner and then import into another chain. In this way, we can ensure all blocks generated by Geth miner obey consensus rules.
2019-12-03 13:02:17 +01:00
Marius Kjærstad
b295b5eac7 metrics: change links in README.md to https (#20182) 2019-12-03 13:00:41 +01:00
Marius Kjærstad
7e7e07dba8 dashboard: change links in README to https (#20181)
Changed http:// to https:// on links in dashboard/README.md
2019-12-03 13:00:30 +01:00
Marius Kjærstad
e184b8e97e Changed http:// to https:// on links in log/README.md (#20178)
docs: change http to https on links in log/README.md
2019-12-03 13:00:09 +01:00
Jeffery Robert Walsh
0d156f960a README: use new miner threads flag instead of legacy minerthreads flag (#20165) 2019-12-03 12:59:57 +01:00
Ross
c2806ceae7 p2p/simulations: add node properties support and utility functions (#20060) 2019-12-03 12:59:45 +01:00
Felix Lange
f1b4fe6e49 p2p/dnsdisc: update to latest EIP-1459 spec (#20168)
This updates the DNS TXT record format to the latest
changes in ethereum/EIPs#2313.
2019-12-03 12:59:27 +01:00
Martin Holst Swende
ac2325978a cmd/utils: fix command line flag resolve (#20167)
In Geth, we have two sources for configuration:
(1) Config file
(2) Command line flag

Basically geth will first resolve config file and then overwrite
configs with command line flags.

This issue is: geth should only overwrite configs if flags are truly
set. So before we apply any flag to configs, `GlobalIsSet` check
is necessary.
2019-12-03 12:59:09 +01:00