aboutsummaryrefslogtreecommitdiffstats
path: root/eth
Commit message (Collapse)AuthorAgeFilesLines
* all: new p2p node representation (#17643)Felix Lange2018-09-254-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Package p2p/enode provides a generalized representation of p2p nodes which can contain arbitrary information in key/value pairs. It is also the new home for the node database. The "v4" identity scheme is also moved here from p2p/enr to remove the dependency on Ethereum crypto from that package. Record signature handling is changed significantly. The identity scheme registry is removed and acceptable schemes must be passed to any method that needs identity. This means records must now be validated explicitly after decoding. The enode API is designed to make signature handling easy and safe: most APIs around the codebase work with enode.Node, which is a wrapper around a valid record. Going from enr.Record to enode.Node requires a valid signature. * p2p/discover: port to p2p/enode This ports the discovery code to the new node representation in p2p/enode. The wire protocol is unchanged, this can be considered a refactoring change. The Kademlia table can now deal with nodes using an arbitrary identity scheme. This requires a few incompatible API changes: - Table.Lookup is not available anymore. It used to take a public key as argument because v4 protocol requires one. Its replacement is LookupRandom. - Table.Resolve takes *enode.Node instead of NodeID. This is also for v4 protocol compatibility because nodes cannot be looked up by ID alone. - Types Node and NodeID are gone. Further commits in the series will be fixes all over the the codebase to deal with those removals. * p2p: port to p2p/enode and discovery changes This adapts package p2p to the changes in p2p/discover. All uses of discover.Node and discover.NodeID are replaced by their equivalents from p2p/enode. New API is added to retrieve the enode.Node instance of a peer. The behavior of Server.Self with discovery disabled is improved. It now tries much harder to report a working IP address, falling back to 127.0.0.1 if no suitable address can be determined through other means. These changes were needed for tests of other packages later in the series. * p2p/simulations, p2p/testing: port to p2p/enode No surprises here, mostly replacements of discover.Node, discover.NodeID with their new equivalents. The 'interesting' API changes are: - testing.ProtocolSession tracks complete nodes, not just their IDs. - adapters.NodeConfig has a new method to create a complete node. These changes were needed to make swarm tests work. Note that the NodeID change makes the code incompatible with old simulation snapshots. * whisper/whisperv5, whisper/whisperv6: port to p2p/enode This port was easy because whisper uses []byte for node IDs and URL strings in the API. * eth: port to p2p/enode Again, easy to port because eth uses strings for node IDs and doesn't care about node information in any way. * les: port to p2p/enode Apart from replacing discover.NodeID with enode.ID, most changes are in the server pool code. It now deals with complete nodes instead of (Pubkey, IP, Port) triples. The database format is unchanged for now, but we should probably change it to use the node database later. * node: port to p2p/enode This change simply replaces discover.Node and discover.NodeID with their new equivalents. * swarm/network: port to p2p/enode Swarm has its own node address representation, BzzAddr, containing both an overlay address (the hash of a secp256k1 public key) and an underlay address (enode:// URL). There are no changes to the BzzAddr format in this commit, but certain operations such as creating a BzzAddr from a node ID are now impossible because node IDs aren't public keys anymore. Most swarm-related changes in the series remove uses of NewAddrFromNodeID, replacing it with NewAddr which takes a complete node as argument. ToOverlayAddr is removed because we can just use the node ID directly.
* eth, miner: prefer locally generated uncles vs remote ones (#17715)gary rong2018-09-211-1/+1
| | | | | | * core, eth: fix dependency cycle * eth, miner: perfer to locally generated uncle
* core, eth: fix dependency cycle (#17720)gary rong2018-09-211-9/+39
|
* all: protect self-mined block during reorg (#17656)gary rong2018-09-203-4/+28
|
* core/vm: add switches to select evm+ewasm interpreters (#17687)Guillaume Ballet2018-09-202-1/+10
| | | | | Interpreter initialization is left to the PRs implementing them. Options for external interpreters are passed after a colon in the `--vm.ewasm` and `--vm.evm` switches.
* all: fix various comment typos (#17591)HackyMiner2018-09-201-1/+1
| | | | | | * swarm: fixed comment typo * eth: fixed comment typo * cmd/puppeth: fixed comment typo
* core, eth: fix goimports for Go 1.11Péter Szilágyi2018-09-192-6/+6
|
* all: simplify s[:] to s where s is a slice (#17673)Emil2018-09-151-4/+4
|
* core/vm: Hide read only flag from Interpreter interface (#17461)Paweł Bylica2018-09-081-1/+1
| | | | | Makes Interface interface a bit more stateless and abstract. Obviously this change is dictated by EVMC design. The EVMC tries to keep the responsibility for EVM features totally inside the VMs, if feasible. This makes VM "stateless" because VM does not need to pass any information between executions, all information is included in parameters of the execute function.
* core, eth, trie: use common/prque (#17508)Wenbiao Zheng2018-09-032-21/+21
|
* cmd, core, eth, miner, params: configurable gas floor and ceilPéter Szilágyi2018-08-294-3/+19
|
* consensus, miner: stale block mining support (#17506)gary rong2018-08-284-6/+12
| | | | | | | | | | * consensus, miner: stale block supporting * consensus, miner: refactor seal signature * cmd, consensus, eth: add miner noverify flag * cmd, consensus, miner: polish
* all: make indexer configurable (#17188)gary rong2018-08-282-12/+7
|
* all: remove the duplicate 'the' in annotations (#17509)Wenbiao Zheng2018-08-272-2/+2
|
* cmd, eth: clean up miner startup API, drop noop config fieldPéter Szilágyi2018-08-234-60/+69
|
* cmd, eth: apply default miner recommit setting (#17479)gary rong2018-08-221-0/+1
|
* cmd, eth, miner: make recommit configurable (#17444)gary rong2018-08-224-21/+61
| | | | | | | | | | | | * cmd, eth, miner: make recommit configurable * cmd, eth, les, miner: polish a bit * miner: filter duplicate sealing work * cmd: remove uncessary conversion * miner: avoid microptimization in favor of cleaner code
* eth: upgradedb subcommand was dropped (#17464)Pierre Neter2018-08-211-1/+1
|
* Merge pull request #17460 from holiman/tracerfixPéter Szilágyi2018-08-211-0/+3
|\ | | | | Ensure from < to when tracing chain
| * eth: ensure from<to when tracing chain (credits Chen Nan via bugbounty)Martin Holst Swende2018-08-211-0/+3
| |
* | light: CHT and bloom trie indexers working in light mode (#16534)Felföldi Zsolt2018-08-162-13/+12
| | | | | | | | | | | | | | This PR enables the indexers to work in light client mode by downloading a part of these tries (the Merkle proofs of the last values of the last known section) in order to be able to add new values and recalculate subsequent hashes. It also adds CHT data to NodeInfo.
* | Merge pull request #17347 from karalabe/miner-notifyPéter Szilágyi2018-08-132-4/+5
|\ \ | |/ |/| cmd, consensus/ethash, eth: miner push notifications
| * cmd, consensus/ethash, eth: miner push notificationsPéter Szilágyi2018-08-102-4/+5
| |
* | eth, trie: fix tracer GC which accidentally pruned the metarootPéter Szilágyi2018-08-091-2/+6
|/
* consensus/ethash: move remote agent logic to ethash internal (#15853)gary rong2018-08-032-42/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | * consensus/ethash: start remote ggoroutine to handle remote mining * consensus/ethash: expose remote miner api * consensus/ethash: expose submitHashrate api * miner, ethash: push empty block to sealer without waiting execution * consensus, internal: add getHashrate API for ethash * consensus: add three method for consensus interface * miner: expose consensus engine running status to miner * eth, miner: specify etherbase when miner created * miner: commit new work when consensus engine is started * consensus, miner: fix some logics * all: delete useless interfaces * consensus: polish a bit
* eth/filters: fix the block range assignment for log filter (#17284)gary rong2018-07-311-8/+6
|
* all: simplify switches (#17267)Oleg Kovalov2018-07-303-10/+3
| | | | | | * all: simplify switches * silly mistake
* eth/filters: improve error message for invalid filter topics (#17234)Ian Macalinao2018-07-241-2/+2
|
* Merge pull request #16734 from reductionista/eip234Péter Szilágyi2018-07-246-52/+160
|\ | | | | eth/filters, interfaces: EIP-234 Add blockHash option to eth_getLogs
| * accounts, eth, les: blockhash based filtering on all code pathsPéter Szilágyi2018-07-126-60/+111
| |
| * eth/filters, ethereum: EIP-234 add blockHash param for eth_getLogsDomino Valdano2018-07-122-13/+70
| |
* | eth/tracers: fix noop tracer (#17220)emile2018-07-232-3/+3
| |
* | all: switch out defunct set library to different one (#16873)Ralph Caraveo III2018-07-161-9/+9
|/ | | | | | * keystore, ethash, eth, miner, rpc, whisperv6: tech debt with now defunct set. * whisperv5: swap out gopkg.in/fatih/set.v0 with supported set
* trie: cache collapsed tries node, not rlp blobs (#16876)Péter Szilágyi2018-06-211-3/+3
| | | | | | | | | | | | 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).
* tracers: fix err in 4byte, add some opcode analysis toolsMartin Holst Swende2018-06-205-3/+214
|
* eth: conform better to the golint standards (#16783)williambannas2018-06-147-26/+27
| | | | | | * eth: made changes to conform better to the golint standards * eth: fix comment nit
* eth/filters: make filterLogs func more readable (#16920)knarfeh2018-06-141-3/+3
|
* eth/fetcher: fix annotation (#16969)Wenbiao Zheng2018-06-131-1/+1
|
* core, eth, les: more efficient hash-based header chain retrieval (#16946)Felföldi Zsolt2018-06-121-14/+23
|
* core: improve getBadBlocks to return full block rlp (#16902)Martin Holst Swende2018-06-111-2/+27
| | | | | | | | * core: improve getBadBlocks to return full block rlp * core, eth, ethapi: changes to getBadBlocks formatting * ethapi: address review concerns
* eth/tracers: fix minor off-by-one error (#16879)Martin Holst Swende2018-06-052-15/+56
| | | | | | * tracing: fix minor off-by-one error * tracers: go generate
* core, eth, trie: streaming GC for the trie cache (#16810)Péter Szilágyi2018-06-042-3/+7
| | | | | | * core, eth, trie: streaming GC for the trie cache * trie: track memcache statistics
* trie: rename TrieSync to Sync and improve hexToKeybytes (#16804)Wenbiao Zheng2018-05-291-1/+1
| | | | | | | 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.
* common: improve documentation comments (#16701)kiel barry2018-05-291-1/+1
| | | | | This commit adds many comments and removes unused code. It also removes the EmptyHash function, which had some uses but was silly.
* eth/fetcher: reuse variables for hash and number (#16819)Smilenator2018-05-291-4/+4
|
* eth, node, trie: fix minor typos (#16802)Wenbiao Zheng2018-05-241-5/+5
|
* eth: propagate blocks and transactions asyncPéter Szilágyi2018-05-212-12/+117
|
* core, eth: minor txpool event cleanupsPéter Szilágyi2018-05-189-24/+24
|
* all: collate new transaction events togetherrjl4934564422018-05-189-50/+62
|
* all: get rid of error when creating memory database (#16716)gary rong2018-05-097-16/+14
| | | | | | | | * all: get rid of error when create mdb * core: clean up variables definition * all: inline mdb definition
* eth/filter: check nil pointer when unsubscribe (#16682)gary rong2018-05-091-41/+58
| | | | | | | | | | * 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
* eth: golint fixes to variable names (#16711)kiel barry2018-05-093-41/+41
|
* eth/filters: derive FilterCriteria from ethereum.FilterQuery (#16629)Domino Valdano2018-05-081-8/+2
|
* core/rawdb: separate raw database access to own package (#16666)Péter Szilágyi2018-05-0713-213/+90
|
* eth: golint updates for this or self warning (#16632)kiel barry2018-05-032-20/+20
| | | | | | * eth/*:golint updates for this or self warning * eth/*: golint updates for this or self warning, pr updated per feedback
* core, eth: fix tracer dirty finalizationPéter Szilágyi2018-04-271-2/+3
|
* eth/downloader: fix for Issue #16539 (#16546)Domino Valdano2018-04-231-3/+11
|
* all: fix various typos (#16533)Wuxiang2018-04-192-2/+2
| | | | | | | | * fix typo * fix typo * fix typo
* eth/downloader: wait for all fetcher goroutines to exit before terminating ↵gary rong2018-04-161-9/+8
| | | | (#16509)
* common: delete StringToAddress, StringToHash (#16436)Felix Lange2018-04-101-2/+2
| | | | | | | | | | * 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
* eth/downloader: flush state sync data before exit (#16280)gary rong2018-04-091-5/+13
|
* eth: fix typos (#16414)Yusup2018-04-0411-29/+29
|
* eth: update higest block we know during the sync if a higher was found (#16283)gary rong2018-03-092-0/+16
| | | | | | * eth: update higest block we know during the sync if a higher was found * eth: avoid useless sync in fast sync
* eth: fixed typo (#16274)Kyuntae Ethan Kim2018-03-071-1/+1
|
* eth/downloader: save and load trie sync progress (#16224)Péter Szilágyi2018-03-032-1/+9
|
* eth, les: allow exceeding maxPeers for trusted peers (#16189)Andrey Petrov2018-02-271-1/+2
| | | Fixes #3326, #14472
* metrics: pull library and introduce ResettingTimer and InfluxDB reporter ↵Anton Evangelatov2018-02-235-62/+62
| | | | | | | | | | | | | | | | | | | | (#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
* eth, les, light: filter on logs only, derive receipts on demandPéter Szilágyi2018-02-234-8/+60
|
* all: update license information (#16089)Felix Lange2018-02-143-3/+3
|
* eth: only disable fast sync after successPéter Szilágyi2018-02-111-10/+5
|
* eth/downloader: don't require state for ancestor lookupsPéter Szilágyi2018-02-112-13/+9
|
* eth, light: minor light client startup cleanupsPéter Szilágyi2018-02-081-1/+0
|
* core, trie: intermediate mempool between trie and database (#15857)Péter Szilágyi2018-02-0613-533/+377
| | | This commit reduces database I/O by not writing every state trie to disk.
* les: limit LES peer count and improve peer configuration logic (#16010)Felföldi Zsolt2018-02-052-4/+4
| | | | | | * les: limit number of LES connections * eth, cmd/utils: light vs max peer configuration logic
* eth/downloader: fix #15858 by checking if downloader dropPeer function is ↵Martin Holst Swende2018-02-051-3/+20
| | | | set (#15992)
* core, eth, les, light: get rid of redundant methodsPéter Szilágyi2018-01-315-15/+31
|
* accounts/abi/bind: support event filtering in abigenPéter Szilágyi2018-01-244-152/+21
|
* eth/gasprice: set default percentile to 60%, count blocks instead of ↵Nick Johnson2018-01-102-19/+34
| | | | | | | | | 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.
* all: regenerate codecs with gencodec commit 90983d99de (#15830)Felix Lange2018-01-081-2/+2
| | | Fixes #15777 because null is now allowed for hexutil.Bytes.
* all: update generated code (#15808)Felix Lange2018-01-082-65/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* eth: fix tracer panic when running without configs + reexec (#15799)Péter Szilágyi2018-01-041-3/+3
|
* all: switch gas limits from big.Int to uint64Péter Szilágyi2018-01-038-29/+25
|
* various: remove redundant parentheses (#15793)Furkan KAMACI2018-01-031-2/+2
|
* eth: revert tracer preimage recording (#15800)Felix Lange2018-01-031-4/+1
| | | | This reverts commits 85a1eda59e (#15792) and c495bca4ad (#15787) because they introduce database writes during tracing.
* eth: uncaptialize tracer preimage error message (#15792)Felix Lange2018-01-031-1/+1
| | | | | | * eth: uncaptialize tracer preimage error message * eth: improve very important error message
* eth: enable preimage recording when tracing (#15787)cdetrio2018-01-021-1/+4
|
* eth/downloader: avoid hidden reference to finished statesync request (#15545)Péter Szilágyi2018-01-021-1/+4
|
* eth, les, light: expose chain config in les node info too (#15732)Péter Szilágyi2017-12-281-6/+6
|
* accounts, consensus, core, eth: make chain maker consensus agnostic (#15497)gary rong2017-12-226-7/+11
| | | | | | | | | | * 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
* cmd, core, eth/tracers: support fancier js tracing (#15516)Péter Szilágyi2017-12-2124-254/+3685
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* eth: make tracing API errors more user friendly (#15589)Michael Ruminer2017-12-101-2/+12
|
* cmd/utils, eth: init etherbase from within eth (#15528)Péter Szilágyi2017-12-101-2/+9
|
* eth: return rlp-decoded values from debug_storageRangeAt (#15476)Benoit Verkindt2017-12-062-5/+12
| | | Fixes #15196
* eth/downloader: update tests for reliability (#15337)Rob2017-12-011-12/+49
| | | | | 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.
* cmd, consensus, eth: split ethash related config to it own (#15520)gary rong2017-11-243-60/+50
| | | | | | | | | | * 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
* all: fix code comment typos (#15547)Ricardo Domingos2017-11-241-1/+1
| | | | | | | | | | | | * 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
* eth, internal: Implement getModifiedAccountsBy(Hash|Number) using trie diffs ↵Nick Johnson2017-11-201-0/+83
| | | | | | | | | | | | (#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
* eth/downloader: minor comments cleanup (#15495)jtakalai2017-11-161-5/+5
| | | | | it's -> its pet peeve, and I like to imagine I'm not alone.
* core/bloombits: handle non 8-bit boundary section matchesPéter Szilágyi2017-11-151-0/+1
|
* build: enable unconvert linter (#15456)ferhat elmas2017-11-113-4/+4
| | | | | | | | | * build: enable unconvert linter - fixes #15453 - update code base for failing cases * cmd/puppeth: replace syscall.Stdin with os.Stdin.Fd() for unconvert linter
* all: gofmt -w -s (#15419)ferhat elmas2017-11-081-1/+1
|
* core, eth, les: fix messy code (#15367)Péter Szilágyi2017-10-252-4/+3
| | | | | | | | * core, eth, les: fix messy code * les: fixed tx status test and rlp encoding * core: add a workaround for light sync
* les, light: LES/2 protocol version (#14970)Felföldi Zsolt2017-10-244-16/+22
| | | | | | | | | | | | | | | | | | 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.
* cmd, eth: separate out FakePeer for future reusePéter Szilágyi2017-10-101-0/+160
|
* eth/fetcher: check the origin of filter tasks (#14975)Miya Chen2017-10-103-45/+56
| | | | | | * eth/fetcher: check the origin of filter task * eth/fetcher: add some details to fetcher logs
* eth: fix typo (#15252)Lio李欧2017-10-061-1/+1
|
* internal, accounts, eth: utilize vm failed flag to help gas estimationrjl4934564422017-10-021-2/+2
|
* core/bloombits, eth/filters: handle null topics (#15195)Péter Szilágyi2017-09-275-46/+26
| | | | | | | | | | 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.
* eth, internal/ethapi: fix spelling of 'Ethereum' (#15164)Ernesto del Toro2017-09-202-5/+5
|
* eth/downloader: track peer drops and deassign state sync tasksPéter Szilágyi2017-09-122-9/+42
|
* Merge pull request #14973 from rjl493456442/fix_downloaderPéter Szilágyi2017-09-111-0/+4
|\ | | | | eth/downloader: exit loop when there is no more available task
| * eth/downloader: exit loop when there is no more available taskrjl4934564422017-08-141-0/+4
| |
* | core, eth/downloader: commit block data using batches (#15115)Felix Lange2017-09-105-45/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | eth: disable fast sync after pivot is committedPéter Szilágyi2017-09-062-11/+12
| |
* | core/bloombits: use general filters instead of addresses and topicsZsolt Felfoldi2017-09-061-1/+18
| |
* | core/bloombits: AddBloom index parameter and fixes variable namesZsolt Felfoldi2017-09-062-2/+2
| |
* | core, eth: clean up bloom filtering, add some testsPéter Szilágyi2017-09-0610-367/+347
| |
* | core, eth: add bloombit indexer, filter based on itZsolt Felfoldi2017-09-0610-289/+534
| |
* | eth: use maxpeers from p2p layer instead of extra configPéter Szilágyi2017-09-066-27/+24
| |
* | core: make txpool operate on immutable statePéter Szilágyi2017-09-051-8/+0
| |
* | core: implement Metropolis EIP 658, receipt status byterjl4934564422017-08-223-9/+10
| |
* | core, light: send chain events using event.Feed (#14865)Miya Chen2017-08-1810-80/+247
| |
* | Merge pull request #14996 from markya0616/send_not_announcePéter Szilágyi2017-08-181-0/+1
|\ \ | |/ |/| eth: send but not announce block to peers if propagate is true
| * eth: send but not announce block to peers if propagate is truemark.lin2017-08-181-0/+1
| |
* | eth/downloader: fix race in downloadTesterPeer (#14942)Ivan Daniluk2017-08-091-7/+25
| | | | | | | | | | | | | | | | * eth/downloader: fix race in downloadTesterPeer Signed-off-by: Ivan Daniluk <ivan.daniluk@gmail.com> * eth/downloader: minor datarace fix cleanup
* | eth: fix megacheck warningsEgon Elbre2017-08-087-40/+17
| |
* | cmd, core, eth: journal local transactions to disk (#14784)Péter Szilágyi2017-07-281-2/+4
|/ | | | | | | | | | * 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
* core: remove redundant storage of transactions and receipts (#14801)Péter Szilágyi2017-07-154-222/+84
| | | | | | | | | | | | | | * 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
* Merge pull request #14737 from holiman/txpool_localaccountsPéter Szilágyi2017-07-106-31/+7
|\ | | | | Txpool localaccounts
| * eth: drop leftover from previous nonce protection schemePéter Szilágyi2017-07-052-23/+0
| |
| * core, eth, les: polish txpool API around local/remote txsPéter Szilágyi2017-07-055-8/+7
| |
* | eth/downloader: Doc fixesNick Johnson2017-07-052-3/+7
| |
* | eth/downloader, les, light: Changes in response to reviewNick Johnson2017-07-033-22/+51
| |
* | eth, les: Refactor downloader peer to use structsNick Johnson2017-06-296-253/+246
| |
* | eth, les, light: Refactor downloader to use blockchain interfaceNick Johnson2017-06-284-143/+118
|/
* core/state: access trie through Database interface, track errors (#14589)Felix Lange2017-06-276-37/+12
| | | | | | | | | 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).
* eth: gracefully error if database cannot be openedPéter Szilágyi2017-06-231-1/+4
|
* eth/downloader: separate state sync from queue (#14460)Felix Lange2017-06-225-453/+654
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* eth: remove les server from protocol manager (#14625)Alan Chen2017-06-152-3/+0
|
* Merge pull request #14516 from holiman/noncefixesPéter Szilágyi2017-05-301-1/+1
|\ | | | | internal/ethapi: add mutex around signing + nonce assignment
| * internal/ethapi: add mutex around signing + nonce assignmentMartin Holst Swende2017-05-301-1/+1
| | | | | | | | | | This prevents concurrent assignment of identical nonces when automatic assignment is used.
* | Merge pull request #14523 from karalabe/txpool-cli-flagsPéter Szilágyi2017-05-293-1/+11
|\ \ | | | | | | cmd, core, eth: configurable txpool parameters
| * | cmd, core, eth: configurable txpool parametersPéter Szilágyi2017-05-293-1/+11
| |/
* | Merge pull request #14537 from karalabe/setgasprice-durning-nominePéter Szilágyi2017-05-292-10/+24
|\ \ | | | | | | eth: update default gas price when not mining too
| * | eth: update default gas price when not mining tooPéter Szilágyi2017-05-292-10/+24
| |/
* / eth: don't import propagated blocks during fastsyncPéter Szilágyi2017-05-262-0/+6
|/
* cmd, core, eth, miner: remove txpool gas price limits (#14442)Péter Szilágyi2017-05-173-3/+7
|
* eth/downloader: fix a potential issue against future refactorsPéter Szilágyi2017-05-021-0/+4
|
* cmd, eth, les, mobile: make networkid uint64 everywherePéter Szilágyi2017-04-258-17/+17
|
* eth: add debug_storageRangeAtFelix Lange2017-04-252-37/+178
|
* Merge remote-tracking branch 'fjl/license-update-1.6'Péter Szilágyi2017-04-142-2/+2
|\
| * all: update license informationFelix Lange2017-04-142-2/+2
| |
* | eth: revert accidental ethash cache dir changePéter Szilágyi2017-04-141-0/+1
|/
* cmd/utils, node: remove unused solc references and improve RPC config (#14324)bas-vk2017-04-133-10/+1
| | | | | 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.
* cmd/geth: add --config file flag (#13875)Felix Lange2017-04-1211-91/+401
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* consensus, core, ethstats: use engine specific block beneficiary (#14318)Péter Szilágyi2017-04-122-2/+2
| | | | | | * consensus, core, ethstats: use engine specific block beneficiary * core, eth, les, miner: use explicit beneficiary during mining
* consensus/clique: Proof of Authority (#3753)Péter Szilágyi2017-04-101-0/+14
| | | | This PR is a prototype implementation of plugable consensus engines and the Clique PoA protocol ethereum/EIPs#225
* eth: accept transactions when starting CPU mining (#13882)Péter Szilágyi2017-04-105-9/+17
|
* eth: announce block after sync cycle (star topology)Péter Szilágyi2017-04-101-1/+9
|
* consensus, eth: don't CPU mine by default during remote miningPéter Szilágyi2017-04-072-11/+20
|
* Merge pull request #13870 from karalabe/miners-fixesPéter Szilágyi2017-04-073-92/+4
|\ | | | | all: clean up various error handling in core and the miner
| * consensus, core: drop all the legacy custom core error typesPéter Szilágyi2017-04-061-2/+2
| |
| * cmd/geth, eth: drop bad block reporting, its offline anywayPéter Szilágyi2017-04-062-90/+2
| |
* | cmd, les, eth, eth/gasprice: using new gas price oracle (#13853)Felföldi Zsolt2017-04-064-358/+137
|/ | | | | | | | | | | | * 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
* debug: convert uint64-blocknumber into rpc.Blocknumber (#13862)Martin Holst Swende2017-04-051-6/+29
| | | | | | * debug: Converted uint64-blocknumber into rpc.Blocknumber * api/debug: Fix pending block issues in DumpBlock
* core, consensus: pluggable consensus engines (#3817)Péter Szilágyi2017-04-057-89/+100
| | | | | This commit adds pluggable consensus engines to go-ethereum. In short, it introduces a generic consensus interface, and refactors the entire codebase to use this interface.
* core: refactor genesis handlingFelix Lange2017-03-236-90/+53
| | | | | | | | | | | | | | | | | | | | | | | | This commit solves several issues concerning the genesis block: * Genesis/ChainConfig loading was handled by cmd/geth code. This left library users in the cold. They could specify a JSON-encoded string and overwrite the config, but didn't get any of the additional checks performed by geth. * Decoding and writing of genesis JSON was conflated in WriteGenesisBlock. This made it a lot harder to embed the genesis block into the forthcoming config file loader. This commit changes things so there is a single Genesis type that represents genesis blocks. All uses of Write*Genesis* are changed to use the new type instead. * If the chain config supplied by the user was incompatible with the current chain (i.e. the chain had already advanced beyond a scheduled fork), it got overwritten. This is not an issue in practice because previous forks have always had the highest total difficulty. It might matter in the future though. The new code reverts the local chain to the point of the fork when upgrading configuration. The change to genesis block data removes compression library dependencies from package core.
* all: import "context" instead of "golang.org/x/net/context"Felix Lange2017-03-2310-16/+13
| | | | | | | | | | There is no need to depend on the old context package now that the minimum Go version is 1.7. The move to "context" eliminates our weird vendoring setup. Some vendored code still uses golang.org/x/net/context and it is now vendored in the normal way. This change triggered new vet checks around context.WithTimeout which didn't fire with golang.org/x/net/context.
* core, eth, les: support resuming fast sync on heavy rollback (#3743)Péter Szilágyi2017-03-224-10/+19
|
* all: finish integrating Go ethash, delete C++ vendorPéter Szilágyi2017-03-092-106/+6
|
* cmd, eth, les, node, pow: disk caching and progress reportsPéter Szilágyi2017-03-091-11/+13
|
* all: swap out the C++ ethash to the pure Go one (mining todo)Péter Szilágyi2017-03-093-6/+8
|
* all: update light logs (and a few others) to the new modelPéter Szilágyi2017-03-032-2/+2
|
* Logger updates 3 (#3730)Péter Szilágyi2017-03-0211-150/+122
| | | | | | | | * accounts, cmd, eth, ethdb: port logs over to new system * ethdb: drop concept of cache distribution between dbs * eth: fix some log nitpicks to make them nicer
* core, eth: drop database block splitting upgraderPéter Szilágyi2017-02-282-62/+0
|
* Merge pull request #3709 from fjl/p2p-context-logPéter Szilágyi2017-02-282-2/+2
|\ | | | | p2p, p2p/discover, p2p/nat: rework logging using context keys
| * eth, les: shorten genesis block mismatch error messageFelix Lange2017-02-282-2/+2
| |
* | common, eth/downloader, log: support terminal log formattingPéter Szilágyi2017-02-282-28/+24
|/
* all: disable log message colors outside of gethFelix Lange2017-02-271-1/+1
| | | | Also tweak behaviour so colors are only enabled when stderr is a terminal.
* eth/downloader: review fixesPéter Szilágyi2017-02-272-7/+13
|
* accounts, eth/downloader: use "err" instead of "error" in logsPéter Szilágyi2017-02-271-13/+13
|
* eth/downloader: port over old logs from glog to log15Péter Szilágyi2017-02-274-125/+137
|
* common: move big integer math to common/math (#3699)Felix Lange2017-02-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common: remove CurrencyToString Move denomination values to params instead. * common: delete dead code * common: move big integer operations to common/math This commit consolidates all big integer operations into common/math and adds tests and documentation. There should be no change in semantics for BigPow, BigMin, BigMax, S256, U256, Exp and their behaviour is now locked in by tests. The BigD, BytesToBig and Bytes2Big functions don't provide additional value, all uses are replaced by new(big.Int).SetBytes(). BigToBytes is now called PaddedBigBytes, its minimum output size parameter is now specified as the number of bytes instead of bits. The single use of this function is in the EVM's MSTORE instruction. Big and String2Big are replaced by ParseBig, which is slightly stricter. It previously accepted leading zeros for hexadecimal inputs but treated decimal inputs as octal if a leading zero digit was present. ParseUint64 is used in places where String2Big was used to decode a uint64. The new functions MustParseBig and MustParseUint64 are now used in many places where parsing errors were previously ignored. * common: delete unused big integer variables * accounts/abi: replace uses of BytesToBig with use of encoding/binary * common: remove BytesToBig * common: remove Bytes2Big * common: remove BigTrue * cmd/utils: add BigFlag and use it for error-checked integer flags While here, remove environment variable processing for DirectoryFlag because we don't use it. * core: add missing error checks in genesis block parser * common: remove String2Big * cmd/evm: use utils.BigFlag * common/math: check for 256 bit overflow in ParseBig This is supposed to prevent silent overflow/truncation of values in the genesis block JSON. Without this check, a genesis block that set a balance larger than 256 bits would lead to weird behaviour in the VM. * cmd/utils: fixup import
* eth, les, swarm: fix go vet issues sufraced by log15Péter Szilágyi2017-02-231-1/+1
|
* all: blidly swap out glog to our log15, logs need reworkPéter Szilágyi2017-02-2312-205/+199
|
* params: core, core/vm, miner: 64bit gas instructionsJeffrey Wilcke2017-02-146-18/+20
| | | | | | | | | | | | | | | | | Reworked the EVM gas instructions to use 64bit integers rather than arbitrary size big ints. All gas operations, be it additions, multiplications or divisions, are checked and guarded against 64 bit integer overflows. In additon, most of the protocol paramaters in the params package have been converted to uint64 and are now constants rather than variables. * common/math: added overflow check ops * core: vmenv, env renamed to evm * eth, internal/ethapi, les: unmetered eth_call and cancel methods * core/vm: implemented big.Int pool for evm instructions * core/vm: unexported intPool methods & verification methods * core/vm: added memoryGasCost overflow check and test
* core, eth, internal: Added `debug_getBadBlocks()` method (#3654)Martin Holst Swende2017-02-141-0/+6
| | | | | | | | | | | | | | | | * core,eth,internal: Added `debug_getBadBlocks()` method When bad blocks are discovered, these are stored within geth. An RPC-endpoint makes them availablewithin the `debug` namespace. This feature makes it easier to discover network forks. ``` * core, api: go format + docs * core/blockchain: Documentation, fix minor nitpick * core: fix failing blockchain test
* Revert "params: core, core/vm, miner: 64bit gas instructions (#3514)"Jeffrey Wilcke2017-02-136-20/+18
| | | | This reverts commit 8b57c494908637a5c0e74f8f7a13b3218e026757.
* accounts, cmd, eth, internal, miner, node: wallets and HD APIsPéter Szilágyi2017-02-131-2/+4
|
* accounts, cmd, eth, internal, mobile, node: split account backendsPéter Szilágyi2017-02-131-8/+6
|
* Merge pull request #3605 from fjl/event-feedPéter Szilágyi2017-02-032-4/+4
|\ | | | | event: add new Subscription type and related utilities
| * event: deprecate TypeMux and related typesFelix Lange2017-01-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | The Subscription type is gone, all uses are replaced by *TypeMuxSubscription. This change is prep-work for the introduction of the new Subscription type in a later commit. gorename -from '"github.com/ethereum/go-ethereum/event"::Event' -to TypeMuxEvent gorename -from '"github.com/ethereum/go-ethereum/event"::muxsub' -to TypeMuxSubscription gofmt -w -r 'Subscription -> *TypeMuxSubscription' ./event/*.go find . -name '*.go' -and -not -regex '\./vendor/.*' \| xargs gofmt -w -r 'event.Subscription -> *event.TypeMuxSubscription'
* | params: core, core/vm, miner: 64bit gas instructions (#3514)Jeffrey Wilcke2017-02-026-18/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reworked the EVM gas instructions to use 64bit integers rather than arbitrary size big ints. All gas operations, be it additions, multiplications or divisions, are checked and guarded against 64 bit integer overflows. In additon, most of the protocol paramaters in the params package have been converted to uint64 and are now constants rather than variables. * common/math: added overflow check ops * core: vmenv, env renamed to evm * eth, internal/ethapi, les: unmetered eth_call and cancel methods * core/vm: implemented big.Int pool for evm instructions * core/vm: unexported intPool methods & verification methods * core/vm: added memoryGasCost overflow check and test
* | les: remove delayed les server startingZsolt Felfoldi2017-01-263-10/+2
|/
* eth/downloader: improve deliverNodeData (#3588)Felix Lange2017-01-241-72/+52
| | | | | Commit d3b751e accidentally deleted a crucial 'return' statement, leading to a crash in case of an issue with node data. This change improves the fix in PR #3591 by removing the lock entirely.
* eth/downloader: fix mutex regression causing panics on fail (#3591)Péter Szilágyi2017-01-201-1/+2
|
* Merge pull request #3579 from bas-vk/natspecPéter Szilágyi2017-01-171-3/+0
|\ | | | | cmd,eth,les,internal: remove natspec support
| * cmd,eth,les,internal: remove natspec supportBas van Kervel2017-01-171-3/+0
| |
* | cmd/geth, core: add support for recording SHA3 preimages (#3543)Nick Johnson2017-01-174-5/+13
|/
* eth: accept leading zeros for nonce parameter of submitWork (#3558)Felix Lange2017-01-131-2/+2
|
* core: remove support for Olympic networkBas van Kervel2017-01-121-1/+1
|
* all: fix ineffectual assignments and remove uses of crypto.Sha3Felix Lange2017-01-091-1/+1
| | | | | go get github.com/gordonklaus/ineffassign ineffassign .
* all: fix spelling errorsPéter Szilágyi2017-01-076-6/+6
|
* all: fix issues reported by honnef.co/go/simple/cmd/gosimpleFelix Lange2017-01-071-26/+4
|
* all: gofmt -w -sFelix Lange2017-01-068-31/+31
|
* Merge pull request #3516 from fjl/types-drop-sign-ecdsaPéter Szilágyi2017-01-064-9/+9
|\ | | | | core/types: remove redundant SignECDSA wrappers, rename to SignTx
| * core/types: remove redundant SignECDSA wrappers, rename to SignTxFelix Lange2017-01-054-9/+9
| |
* | trie: remove dependency on ethdbFelix Lange2017-01-061-5/+10
| | | | | | | | This removes the core/types -> leveldb dependency.
* | core/vm: move Log to core/typesFelix Lange2017-01-067-79/+73
|/ | | | | | | | This significantly reduces the dependency closure of ethclient, which no longer depends on core/vm as of this change. All uses of vm.Logs are replaced by []*types.Log. NewLog is gone too, the constructor simply returned a literal.
* core/vm: improved EVM run loop & instruction calling (#3378)Jeffrey Wilcke2017-01-052-4/+4
| | | | | | | | | | | | | | | The run loop, which previously contained custom opcode executes have been removed and has been simplified to a few checks. Each operation consists of 4 elements: execution function, gas cost function, stack validation function and memory size function. The execution function implements the operation's runtime behaviour, the gas cost function implements the operation gas costs function and greatly depends on the memory and stack, the stack validation function validates the stack and makes sure that enough items can be popped off and pushed on and the memory size function calculates the memory required for the operation and returns it. This commit also allows the EVM to go unmetered. This is helpful for offline operations such as contract calls.
* cmd/utils, eth, les: bubble --fakepow flag into eth/les tooPéter Szilágyi2017-01-041-6/+8
|
* eth: fix miner start API to accept int, not hexintPéter Szilágyi2016-12-231-2/+2
|
* internal/ethapi: fix hex handling for eth_call input and eth_sendRawTransactionFelix Lange2016-12-201-2/+2
|
* rpc: remove HexNumber, replace all uses with hexutil typesFelix Lange2016-12-202-23/+25
| | | | | This change couldn't be automated because HexNumber was used for numbers of all sizes.
* eth, miner: verify PoW in the remote agent to notify submitter (#3438)Péter Szilágyi2016-12-201-1/+1
|
* eth/filters: add FindOnce for iterator-like operation (#3435)Nick Johnson2016-12-201-20/+50
| | | | | | | | | | | This commit introduces a FindOnce method for filters. FindOnce finds the next block that matches the filter and returns all matching logs from that block. If there are no further matching logs, it returns a nil slice. This method allows callers to iterate over large sets of logs progressively. The changes introduce a small inefficiency relating to mipmaps: the first time a filter is called, it acts as if all mipmaps are matched, and thus iterates several blocks near the requested start point. This is in the interest of simplicity and avoiding duplicate mipmap lookups each time FindOnce is called.
* Merge pull request #3427 from Arachnid/gzipdumpPéter Szilágyi2016-12-141-2/+17
|\ | | | | cmd/utils, eth: Add gzip support for chain dump and restore
| * cmd/utils, eth: Add gzip support for chain dump and restoreNick Johnson2016-12-141-2/+17
| |
* | Merge pull request #3413 from zsfelfoldi/light-topic4Felix Lange2016-12-133-2/+13
|\ \ | |/ |/| les, p2p/discv5: implement server pool, improve peer selection, light fetcher and topic searching
| * eth, les: defer starting LES service until ETH initial sync is finishedZsolt Felfoldi2016-12-103-2/+13
| |
* | core: bugfix state change race condition in txpool (#3412)bas-vk2016-12-114-9/+17
|/ | | | | | | | The transaction pool keeps track of the current nonce in its local pendingState. When a new block comes in the pendingState is reset. During the reset it fetches multiple times the current state through the use of the currentState callback. When a second block comes in during the reset its possible that the state changes during the reset. If that block holds transactions that are currently in the pool the local pendingState that is used to determine nonces can get out of sync.
* core, core/vm: implemented a generic environment (#3348)Jeffrey Wilcke2016-12-062-5/+9
| | | | | | | | Environment is now a struct (not an interface). This reduces a lot of tech-debt throughout the codebase where a virtual machine environment had to be implemented in order to test or run it. The new environment is suitable to be used en the json tests, core consensus and light client.
* core, core/vm, eth/filters: move Removed field into vm.LogFelix Lange2016-12-054-109/+63
| | | | | | | | | | | | This field used to be assigned by the filter system and returned through the RPC API. Now that we have a Go client that uses the underlying type, the field needs to move. It is now assigned to true when the RemovedLogs event is generated so the filter system doesn't need to care about the field at all. While here, remove the log list from ChainSideEvent. There are no users of this field right now and any potential users could subscribe to RemovedLogsEvent instead.
* eth, miner: removed unnecessary state.Copy()Martin Holst Swende2016-11-301-2/+2
| | | | | | | | * miner: removed unnecessary state.Copy() * eth: made use of new miner method without state copying * miner: More documentation about new method
* eth/filter: add support for pending logs (#3219)bas-vk2016-11-286-90/+302
|
* eth/filters: simplify query object decodingFelix Lange2016-11-281-47/+44
|
* eth: removed http doc backend apiJeffrey Wilcke2016-11-251-7/+0
|
* common/registrar: delete the old registrar codeFelix Lange2016-11-251-7/+0
| | | | | | | The registrar was broken, unmaintained and there is a much better replacement: ENS. (cherry picked from commit 6ca8f57b08d550613175260cab7633adcacbe6ab)
* core: improved bad block error reporting (#3320)Jeffrey Wilcke2016-11-231-0/+2
|
* core/types, params: EIP#155Jeffrey Wilcke2016-11-136-21/+27
|
* core, core/state, trie: EIP158, reprice & skip empty account writeJeffrey Wilcke2016-11-1311-22/+24
| | | | | | | | | | | | | | | This commit implements EIP158 part 1, 2, 3 & 4 1. If an account is empty it's no longer written to the trie. An empty account is defined as (balance=0, nonce=0, storage=0, code=0). 2. Delete an empty account if it's touched 3. An empty account is redefined as either non-existent or empty. 4. Zero value calls and zero value suicides no longer consume the 25k reation costs. params: moved core/config to params Signed-off-by: Jeffrey Wilcke <jeffrey@ethereum.org>
* all: update license informationFelix Lange2016-11-095-11/+11
|
* core/types: remove header accessorsFelix Lange2016-11-092-3/+3
| | | | | | These accessors were introduced by light client changes, but the only method that is actually used is GetNumberU64. This commit replaces all uses of .GetNumberU64 with .Number.Uint64.
* p2p/discv5: added new topic discovery packageZsolt Felfoldi2016-11-091-3/+2
|
* cmd, eth: added light client and light server modeszsfelfoldi2016-11-0911-83/+193
|
* les: light client protocol and APIZsolt Felfoldi2016-11-097-25/+268
|
* eth/downloader: clear pending requests when switching trie rootPéter Szilágyi2016-11-011-9/+18
|
* eth/downloader: lower a state sync log level (users freak out)Péter Szilágyi2016-11-011-1/+1
|
* eth/downloader: reduce fast sync block requirements, fix testPéter Szilágyi2016-10-312-13/+28
|
* core/state, eth/downloader, trie: reset fast-failure on progressPéter Szilágyi2016-10-313-160/+206
|
* Godeps, vendor: convert dependency management to trash (#3198)Péter Szilágyi2016-10-294-158/+13
| | | | | | | | | | | | | | | | | | | | | | | This commit converts the dependency management from Godeps to the vendor folder, also switching the tool from godep to trash. Since the upstream tool lacks a few features proposed via a few PRs, until those PRs are merged in (if), use github.com/karalabe/trash. You can update dependencies via trash --update. All dependencies have been updated to their latest version. Parts of the build system are reworked to drop old notions of Godeps and invocation of the go vet command so that it doesn't run against the vendor folder, as that will just blow up during vetting. The conversion drops OpenCL (and hence GPU mining support) from ethash and our codebase. The short reasoning is that there's noone to maintain and having opencl libs in our deps messes up builds as go install ./... tries to build them, failing with unsatisfied link errors for the C OpenCL deps. golang.org/x/net/context is not vendored in. We expect it to be fetched by the user (i.e. using go get). To keep ci.go builds reproducible the package is "vendored" in build/_vendor.
* eth/downloader: fix a data race in a log outputPéter Szilágyi2016-10-211-1/+2
|
* cmd/geth, code, eth/downloader: tune import logs and mem statsPéter Szilágyi2016-10-211-1/+1
|
* common, core, eth/downloader: adjust import log formattingPéter Szilágyi2016-10-181-1/+1
|
* trie, core/state: improve memory usage and performance (#3135)Felix Lange2016-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * trie: store nodes as pointers This avoids memory copies when unwrapping node interface values. name old time/op new time/op delta Get 388ns ± 8% 215ns ± 2% -44.56% (p=0.000 n=15+15) GetDB 363ns ± 3% 202ns ± 2% -44.21% (p=0.000 n=15+15) UpdateBE 1.57µs ± 2% 1.29µs ± 3% -17.80% (p=0.000 n=13+15) UpdateLE 1.92µs ± 2% 1.61µs ± 2% -16.25% (p=0.000 n=14+14) HashBE 2.16µs ± 6% 2.18µs ± 6% ~ (p=0.436 n=15+15) HashLE 7.43µs ± 3% 7.21µs ± 3% -2.96% (p=0.000 n=15+13) * trie: close temporary databases in GetDB benchmark * trie: don't keep []byte from DB load around Nodes decoded from a DB load kept hashes and values as sub-slices of the DB value. This can be a problem because loading from leveldb often returns []byte with a cap that's larger than necessary, increasing memory usage. * trie: unload old cached nodes * trie, core/state: use cache unloading for account trie * trie: use explicit private flags (fixes Go 1.5 reflection issue). * trie: fixup cachegen overflow at request of nick * core/state: rename journal size constant
* eth: move "timed out DAO fork check, dropping" to debug levelFelix Lange2016-10-081-1/+1
|
* Merge pull request #3092 from fjl/state-journalJeffrey Wilcke2016-10-061-3/+3
|\ | | | | core/state: implement reverts by journaling all changes
| * core/state: implement reverts by journaling all changesFelix Lange2016-10-061-3/+3
| | | | | | | | | | | | | | | | | | | | This commit replaces the deep-copy based state revert mechanism with a linear complexity journal. This commit also hides several internal StateDB methods to limit the number of ways in which calling code can use the journal incorrectly. As usual consultation and bug fixes to the initial implementation were provided by @karalabe, @obscuren and @Arachnid. Thank you!
* | eth: monitor malicious header retrieval requestsPéter Szilágyi2016-10-052-5/+31
|/
* core, eth, trie: reuse trie journals in all our codePéter Szilágyi2016-09-282-4/+4
|