Commit Graph

1114 Commits

Author SHA1 Message Date
amalraj.manigmail.com c3c479d2aa Merge remote-tracking branch 'remotes/geth/release/1.8' into merge-193
# Conflicts:
#	.github/CODEOWNERS
#	.travis.yml
#	README.md
#	VERSION
#	accounts/abi/argument.go
#	accounts/abi/bind/backends/simulated.go
#	accounts/abi/bind/bind_test.go
#	accounts/abi/event_test.go
#	accounts/abi/numbers.go
#	accounts/abi/numbers_test.go
#	accounts/abi/reflect.go
#	accounts/accounts.go
#	accounts/keystore/keystore.go
#	accounts/keystore/keystore_wallet.go
#	accounts/usbwallet/internal/trezor/trezor.go
#	accounts/usbwallet/ledger.go
#	accounts/usbwallet/wallet.go
#	appveyor.yml
#	build/ci.go
#	build/goimports.sh
#	cmd/ethkey/generate.go
#	cmd/ethkey/inspect.go
#	cmd/ethkey/main.go
#	cmd/ethkey/message.go
#	cmd/ethkey/utils.go
#	cmd/faucet/faucet.go
#	cmd/geth/chaincmd.go
#	cmd/geth/config.go
#	cmd/geth/main.go
#	cmd/geth/misccmd.go
#	cmd/geth/usage.go
#	cmd/p2psim/main.go
#	cmd/puppeth/genesis.go
#	cmd/puppeth/module_dashboard.go
#	cmd/puppeth/wizard_faucet.go
#	cmd/puppeth/wizard_genesis.go
#	cmd/puppeth/wizard_netstats.go
#	cmd/puppeth/wizard_node.go
#	cmd/puppeth/wizard_wallet.go
#	cmd/swarm/config.go
#	cmd/swarm/config_test.go
#	cmd/swarm/db.go
#	cmd/swarm/hash.go
#	cmd/swarm/main.go
#	cmd/swarm/manifest.go
#	cmd/swarm/run_test.go
#	cmd/swarm/upload.go
#	cmd/swarm/upload_test.go
#	cmd/utils/flags.go
#	cmd/wnode/main.go
#	common/bytes.go
#	common/compiler/solidity.go
#	common/hexutil/hexutil.go
#	common/math/big.go
#	common/math/integer.go
#	common/mclock/mclock.go
#	common/types.go
#	common/types_template.go
#	consensus/clique/clique.go
#	consensus/consensus.go
#	consensus/ethash/algorithm.go
#	consensus/ethash/consensus.go
#	consensus/ethash/ethash.go
#	containers/vagrant/Vagrantfile
#	contracts/ens/ens_test.go
#	core/asm/compiler.go
#	core/asm/lexer.go
#	core/block_validator.go
#	core/blockchain.go
#	core/blockchain_test.go
#	core/chain_makers.go
#	core/database_util.go
#	core/database_util_test.go
#	core/events.go
#	core/genesis.go
#	core/genesis_alloc.go
#	core/genesis_test.go
#	core/headerchain.go
#	core/rawdb/accessors_chain.go
#	core/rawdb/accessors_indexes.go
#	core/rawdb/accessors_metadata.go
#	core/rawdb/schema.go
#	core/state/state_test.go
#	core/state/statedb.go
#	core/state/sync.go
#	core/state_processor.go
#	core/state_transition.go
#	core/tx_journal.go
#	core/tx_list.go
#	core/tx_pool.go
#	core/tx_pool_test.go
#	core/types.go
#	core/types/block.go
#	core/types/block_test.go
#	core/types/gen_receipt_json.go
#	core/types/log.go
#	core/types/receipt.go
#	core/types/transaction.go
#	core/types/transaction_signing.go
#	core/types/transaction_signing_test.go
#	core/types/transaction_test.go
#	core/vm/errors.go
#	core/vm/evm.go
#	core/vm/gas.go
#	core/vm/gas_table.go
#	core/vm/instructions.go
#	core/vm/instructions_test.go
#	core/vm/interface.go
#	core/vm/interpreter.go
#	core/vm/intpool.go
#	core/vm/jump_table.go
#	core/vm/logger.go
#	core/vm/logger_test.go
#	core/vm/memory_table.go
#	core/vm/opcodes.go
#	core/vm/runtime/env.go
#	core/vm/runtime/runtime.go
#	crypto/crypto.go
#	crypto/crypto_test.go
#	eth/api.go
#	eth/api_backend.go
#	eth/api_tracer.go
#	eth/backend.go
#	eth/config.go
#	eth/downloader/downloader.go
#	eth/downloader/queue.go
#	eth/downloader/statesync.go
#	eth/filters/filter.go
#	eth/filters/filter_system.go
#	eth/filters/filter_system_test.go
#	eth/gen_config.go
#	eth/handler.go
#	eth/handler_test.go
#	eth/helper_test.go
#	eth/protocol.go
#	eth/sync.go
#	eth/tracers/internal/tracers/4byte_tracer.js
#	eth/tracers/internal/tracers/assets.go
#	eth/tracers/tracer_test.go
#	eth/tracers/tracers_test.go
#	ethclient/ethclient.go
#	ethdb/database.go
#	ethdb/interface.go
#	ethdb/memory_database.go
#	ethstats/ethstats.go
#	event/feed.go
#	internal/ethapi/api.go
#	internal/ethapi/backend.go
#	internal/guide/guide_test.go
#	internal/web3ext/web3ext.go
#	les/api_backend.go
#	les/backend.go
#	les/fetcher.go
#	les/handler.go
#	les/helper_test.go
#	les/odr_requests.go
#	les/odr_test.go
#	les/retrieve.go
#	les/server.go
#	les/serverpool.go
#	light/lightchain.go
#	light/odr_test.go
#	light/postprocess.go
#	light/txpool.go
#	log/README.md
#	log/doc.go
#	log/format.go
#	log/handler.go
#	log/logger.go
#	log/root.go
#	metrics/exp/exp.go
#	metrics/influxdb/influxdb.go
#	metrics/metrics.go
#	metrics/resetting_timer.go
#	metrics/resetting_timer_test.go
#	metrics/timer_test.go
#	miner/worker.go
#	mobile/accounts.go
#	mobile/ethereum.go
#	mobile/geth.go
#	node/config.go
#	node/doc.go
#	p2p/discover/database.go
#	p2p/discover/database_test.go
#	p2p/discover/table.go
#	p2p/discover/table_test.go
#	p2p/discover/udp.go
#	p2p/discover/udp_test.go
#	p2p/discv5/udp.go
#	p2p/enr/enr.go
#	p2p/enr/enr_test.go
#	p2p/enr/entries.go
#	p2p/protocols/protocol.go
#	p2p/protocols/protocol_test.go
#	p2p/rlpx_test.go
#	p2p/server.go
#	p2p/simulations/adapters/docker.go
#	p2p/simulations/adapters/exec.go
#	p2p/simulations/adapters/inproc.go
#	p2p/simulations/adapters/types.go
#	p2p/simulations/http.go
#	p2p/simulations/http_test.go
#	p2p/simulations/mocker.go
#	p2p/simulations/network.go
#	p2p/simulations/network_test.go
#	p2p/testing/protocolsession.go
#	params/bootnodes.go
#	params/config.go
#	params/denomination.go
#	params/gas_table.go
#	params/protocol_params.go
#	params/version.go
#	rpc/http.go
#	rpc/json.go
#	rpc/utils.go
#	signer/core/api.go
#	swarm/api/api.go
#	swarm/api/api_test.go
#	swarm/api/client/client.go
#	swarm/api/client/client_test.go
#	swarm/api/config.go
#	swarm/api/config_test.go
#	swarm/api/filesystem.go
#	swarm/api/filesystem_test.go
#	swarm/api/http/error.go
#	swarm/api/http/error_templates.go
#	swarm/api/http/error_test.go
#	swarm/api/http/roundtripper.go
#	swarm/api/http/server.go
#	swarm/api/http/server_test.go
#	swarm/api/http/templates.go
#	swarm/api/manifest.go
#	swarm/api/manifest_test.go
#	swarm/api/storage.go
#	swarm/api/storage_test.go
#	swarm/api/uri.go
#	swarm/api/uri_test.go
#	swarm/fuse/fuse_dir.go
#	swarm/fuse/fuse_file.go
#	swarm/fuse/swarmfs.go
#	swarm/fuse/swarmfs_test.go
#	swarm/fuse/swarmfs_unix.go
#	swarm/fuse/swarmfs_util.go
#	swarm/metrics/flags.go
#	swarm/network/depo.go
#	swarm/network/forwarding.go
#	swarm/network/hive.go
#	swarm/network/kademlia/address.go
#	swarm/network/kademlia/kaddb.go
#	swarm/network/kademlia/kademlia.go
#	swarm/network/kademlia/kademlia_test.go
#	swarm/network/messages.go
#	swarm/network/protocol.go
#	swarm/network/syncdb.go
#	swarm/network/syncdb_test.go
#	swarm/network/syncer.go
#	swarm/services/swap/swap.go
#	swarm/services/swap/swap/swap.go
#	swarm/storage/chunker.go
#	swarm/storage/chunker_test.go
#	swarm/storage/common_test.go
#	swarm/storage/database.go
#	swarm/storage/dbstore.go
#	swarm/storage/dbstore_test.go
#	swarm/storage/dpa.go
#	swarm/storage/dpa_test.go
#	swarm/storage/localstore.go
#	swarm/storage/memstore.go
#	swarm/storage/netstore.go
#	swarm/storage/pyramid.go
#	swarm/storage/swarmhasher.go
#	swarm/storage/types.go
#	swarm/swarm.go
#	swarm/swarm_test.go
#	swarm/testutil/http.go
#	tests/block_test_util.go
#	tests/difficulty_test.go
#	tests/init.go
#	tests/state_test_util.go
#	tests/transaction_test.go
#	tests/util.go
#	tests/vm_test_util.go
#	trie/database.go
#	trie/encoding.go
#	trie/hasher.go
#	trie/iterator.go
#	trie/proof.go
#	trie/proof_test.go
#	trie/secure_trie.go
#	trie/sync.go
#	trie/sync_test.go
#	trie/trie.go
#	vendor/github.com/docker/docker/pkg/reexec/command_linux.go
#	vendor/github.com/docker/docker/pkg/reexec/command_unix.go
#	vendor/github.com/docker/docker/pkg/reexec/command_unsupported.go
#	vendor/github.com/docker/docker/pkg/reexec/command_windows.go
#	vendor/github.com/docker/docker/pkg/reexec/reexec.go
#	vendor/github.com/eapache/channels/.gitignore
#	vendor/github.com/eapache/queue/.gitignore
#	vendor/github.com/naoina/toml/encode.go
#	vendor/github.com/naoina/toml/parse.go
#	vendor/github.com/naoina/toml/parse.peg
#	vendor/github.com/naoina/toml/parse.peg.go
#	vendor/github.com/rcrowley/go-metrics/.gitignore
#	vendor/github.com/rcrowley/go-metrics/.travis.yml
#	vendor/github.com/rcrowley/go-metrics/README.md
#	vendor/github.com/rcrowley/go-metrics/counter.go
#	vendor/github.com/rcrowley/go-metrics/debug.go
#	vendor/github.com/rcrowley/go-metrics/ewma.go
#	vendor/github.com/rcrowley/go-metrics/exp/exp.go
#	vendor/github.com/rcrowley/go-metrics/gauge.go
#	vendor/github.com/rcrowley/go-metrics/gauge_float64.go
#	vendor/github.com/rcrowley/go-metrics/graphite.go
#	vendor/github.com/rcrowley/go-metrics/healthcheck.go
#	vendor/github.com/rcrowley/go-metrics/histogram.go
#	vendor/github.com/rcrowley/go-metrics/json.go
#	vendor/github.com/rcrowley/go-metrics/log.go
#	vendor/github.com/rcrowley/go-metrics/meter.go
#	vendor/github.com/rcrowley/go-metrics/metrics.go
#	vendor/github.com/rcrowley/go-metrics/opentsdb.go
#	vendor/github.com/rcrowley/go-metrics/registry.go
#	vendor/github.com/rcrowley/go-metrics/runtime.go
#	vendor/github.com/rcrowley/go-metrics/sample.go
#	vendor/github.com/rcrowley/go-metrics/syslog.go
#	vendor/github.com/rcrowley/go-metrics/timer.go
#	vendor/github.com/rcrowley/go-metrics/writer.go
#	vendor/github.com/syndtr/goleveldb/leveldb/db.go
#	vendor/golang.org/x/sys/unix/mksysnum_linux.pl
#	vendor/golang.org/x/sys/unix/types_linux.go
#	vendor/vendor.json
#	whisper/shhclient/client.go
#	whisper/whisperv5/api.go
#	whisper/whisperv5/peer_test.go
#	whisper/whisperv5/whisper.go
#	whisper/whisperv6/api.go
#	whisper/whisperv6/peer_test.go
#	whisper/whisperv6/whisper.go
2018-07-24 16:11:05 +08:00
emile 526abe2736 eth/tracers: fix noop tracer (#17220) 2018-07-22 22:11:52 +03:00
Ralph Caraveo III 5d30be412b all: switch out defunct set library to different one (#16873)
* keystore, ethash, eth, miner, rpc, whisperv6: tech debt with now defunct set.

* whisperv5: swap out gopkg.in/fatih/set.v0 with supported set
2018-07-16 10:54:19 +03:00
Péter Szilágyi e1f1d3085c
accounts, eth, les: blockhash based filtering on all code paths 2018-07-12 18:16:54 +03:00
Domino Valdano 96339daf40
eth/filters, ethereum: EIP-234 add blockHash param for eth_getLogs 2018-07-12 18:16:32 +03:00
Péter Szilágyi d926bf2c7e trie: cache collapsed tries node, not rlp blobs (#16876)
The current trie memory database/cache that we do pruning on stores
trie nodes as binary rlp encoded blobs, and also stores the node
relationships/references for GC purposes. However, most of the trie
nodes (everything apart from a value node) is in essence just a
collection of references.

This PR switches out the RLP encoded trie blobs with the
collapsed-but-not-serialized trie nodes. This permits most of the
references to be recovered from within the node data structure,
avoiding the need to track them a second time (expensive memory wise).
2018-06-21 11:28:05 +02:00
Martin Holst Swende 4210dd1500
tracers: fix err in 4byte, add some opcode analysis tools 2018-06-20 11:42:57 +03:00
williambannas 9402f96597 eth: conform better to the golint standards (#16783)
* eth: made changes to conform better to the golint standards

* eth: fix comment nit
2018-06-14 13:14:52 +03:00
knarfeh e75d0a6e4c eth/filters: make filterLogs func more readable (#16920) 2018-06-14 12:27:02 +03:00
Wenbiao Zheng ea89f40f0d eth/fetcher: fix annotation (#16969) 2018-06-13 17:02:28 +03:00
Felföldi Zsolt 049f5b3572 core, eth, les: more efficient hash-based header chain retrieval (#16946) 2018-06-12 16:52:54 +03:00
Martin Holst Swende eac16f9824 core: improve getBadBlocks to return full block rlp (#16902)
* core: improve getBadBlocks to return full block rlp

* core, eth, ethapi: changes to getBadBlocks formatting

* ethapi: address review concerns
2018-06-11 11:03:40 +03:00
Martin Holst Swende 400332b99d eth/tracers: fix minor off-by-one error (#16879)
* tracing: fix minor off-by-one error

* tracers: go generate
2018-06-05 10:27:07 +03:00
Péter Szilágyi 143c4341d8
core, eth, trie: streaming GC for the trie cache (#16810)
* core, eth, trie: streaming GC for the trie cache

* trie: track memcache statistics
2018-06-04 10:47:43 +03:00
Qvintvs a67eccbcd8 debug tests 2018-06-01 12:51:35 +08:00
Qvintvs 622e98ad51 debug merge attempt 2018-05-31 14:21:16 +08:00
Qvintvs 4b44bea1d7 Merge attempt 2018-05-31 14:16:44 +08:00
Wenbiao Zheng 38c7eb0f26 trie: rename TrieSync to Sync and improve hexToKeybytes (#16804)
This removes a golint warning: type name will be used as trie.TrieSync by
other packages, and that stutters; consider calling this Sync.

In hexToKeybytes len(hex) is even and (even+1)/2 == even/2, remove the +1.
2018-05-29 17:48:43 +02:00
kiel barry 84f8c0cc1f common: improve documentation comments (#16701)
This commit adds many comments and removes unused code.
It also removes the EmptyHash function, which had some uses
but was silly.
2018-05-29 12:42:21 +02:00
Smilenator 40a2c52397 eth/fetcher: reuse variables for hash and number (#16819) 2018-05-29 10:57:08 +03:00
Wenbiao Zheng d6ed2f67a8 eth, node, trie: fix minor typos (#16802) 2018-05-24 15:55:20 +03:00
Péter Szilágyi d9cee2c172
eth: propagate blocks and transactions async 2018-05-21 11:32:42 +03:00
Péter Szilágyi 49719e21bc
core, eth: minor txpool event cleanups 2018-05-18 12:08:24 +03:00
rjl493456442 a2e43d28d0
all: collate new transaction events together 2018-05-18 11:46:44 +03:00
gary rong 7beccb29be all: get rid of error when creating memory database (#16716)
* all: get rid of error when create mdb

* core: clean up variables definition

* all: inline mdb definition
2018-05-09 15:24:25 +03:00
gary rong 4e7dc34ff1 eth/filter: check nil pointer when unsubscribe (#16682)
* eth/filter: check nil pointer when unsubscribe

* eth/filters, accounts, rpc: abort system if subscribe failed

* eth/filter: add crit log before exit

* eth/filter, event: minor fixes
2018-05-09 11:29:25 +03:00
kiel barry 4747aad160 eth: golint fixes to variable names (#16711) 2018-05-09 10:59:00 +03:00
Domino Valdano fedae95015 eth/filters: derive FilterCriteria from ethereum.FilterQuery (#16629) 2018-05-08 14:39:15 +02:00
Péter Szilágyi 6cf0ab38bd
core/rawdb: separate raw database access to own package (#16666) 2018-05-07 14:35:06 +03:00
kiel barry 5b3af4c3d1 eth: golint updates for this or self warning (#16632)
* eth/*:golint updates for this or self warning

* eth/*: golint updates for this or self warning, pr updated per feedback
2018-05-03 15:15:33 +03:00
Péter Szilágyi 7a7428a027
core, eth: fix tracer dirty finalization 2018-04-27 14:29:18 +03:00
Domino Valdano 7cf83cee52 eth/downloader: fix for Issue #16539 (#16546) 2018-04-23 10:01:21 +03:00
Jim Zhang 51274bd368 reformatted with 'gofmt' 2018-04-19 15:02:05 -04:00
Wuxiang 8f8774cf6d all: fix various typos (#16533)
* fix typo

* fix typo

* fix typo
2018-04-19 16:32:02 +03:00
Jim Zhang c535103027 Addressing Sam's comment in the PR: make the FullFake engine the default so other test/fake flavors can still be used 2018-04-18 17:49:31 -04:00
gary rong de2a7bb764 eth/downloader: wait for all fetcher goroutines to exit before terminating (#16509) 2018-04-16 11:37:48 +03:00
Felix Lange c7ab3e5544 common: delete StringToAddress, StringToHash (#16436)
* common: delete StringToAddress, StringToHash

These functions are confusing because they don't parse hex, but use the
bytes of the string. This change removes them, replacing all uses of
StringToAddress(s) by BytesToAddress([]byte(s)).

* eth/filters: remove incorrect use of common.BytesToAddress
2018-04-10 14:12:07 +03:00
gary rong 1100e8ba63 eth/downloader: flush state sync data before exit (#16280) 2018-04-09 14:46:27 +02:00
Yusup 7aad81f881 eth: fix typos (#16414) 2018-04-04 12:25:02 +02:00
Jim Zhang 2e19f7905d Disable ethash by replacing with ethash.NewFullFake 2018-03-18 22:48:07 -04:00
gary rong 77da203547 eth: update higest block we know during the sync if a higher was found (#16283)
* eth: update higest block we know during the sync if a higher was found

* eth: avoid useless sync in fast sync
2018-03-09 11:51:30 +02:00
Kyuntae Ethan Kim f6bef558aa eth: fixed typo (#16274) 2018-03-07 11:15:54 +02:00
Péter Szilágyi ca64a122d3 eth/downloader: save and load trie sync progress (#16224) 2018-03-03 00:52:39 +01:00
Patrick Mylund Nielsen bbc8e726e5
Merge pull request #270 from getamis/feature/update_istanbul
consensus, core, eth, miner, params: update istanbul engine
2018-02-27 20:57:21 -05:00
Andrey Petrov 2e9c8fd4fb eth, les: allow exceeding maxPeers for trusted peers (#16189)
Fixes #3326, #14472
2018-02-27 12:52:59 +02:00
Anton Evangelatov ae9f97221a metrics: pull library and introduce ResettingTimer and InfluxDB reporter (#15910)
* go-metrics: fork library and introduce ResettingTimer and InfluxDB reporter.

* vendor: change nonsense/go-metrics to ethersphere/go-metrics

* go-metrics: add tests. move ResettingTimer logic from reporter to type.

* all, metrics: pull in metrics package in go-ethereum

* metrics/test: make sure metrics are enabled for tests

* metrics: apply gosimple rules

* metrics/exp, internal/debug: init expvar endpoint when starting pprof server

* internal/debug: tiny comment formatting fix
2018-02-23 11:56:08 +02:00
Péter Szilágyi 5cf1d35470
eth, les, light: filter on logs only, derive receipts on demand 2018-02-22 19:12:43 +02:00
Joel Burget 85f1bc2998 Add missing private bloom setting / checking. 2018-02-15 16:41:57 -05:00
Felix Lange a5c0bbb4f4
all: update license information (#16089) 2018-02-14 13:49:11 +01:00
Péter Szilágyi 57fd2da0fe
eth: only disable fast sync after success 2018-02-11 17:25:00 +02:00
Péter Szilágyi 96dad6b6f6
eth/downloader: don't require state for ancestor lookups 2018-02-11 14:43:56 +02:00
Péter Szilágyi eb07dbb079
eth, light: minor light client startup cleanups 2018-02-08 07:49:23 +02:00
Péter Szilágyi 55599ee95d core, trie: intermediate mempool between trie and database (#15857)
This commit reduces database I/O by not writing every state trie to disk.
2018-02-05 17:40:32 +01:00
Felföldi Zsolt c3f238dd53 les: limit LES peer count and improve peer configuration logic (#16010)
* les: limit number of LES connections

* eth, cmd/utils: light vs max peer configuration logic
2018-02-05 15:41:53 +02:00
Martin Holst Swende bc0666fb27 eth/downloader: fix #15858 by checking if downloader dropPeer function is set (#15992) 2018-02-05 15:38:06 +02:00
mark.lin 9ac24f9aaa consensus, core, eth, miner, params: update istanbul engine 2018-01-31 10:27:08 +08:00
Péter Szilágyi 566d5c0777
core, eth, les, light: get rid of redundant methods 2018-01-30 18:42:00 +02:00
Péter Szilágyi 1bf508b449
accounts/abi/bind: support event filtering in abigen 2018-01-24 10:54:13 +02:00
Nick Johnson b06e20bc7c eth/gasprice: set default percentile to 60%, count blocks instead of transactions (#15828)
The first should address a long term issue where we recommend a gas
price that is greater than that required for 50% of transactions in
recent blocks, which can lead to gas price inflation as people take
this figure and add a margin to it, resulting in a positive feedback
loop.
2018-01-10 13:57:36 +01:00
Felix Lange 9d06026c19 all: regenerate codecs with gencodec commit 90983d99de (#15830)
Fixes #15777 because null is now allowed for hexutil.Bytes.
2018-01-08 15:13:22 +02:00
Felix Lange 5c2f1e0014 all: update generated code (#15808)
* core/types, core/vm, eth, tests: regenerate gencodec files

* Makefile: update devtools target

Install protoc-gen-go and print reminders about npm, solc and protoc.
Also switch to github.com/kevinburke/go-bindata because it's more
maintained.

* contracts/ens: update contracts and regenerate with solidity v0.4.19

The newer upstream version of the FIFSRegistrar contract doesn't set the
resolver anymore. The resolver is now deployed separately.

* contracts/release: regenerate with solidity v0.4.19

* contracts/chequebook: fix fallback and regenerate with solidity v0.4.19

The contract didn't have a fallback function, payments would be rejected
when compiled with newer solidity. References to 'mortal' and 'owned'
use the local file system so we can compile without network access.

* p2p/discv5: regenerate with recent stringer

* cmd/faucet: regenerate

* dashboard: regenerate

* eth/tracers: regenerate

* internal/jsre/deps: regenerate

* dashboard: avoid sed -i because it's not portable

* accounts/usbwallet/internal/trezor: fix go generate warnings
2018-01-08 14:15:57 +02:00
Péter Szilágyi ae71da1b03 eth: fix tracer panic when running without configs + reexec (#15799) 2018-01-04 12:58:11 +01:00
Péter Szilágyi 6f69cdd109
all: switch gas limits from big.Int to uint64 2018-01-03 14:45:35 +02:00
Furkan KAMACI b8caba9709 various: remove redundant parentheses (#15793) 2018-01-03 14:14:47 +02:00
Felix Lange 9d48dbf5c2
eth: revert tracer preimage recording (#15800)
This reverts commits 85a1eda59e (#15792) and c495bca4ad (#15787)
because they introduce database writes during tracing.
2018-01-03 11:58:25 +01:00
Felix Lange 85a1eda59e eth: uncaptialize tracer preimage error message (#15792)
* eth: uncaptialize tracer preimage error message

* eth: improve very important error message
2018-01-03 10:53:09 +02:00
cdetrio c495bca4ad eth: enable preimage recording when tracing (#15787) 2018-01-02 12:49:17 +01:00
Péter Szilágyi 9c42a41ed8 eth/downloader: avoid hidden reference to finished statesync request (#15545) 2018-01-02 11:38:26 +01:00
Péter Szilágyi f7ca03ae87 eth, les, light: expose chain config in les node info too (#15732) 2017-12-28 14:18:34 +01:00
gary rong 5f8888e116 accounts, consensus, core, eth: make chain maker consensus agnostic (#15497)
* accounts, consensus, core, eth: make chain maker consensus agnostic

* consensus, core: move CalcDifficulty to Engine interface

* consensus: add docs for calcDifficulty function

* consensus, core: minor comment fixups
2017-12-22 14:37:50 +02:00
Péter Szilágyi 5258785c81
cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing

* eth, internal/web3ext: rework trace API, concurrency, chain tracing

* eth/tracers: add three more JavaScript tracers

* eth/tracers, vendor: swap ottovm to duktape for tracing

* core, eth, internal: finalize call tracer and needed extras

* eth, tests: prestate tracer, call test suite, rewinding

* vendor: fix windows builds for tracer js engine

* vendor: temporary duktape fix

* eth/tracers: fix up 4byte and evmdis tracer

* vendor: pull in latest duktape with my upstream fixes

* eth: fix some review comments

* eth: rename rewind to reexec to make it more obvious

* core/vm: terminate tracing using defers
2017-12-21 13:56:11 +02:00
Steven Roose 8b3f7906f9 Remove unused raftHasNoPending 2017-12-18 12:09:54 +01:00
Michael Ruminer 732f5468d3 eth: make tracing API errors more user friendly (#15589) 2017-12-09 23:47:13 +01:00
Péter Szilágyi 46e5583993 cmd/utils, eth: init etherbase from within eth (#15528) 2017-12-09 23:42:23 +01:00
Benoit Verkindt eab2201f80 eth: return rlp-decoded values from debug_storageRangeAt (#15476)
Fixes #15196
2017-12-06 16:42:16 +01:00
Rob d927c67f9d eth/downloader: update tests for reliability (#15337)
Updated use of Parallel and added some subtests to help isolate
them. Increased timeout in RequestHeadersByNumber so it
doesn't time out and causes other tests to break.
2017-12-01 12:54:17 +01:00
gary rong f14047dae5 cmd, consensus, eth: split ethash related config to it own (#15520)
* cmd, consensus, eth: split ethash related config to it own

* eth, consensus: minor polish

* eth, consenus, console: compress pow testing config field to single one

* consensus, eth: document pow mode
2017-11-24 16:10:27 +02:00
Ricardo Domingos 9ff9d04a69 all: fix code comment typos (#15547)
* console: fix typo in comment

* contracts/release: fix typo in comment

* core: fix typo in comment

* eth: fix typo in comment

* miner: fix typo in comment
2017-11-24 11:20:01 +02:00
Nick Johnson 72ed186f46 eth, internal: Implement getModifiedAccountsBy(Hash|Number) using trie diffs (#15512)
* eth, internal: Implement  using trie diffs

* eth, internal: Changes in response to review

* eth: More fixes to getModifiedAccountsBy*

* eth: minor polishes on error capitalization
2017-11-20 17:18:50 +02:00
Brian Schroeder 0905eda48e Re-add GPO creation in backend
Clique consensus requires a GPO to function.
2017-11-16 09:35:20 -05:00
jtakalai 5aa3eac22d eth/downloader: minor comments cleanup (#15495)
it's -> its

pet peeve, and I like to imagine I'm not alone.
2017-11-16 13:14:51 +02:00
Péter Szilágyi 463014126f
core/bloombits: handle non 8-bit boundary section matches 2017-11-15 14:10:35 +02:00
ferhat elmas 86f6568f66 build: enable unconvert linter (#15456)
* build: enable unconvert linter

 - fixes #15453
 - update code base for failing cases

* cmd/puppeth: replace syscall.Stdin with os.Stdin.Fd() for unconvert linter
2017-11-10 19:06:45 +02:00
ferhat elmas 9619a61024 all: gofmt -w -s (#15419) 2017-11-08 11:45:52 +01:00
Patrick Mylund Nielsen 3d91976f08
Geth 1.7.2 rebase and addition of Istanbul BFT (#207) 2017-10-31 18:24:11 -04:00
Péter Szilágyi 0095531a58 core, eth, les: fix messy code (#15367)
* core, eth, les: fix messy code

* les: fixed tx status test and rlp encoding

* core: add a workaround for light sync
2017-10-25 12:18:44 +03:00
Felföldi Zsolt ca376ead88 les, light: LES/2 protocol version (#14970)
This PR implements the new LES protocol version extensions:

* new and more efficient Merkle proofs reply format (when replying to
  a multiple Merkle proofs request, we just send a single set of trie
  nodes containing all necessary nodes)
* BBT (BloomBitsTrie) works similarly to the existing CHT and contains
  the bloombits search data to speed up log searches
* GetTxStatusMsg returns the inclusion position or the
  pending/queued/unknown state of a transaction referenced by hash
* an optional signature of new block data (number/hash/td) can be
  included in AnnounceMsg to provide an option for "very light
  clients" (mobile/embedded devices) to skip expensive Ethash check
  and accept multiple signatures of somewhat trusted servers (still a
  lot better than trusting a single server completely and retrieving
  everything through RPC). The new client mode is not implemented in
  this PR, just the protocol extension.
2017-10-24 15:19:09 +02:00
Péter Szilágyi 35767dfd0c
cmd, eth: separate out FakePeer for future reuse 2017-10-10 15:52:11 +03:00
Miya Chen 40a3856af9 eth/fetcher: check the origin of filter tasks (#14975)
* eth/fetcher: check the origin of filter task

* eth/fetcher: add some details to fetcher logs
2017-10-10 11:53:05 +03:00
Lio李欧 5df0b240ae eth: fix typo (#15252) 2017-10-06 12:55:18 +02:00
rjl493456442 94903d572b
internal, accounts, eth: utilize vm failed flag to help gas estimation 2017-10-02 15:26:40 +03:00
Péter Szilágyi 2ab2a9f131 core/bloombits, eth/filters: handle null topics (#15195)
When implementing the new bloombits based filter, I've accidentally broke null
topics by removing the special casing of common.Hash{} filter rules, which
acted as the wildcard topic until now.

This PR fixes the regression, but instead of using the magic hash
common.Hash{} as the null wildcard, the PR reworks the code to handle nil
topics during parsing, converting a JSON null into nil []common.Hash topic.
2017-09-27 12:14:52 +02:00
Ernesto del Toro 3c8656347f eth, internal/ethapi: fix spelling of 'Ethereum' (#15164) 2017-09-20 11:31:31 +02:00
Steven Roose 3089a92337 Use latest block when pending is indicated with RAFT (#181) 2017-09-18 22:57:55 -04:00
Péter Szilágyi f46adfac28
eth/downloader: track peer drops and deassign state sync tasks 2017-09-12 15:13:14 +03:00
Péter Szilágyi c8e70186a6 Merge pull request #14973 from rjl493456442/fix_downloader
eth/downloader: exit loop when there is no more available task
2017-09-11 14:02:02 +03:00
Felix Lange 10181b57a9 core, eth/downloader: commit block data using batches (#15115)
* ethdb: add Putter interface and Has method

* ethdb: improve docs and add IdealBatchSize

* ethdb: remove memory batch lock

Batches are not safe for concurrent use.

* core: use ethdb.Putter for Write* functions

This covers the easy cases.

* core/state: simplify StateSync

* trie: optimize local node check

* ethdb: add ValueSize to Batch

* core: optimize HasHeader check

This avoids one random database read get the block number. For many uses
of HasHeader, the expectation is that it's actually there. Using Has
avoids a load + decode of the value.

* core: write fast sync block data in batches

Collect writes into batches up to the ideal size instead of issuing many
small, concurrent writes.

* eth/downloader: commit larger state batches

Collect nodes into a batch up to the ideal size instead of committing
whenever a node is received.

* core: optimize HasBlock check

This avoids a random database read to get the number.

* core: use numberCache in HasHeader

numberCache has higher capacity, increasing the odds of finding the
header without a database lookup.

* core: write imported block data using a batch

Restore batch writes of state and add blocks, tx entries, receipts to
the same batch. The change also simplifies the miner.

This commit also removes posting of logs when a forked block is imported.

* core: fix DB write error handling

* ethdb: use RLock for Has

* core: fix HasBlock comment
2017-09-09 19:03:07 +03:00
Péter Szilágyi f30179d62e
eth: disable fast sync after pivot is committed 2017-09-06 15:02:44 +03:00
Zsolt Felfoldi 451ffdb62b
core/bloombits: use general filters instead of addresses and topics 2017-09-06 11:14:21 +03:00
Zsolt Felfoldi 6ff2c02991
core/bloombits: AddBloom index parameter and fixes variable names 2017-09-06 11:14:20 +03:00
Péter Szilágyi f585f9eee8
core, eth: clean up bloom filtering, add some tests 2017-09-06 11:14:19 +03:00
Zsolt Felfoldi 4ea4d2dc34
core, eth: add bloombit indexer, filter based on it 2017-09-06 11:13:13 +03:00
Péter Szilágyi b0ca1b67ce
eth: use maxpeers from p2p layer instead of extra config 2017-09-05 19:18:28 +03:00
Péter Szilágyi da7d57e07c
core: make txpool operate on immutable state 2017-09-05 13:34:41 +03:00
Brian Schroeder 5dfdecef4c Dynamic raft membership support (#130) 2017-08-28 17:43:44 -04:00
rjl493456442 28aea46ac0
core: implement Metropolis EIP 658, receipt status byte 2017-08-22 18:35:17 +03:00
Miya Chen bf1e263128 core, light: send chain events using event.Feed (#14865) 2017-08-18 12:58:36 +02:00
Péter Szilágyi a4da8416ee Merge pull request #14996 from markya0616/send_not_announce
eth: send but not announce block to peers if propagate is true
2017-08-18 12:47:33 +03:00
mark.lin d4f11d9b4f eth: send but not announce block to peers if propagate is true 2017-08-18 13:52:16 +08:00
rjl493456442 02aa86e659 eth/downloader: exit loop when there is no more available task 2017-08-14 13:51:37 +08:00
Ivan Daniluk 17ce0a37de eth/downloader: fix race in downloadTesterPeer (#14942)
* eth/downloader: fix race in downloadTesterPeer

Signed-off-by: Ivan Daniluk <ivan.daniluk@gmail.com>

* eth/downloader: minor datarace fix cleanup
2017-08-08 20:10:09 +03:00
Egon Elbre 8f06b7980d eth: fix megacheck warnings 2017-08-07 19:54:20 +03:00
Péter Szilágyi 3d32690b54 cmd, core, eth: journal local transactions to disk (#14784)
* core: reduce txpool event loop goroutines and sync structs

* cmd, core, eth: journal local transactions to disk

* core: journal replacement pending transactions too

* core: separate transaction journal from pool
2017-07-28 15:09:39 +02:00
Péter Szilágyi 0ff35e170d core: remove redundant storage of transactions and receipts (#14801)
* core: remove redundant storage of transactions and receipts

* core, eth, internal: new transaction schema usage polishes

* eth: implement upgrade mechanism for db deduplication

* core, eth: drop old sequential key db upgrader

* eth: close last iterator on successful db upgrage

* core: prefix the lookup entries to make their purpose clearer
2017-07-14 19:39:53 +03:00
Péter Szilágyi 4f7a38001f Merge pull request #14737 from holiman/txpool_localaccounts
Txpool localaccounts
2017-07-10 12:43:23 +03:00
Péter Szilágyi 4c1d0b164b
eth: drop leftover from previous nonce protection scheme 2017-07-05 16:53:40 +03:00
Péter Szilágyi 48ee7f9de7
core, eth, les: polish txpool API around local/remote txs 2017-07-05 16:51:55 +03:00
Nick Johnson fe13949d9d eth/downloader: Doc fixes 2017-07-05 11:13:16 +01:00
Nick Johnson be8f8409bc eth/downloader, les, light: Changes in response to review 2017-07-03 15:17:12 +01:00
Nick Johnson ae11545bc5 eth, les: Refactor downloader peer to use structs 2017-06-29 12:49:18 +01:00
Nick Johnson 0550957989 eth, les, light: Refactor downloader to use blockchain interface 2017-06-28 15:58:41 +01:00
Felix Lange 9e5f03b6c4 core/state: access trie through Database interface, track errors (#14589)
With this commit, core/state's access to the underlying key/value database is
mediated through an interface. Database errors are tracked in StateDB and
returned by CommitTo or the new Error method.

Motivation for this change: We can remove the light client's duplicated copy of
core/state. The light client now supports node iteration, so tracing and storage
enumeration can work with the light client (not implemented in this commit).
2017-06-27 15:57:06 +02:00
Péter Szilágyi d40179f882
eth: gracefully error if database cannot be opened 2017-06-23 10:12:41 +03:00
Felix Lange 0042f13d47 eth/downloader: separate state sync from queue (#14460)
* eth/downloader: separate state sync from queue

Scheduling of state node downloads hogged the downloader queue lock when
new requests were scheduled. This caused timeouts for other requests.
With this change, state sync is fully independent of all other downloads
and doesn't involve the queue at all.

State sync is started and checked on in processContent. This is slightly
awkward because processContent doesn't have a select loop. Instead, the
queue is closed by an auxiliary goroutine when state sync fails. We
tried several alternatives to this but settled on the current approach
because it's the least amount of change overall.

Handling of the pivot block has changed slightly: the queue previously
prevented import of pivot block receipts before the state of the pivot
block was available. In this commit, the receipt will be imported before
the state. This causes an annoyance where the pivot block is committed
as fast block head even when state downloads fail. Stay tuned for more
updates in this area ;)

* eth/downloader: remove cancelTimeout channel

* eth/downloader: retry state requests on timeout

* eth/downloader: improve comment

* eth/downloader: mark peers idle when state sync is done

* eth/downloader: move pivot block splitting to processContent

This change also ensures that pivot block receipts aren't imported
before the pivot block itself.

* eth/downloader: limit state node retries

* eth/downloader: improve state node error handling and retry check

* eth/downloader: remove maxStateNodeRetries

It fails the sync too much.

* eth/downloader: remove last use of cancelCh in statesync.go

Fixes TestDeliverHeadersHang*Fast and (hopefully)
the weird cancellation behaviour at the end of fast sync.

* eth/downloader: fix leak in runStateSync

* eth/downloader: don't run processFullSyncContent in LightSync mode

* eth/downloader: improve comments

* eth/downloader: fix vet, megacheck

* eth/downloader: remove unrequested tasks anyway

* eth/downloader, trie: various polishes around duplicate items

This commit explicitly tracks duplicate and unexpected state
delieveries done against a trie Sync structure, also adding
there to import info logs.

The commit moves the db batch used to commit trie changes one
level deeper so its flushed after every node insertion. This
is needed to avoid a lot of duplicate retrievals caused by
inconsistencies between Sync internals and database. A better
approach is to track not-yet-written states in trie.Sync and
flush on commit, but I'm focuing on correctness first now.

The commit fixes a regression around pivot block fail count.
The counter previously was reset to 1 if and only if a sync
cycle progressed (inserted at least 1 entry to the database).
The current code reset it already if a node was delivered,
which is not stong enough, because unless it ends up written
to disk, an attacker can just loop and attack ad infinitum.

The commit also fixes a regression around state deliveries
and timeouts. The old downloader tracked if a delivery is
stale (none of the deliveries were requestedt), in which
case it didn't mark the node idle and did not send further
requests, since it signals a past timeout. The current code
did mark it idle even on stale deliveries, which eventually
caused two requests to be in flight at the same time, making
the deliveries always stale and mass duplicating retrievals
between multiple peers.

* eth/downloader: fix state request leak

This commit fixes the hang seen sometimes while doing the state
sync. The cause of the hang was a rare combination of events:
request state data from peer, peer drops and reconnects almost
immediately. This caused a new download task to be assigned to
the peer, overwriting the old one still waiting for a timeout,
which in turned leaked the requests out, never to be retried.
The fix is to ensure that a task assignment moves any pending
one back into the retry queue.

The commit also fixes a regression with peer dropping due to
stalls. The current code considered a peer stalling if they
timed out delivering 1 item. However, the downloader never
requests only one, the minimum is 2 (attempt to fine tune
estimated latency/bandwidth). The fix is simply to drop if
a timeout is detected at 2 items.

Apart from the above bugfixes, the commit contains some code
polishes I made while debugging the hang.

* core, eth, trie: support batched trie sync db writes

* trie: rename SyncMemCache to syncMemBatch
2017-06-22 15:26:03 +03:00
Alan Chen fade09a7ff eth: remove les server from protocol manager (#14625) 2017-06-15 15:28:57 +02:00
Péter Szilágyi 41bdf49eed Merge pull request #14516 from holiman/noncefixes
internal/ethapi: add mutex around signing + nonce assignment
2017-05-30 18:15:57 +03:00
Martin Holst Swende ea11f7dd7a internal/ethapi: add mutex around signing + nonce assignment
This prevents concurrent assignment of identical nonces when automatic
assignment is used.
2017-05-30 16:43:38 +02:00
Péter Szilágyi dd06c85843 Merge pull request #14523 from karalabe/txpool-cli-flags
cmd, core, eth: configurable txpool parameters
2017-05-29 11:42:48 +03:00
Péter Szilágyi b865fad888 Merge pull request #14537 from karalabe/setgasprice-durning-nomine
eth: update default gas price when not mining too
2017-05-29 11:37:26 +03:00
Péter Szilágyi 08959bbc70
cmd, core, eth: configurable txpool parameters 2017-05-29 11:29:46 +03:00
Péter Szilágyi c2a494c743
eth: update default gas price when not mining too 2017-05-29 10:21:34 +03:00
Péter Szilágyi afdd23b5ca
eth: don't import propagated blocks during fastsync 2017-05-26 16:04:12 +03:00
Péter Szilágyi a2f23ca9b1 cmd, core, eth, miner: remove txpool gas price limits (#14442) 2017-05-16 21:07:27 +02:00
Joel Burget 852ac74467 Raft updates (#104)
* Move raft checkpoint logging to logger package.

This allows us to use it everywhere and turn it on / off from command
flags.

* Return an error when the pending block is requested in Raft mode.
2017-05-04 16:49:48 -04:00
Péter Szilágyi 96c2ab22e0
eth/downloader: fix a potential issue against future refactors 2017-05-02 16:14:35 +03:00
Péter Szilágyi e61035c5a3
cmd, eth, les, mobile: make networkid uint64 everywhere 2017-04-25 14:53:50 +03:00
Felix Lange 207bd7d2cd eth: add debug_storageRangeAt 2017-04-25 02:14:32 +02:00
Péter Szilágyi 6876e92f8d
Merge remote-tracking branch 'fjl/license-update-1.6' 2017-04-14 12:33:10 +03:00
Péter Szilágyi 6d359dbcc6
eth: revert accidental ethash cache dir change 2017-04-14 11:35:17 +03:00
Felix Lange 0cc492f815 all: update license information 2017-04-14 10:29:00 +02:00
bas-vk 5e29f4be93 cmd/utils, node: remove unused solc references and improve RPC config (#14324)
Currently http cors and websocket origins are a comma separated string in the
config object. These are replaced with string arrays that are more expressive in
case of a config file.
2017-04-12 23:04:14 +02:00
Felix Lange 30d706c35e cmd/geth: add --config file flag (#13875)
* p2p/discover, p2p/discv5: add marshaling methods to Node

* p2p/netutil: make Netlist decodable from TOML

* common/math: encode nil HexOrDecimal256 as 0x0

* cmd/geth: add --config file flag

* cmd/geth: add missing license header

* eth: prettify Config again, fix tests

* eth: use gasprice.Config instead of duplicating its fields

* eth/gasprice: hide nil default from dumpconfig output

* cmd/geth: hide genesis block in dumpconfig output

* node: make tests compile

* console: fix tests

* cmd/geth: make TOML keys look exactly like Go struct fields

* p2p: use discovery by default

This makes the zero Config slightly more useful. It also fixes package
node tests because Node detects reuse of the datadir through the
NodeDatabase.

* cmd/geth: make ethstats URL settable through config file

* cmd/faucet: fix configuration

* cmd/geth: dedup attach tests

* eth: add comment for DefaultConfig

* eth: pass downloader.SyncMode in Config

This removes the FastSync, LightSync flags in favour of a more
general SyncMode flag.

* cmd/utils: remove jitvm flags

* cmd/utils: make mutually exclusive flag error prettier

It now reads:

   Fatal: flags --dev, --testnet can't be used at the same time

* p2p: fix typo

* node: add DefaultConfig, use it for geth

* mobile: add missing NoDiscovery option

* cmd/utils: drop MakeNode

This exposed a couple of places that needed to be updated to use
node.DefaultConfig.

* node: fix typo

* eth: make fast sync the default mode

* cmd/utils: remove IPCApiFlag (unused)

* node: remove default IPC path

Set it in the frontends instead.

* cmd/geth: add --syncmode

* cmd/utils: make --ipcdisable and --ipcpath mutually exclusive

* cmd/utils: don't enable WS, HTTP when setting addr

* cmd/utils: fix --identity
2017-04-12 17:27:23 +03:00
Péter Szilágyi a7b9e484d0 consensus, core, ethstats: use engine specific block beneficiary (#14318)
* consensus, core, ethstats: use engine specific block beneficiary

* core, eth, les, miner: use explicit beneficiary during mining
2017-04-12 16:38:31 +03:00
Péter Szilágyi feeccdf4ec consensus/clique: Proof of Authority (#3753)
This PR is a prototype implementation of plugable consensus engines and the
Clique PoA protocol ethereum/EIPs#225
2017-04-10 12:24:12 +02:00
Péter Szilágyi bfe5eb7f8c eth: accept transactions when starting CPU mining (#13882) 2017-04-10 10:43:01 +02:00
Péter Szilágyi bd2c54fa9f
eth: announce block after sync cycle (star topology) 2017-04-09 20:12:46 +03:00
Péter Szilágyi b801be99d4
consensus, eth: don't CPU mine by default during remote mining 2017-04-07 17:22:06 +03:00
Péter Szilágyi cc13d576f0 Merge pull request #13870 from karalabe/miners-fixes
all: clean up various error handling in core and the miner
2017-04-07 11:03:11 +03:00
Péter Szilágyi 158d603528
consensus, core: drop all the legacy custom core error types 2017-04-06 17:34:19 +03:00
Felföldi Zsolt 9aca9e6deb cmd, les, eth, eth/gasprice: using new gas price oracle (#13853)
* cmd, les, eth, eth/gasprice: using new gas price oracle

* eth/gasprice: renamed source file

* eth/gasprice: added security checks for gpo params

* eth/gasprice: fixed naming issues

* eth/gasprice: max limit, maxEmpty
2017-04-06 17:20:42 +03:00