aboutsummaryrefslogtreecommitdiffstats
path: root/eth
Commit message (Collapse)AuthorAgeFilesLines
* core/vm, crypto/blake2b: add BLAKE2b compression func at 0x09Piotr Dyraga2019-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The precompile at 0x09 wraps the BLAKE2b F compression function: https://tools.ietf.org/html/rfc7693#section-3.2 The precompile requires 6 inputs tightly encoded, taking exactly 213 bytes, as explained below. - `rounds` - the number of rounds - 32-bit unsigned big-endian word - `h` - the state vector - 8 unsigned 64-bit little-endian words - `m` - the message block vector - 16 unsigned 64-bit little-endian words - `t_0, t_1` - offset counters - 2 unsigned 64-bit little-endian words - `f` - the final block indicator flag - 8-bit word [4 bytes for rounds][64 bytes for h][128 bytes for m][8 bytes for t_0] [8 bytes for t_1][1 byte for f] The boolean `f` parameter is considered as `true` if set to `1`. The boolean `f` parameter is considered as `false` if set to `0`. All other values yield an invalid encoding of `f` error. The precompile should compute the F function as specified in the RFC (https://tools.ietf.org/html/rfc7693#section-3.2) and return the updated state vector `h` with unchanged encoding (little-endian). See EIP-152 for details.
* eth, graphql, internal/ethapi, les: polish and improve graphql (#19886)gary rong2019-07-251-8/+4
|
* eth, internal, les: add getHeaderBy* APIs (#19669)gary rong2019-07-231-11/+15
| | | | | | | | * eth, interal, les: add getHeaderBy* APIs * internal: address the comment * eth, internal, les: getHeader nits, missing TD, console callable
* cmd, contracts, eth, p2p, signer, whisper: fixed ineffectual assignments ↵Christian Muehlhaeuser2019-07-221-1/+1
| | | | | (#19869) Fixed assigning values to variables we don't end up using.
* cmd, crypto, eth, internals: fix Typos (#19868)Kitten King2019-07-221-1/+1
|
* all: replace fmt.Print* calls with t.Log* in tests (#19670)大彬2019-07-172-15/+15
|
* eth: add debug_accountRange (#17438)jwasinger2019-07-132-0/+223
| | | | This adds the debug_accountRange method which returns all accounts in the state for a given block and transaction index.
* eth: fix storageRangeAt for empty blocks (#18076)cdetrio2019-07-121-0/+5
|
* cmd, eth: fix dump config issue (#19825)gary rong2019-07-112-8/+8
| | | | | | * eth: fix error when dump config with nil checkpoint * cmd/utils: ignore default datadir if it's already set.
* cmd, eth, les: make les flags conform to dotted stylePéter Szilágyi2019-07-102-14/+14
|
* cmd, eth, les: fix up ultra light config integrationPéter Szilágyi2019-07-103-36/+34
|
* core: kill off managed state, use own tiny noncer for txpoolPéter Szilágyi2019-07-091-1/+1
|
* core/forkid: implement the forkid EIP, announce via ENR (#19738)Péter Szilágyi2019-07-086-94/+123
| | | | | | | | | | | | | | | | * eth: chain config (genesis + fork) ENR entry * core/forkid, eth: protocol independent fork ID, update to CRC32 spec * core/forkid, eth: make forkid a struct, next uint64, enr struct, RLP * core/forkid: change forkhash rlp encoding from int to [4]byte * eth: fixup eth entry a bit and update it every block * eth: fix lint * eth: fix crash in ethclient tests
* eth, les: add sanity checks for unbounded block fields (#19573)Martin Holst Swende2019-07-083-4/+20
| | | This PR adds some hardening in the lower levels of the protocol stack, to bail early on invalid data. Primarily, attacks that this PR protects against are on the "annoyance"-level, which would otherwise write a couple of megabytes of data into the log output, which is a bit resource intensive.
* cmd, eth, les, param: drop --override.constantinoplePéter Szilágyi2019-07-023-9/+1
|
* all: on-chain oracle checkpoint syncing (#19543)gary rong2019-06-286-12/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * all: implement simple checkpoint syncing cmd, les, node: remove callback mechanism cmd, node: remove callback definition les: simplify the registrar les: expose checkpoint rpc services in the light client les, light: don't store untrusted receipt cmd, contracts, les: discard stale checkpoint cmd, contracts/registrar: loose restriction of registeration cmd, contracts: add replay-protection all: off-chain multi-signature contract params: deploy checkpoint contract for rinkeby cmd/registrar: add raw signing mode for registrar cmd/registrar, contracts/registrar, les: fixed messages * cmd/registrar, contracts/registrar: fix lints * accounts/abi/bind, les: address comments * cmd, contracts, les, light, params: minor checkpoint sync cleanups * cmd, eth, les, light: move checkpoint config to config file * cmd, eth, les, params: address comments * eth, les, params: address comments * cmd: polish up the checkpoint admin CLI * cmd, contracts, params: deploy new version contract * cmd/checkpoint-admin: add another flag for clef mode signing * cmd, contracts, les: rename and regen checkpoint oracle with abigen
* eth: fix sync bloom panic (#19757)gary rong2019-06-263-16/+22
| | | | | | * eth: fix sync bloom panic * eth: delete useless test cases
* core/state, cmd/geth: streaming json output for dump command (#15475)Martin Holst Swende2019-06-241-2/+2
| | | | | | | | | | | | * core/state, cmd/geth: streaming json output dump cmd + optional code+storage * dump: add option to continue even if preimages are missing * core, evm: lint nits * cmd: use local flags for dump, omit empty code/storage * core/state: fix state dump test
* eth: enforce stricter known limits on idle peersPéter Szilágyi2019-06-121-0/+24
|
* eth, les: reject stale request (#19689)gary rong2019-06-111-0/+1
| | | | | | * eth, les: reject stale request * les: reuse local head number
* core, ethdb, metrics, p2p: expose various counter metrics for grafanaPéter Szilágyi2019-06-111-3/+1
|
* eth: check for DefaultConfig.NetworkId in test (#17599)Nguyen Kien Trung2019-06-061-1/+1
| | | This makes the test work if NetworkId is changed in forks of go-ethereum.
* eth/downloader: make syncing error more obvious (#19413)gary rong2019-06-053-42/+45
|
* eth, les: reject light client connection is server is not synced (#19616)gary rong2019-05-271-0/+1
| | | | | | | | * eth, les: reject light client connection is server is not synced * eth, les: rename function and variables * les: format
* core/rawdb, eth/downloader: align 64bit atomic fieldsPéter Szilágyi2019-05-171-3/+7
|
* cosensus, core, eth, params, trie: fixes + clique history capPéter Szilágyi2019-05-163-18/+18
|
* core, cmd, vendor: fixes and database inspection tool (#15)gary rong2019-05-161-12/+12
| | | | | | | | | | | | | | | | | | | | | | * core, eth: some fixes for freezer * vendor, core/rawdb, cmd/geth: add db inspector * core, cmd/utils: check ancient store path forceily * cmd/geth, common, core/rawdb: a few fixes * cmd/geth: support windows file rename and fix rename error * core: support ancient plugin * core, cmd: streaming file copy * cmd, consensus, core, tests: keep genesis in leveldb * core: write txlookup during ancient init * core: bump database version
* all: integrate the freezer with fast syncgary rong2019-05-162-15/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * all: freezer style syncing core, eth, les, light: clean up freezer relative APIs core, eth, les, trie, ethdb, light: clean a bit core, eth, les, light: add unit tests core, light: rewrite setHead function core, eth: fix downloader unit tests core: add receipt chain insertion test core: use constant instead of hardcoding table name core: fix rollback core: fix setHead core/rawdb: remove canonical block first and then iterate side chain core/rawdb, ethdb: add hasAncient interface eth/downloader: calculate ancient limit via cht first core, eth, ethdb: lots of fixes * eth/downloader: print ancient disable log only for fast sync
* cmd, core, eth, les, node: chain freezer on top of db reworkPéter Szilágyi2019-05-162-1/+2
|
* core, eth, trie: bloom filter for trie node dedup during fast sync (#19489)Péter Szilágyi2019-05-137-25/+53
| | | | | | | | | | | | * core, eth, trie: bloom filter for trie node dedup during fast sync * eth/downloader, trie: address review comments * core, ethdb, trie: restart fast-sync bloom construction now and again * eth/downloader: initialize fast sync bloom on startup * eth: reenable eth/62 until we properly remove it
* les, light: implement ODR transaction lookup by hash (#19069)Felföldi Zsolt2019-05-131-0/+6
| | | | | | | | | | | | * les, light: implement ODR transaction lookup by hash * les: delete useless file * internal/ethapi: always use backend to find transaction * les, eth, internal/ethapi: renamed GetCanonicalTransaction to GetTransaction * light: add canonical header verification to GetTransaction
* eth/downloader: fix header delays during chain dedupPéter Szilágyi2019-05-071-0/+7
|
* eth, les: add error when accessing missing block state (#18346)Martin Holst Swende2019-05-021-1/+5
| | | | | | This change makes getBalance, getCode, getStorageAt, getProof, call, getTransactionCount return an error if the block number in the request doesn't exist. getHeaderByNumber still returns null for missing headers.
* eth: enforce chain above CHT before accepting txs into the poolPéter Szilágyi2019-04-262-6/+32
|
* eth/downloader: enable unsync-protection for light client (#19496)gary rong2019-04-252-3/+3
| | | | | | * eth/downloader: enable unsync-protection for light client * eth/downloader: fix tests
* miner: polish miner configuration (#19480)gary rong2019-04-233-88/+57
| | | | | | | | | | | | | * cmd, eth, miner: disable advance sealing if user require * cmd, console, miner, les, eth: wrap the miner config * eth: remove todo * cmd, miner: revert noadvance flag The reason for this is: if the transaction execution is even longer than block time, then this kind of transactions is DoS attack.
* eth, les, light: enforce CHT checkpoints on fast-sync tooPéter Szilágyi2019-04-176-103/+195
|
* core, eth, les, light: scope receipt functionality a bit cleanerPéter Szilágyi2019-04-152-3/+3
|
* core, eth, les, light: store transaction receipts without txHash and gasCostMatthew Halpern2019-04-151-0/+5
|
* eth, les, geth: implement cli-configurable global gas cap for RPC calls (#19401)Martin Holst Swende2019-04-082-0/+7
| | | | | | | | * eth, les, geth: implement cli-configurable global gas cap for RPC calls * graphql, ethapi: place gas cap in DoCall * ethapi: reformat log message
* accounts, cmd, internal: disable unlock account on open HTTP (#17037)gary rong2019-04-042-3/+8
| | | | | | | | | | * cmd, accounts, internal, node, rpc, signer: insecure unlock protect * all: strict unlock API by rpc * cmd/geth: check before printing warning log * accounts, cmd/geth, internal: tiny polishes
* cmd, core, eth: support disabling the concurrent state prefetcherPéter Szilágyi2019-04-012-2/+10
|
* eth: remove redundant chain config fieldsPéter Szilágyi2019-03-274-25/+21
|
* eth: fix EIP158 account cleanup on chain tracing (#19341)Jonas2019-03-271-1/+1
| | | Fixes #19337
* cmd, core, eth, trie: get rid of trie cache generations (#19262)Péter Szilágyi2019-03-142-3/+3
| | | | | | * cmd, core, eth, trie: get rid of trie cache generations * core, trie: get rid of remainder of cache gen boilerplate
* eth/downloader: fix ancestor searching for light syncing (#19136)gary rong2019-03-141-17/+19
|
* core/vm: 64 bit memory and gas calculations (#19210)Martin Holst Swende2019-03-122-2/+2
| | | | | | | | | | | | | | | | | | | | | | * core/vm: remove function call for stack validation from evm runloop * core/vm: separate gas calc into static + dynamic * core/vm: optimize push1 * core/vm: reuse pooled bigints for ADDRESS, ORIGIN and CALLER * core/vm: use generic error message for jump/jumpi, to avoid string interpolation * testdata: fix tests for new error message * core/vm: use 64-bit memory calculations * core/vm: fix error in memory calculation * core/vm: address review concerns * core/vm: avoid unnecessary use of big.Int:BitLen()
* eth/downloader: fix nil droppeer in state syncPéter Szilágyi2019-03-071-1/+7
|
* all: clean up and proerly abstract database accessPéter Szilágyi2019-03-0613-71/+51
|
* les, les/flowcontrol: improved request serving and flow control (#18230)Felföldi Zsolt2019-02-263-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | This change - implements concurrent LES request serving even for a single peer. - replaces the request cost estimation method with a cost table based on benchmarks which gives much more consistent results. Until now the allowed number of light peers was just a guess which probably contributed a lot to the fluctuating quality of available service. Everything related to request cost is implemented in a single object, the 'cost tracker'. It uses a fixed cost table with a global 'correction factor'. Benchmark code is included and can be run at any time to adapt costs to low-level implementation changes. - reimplements flowcontrol.ClientManager in a cleaner and more efficient way, with added capabilities: There is now control over bandwidth, which allows using the flow control parameters for client prioritization. Target utilization over 100 percent is now supported to model concurrent request processing. Total serving bandwidth is reduced during block processing to prevent database contention. - implements an RPC API for the LES servers allowing server operators to assign priority bandwidth to certain clients and change prioritized status even while the client is connected. The new API is meant for cases where server operators charge for LES using an off-protocol mechanism. - adds a unit test for the new client manager. - adds an end-to-end test using the network simulator that tests bandwidth control functions through the new API.
* core: remove unnecessary fields in logs, receipts and tx lookups (#17106)gary rong2019-02-211-5/+9
| | | | | | | | | | | | * core: remove unnecessary fields in log * core: bump blockchain database version * core, les: remove unnecessary fields in txlookup * eth: print db version explicitly * core/rawdb: drop txlookup entry struct wrapper
* eth: extract check for tracing transaction in block file (#19107)Matthew Halpern2019-02-201-7/+12
| | | | | | Simplifies the transaction presense check to use a function to determine if the transaction is present in the block provided to trace, which originally had a redundant parenthesis and used a `exist` flag to dictate control flow.
* eth, node: use APPDATA env to support cygwin/msys correctly (#17786)HackyMiner2019-02-191-2/+9
| | | | | | | | | This changes default location of the data directory to use the LOCALAPPDATA environment variable, resolving issues with remote home directories an improving compatibility with Cygwin. Fixes #2239 Fixes #2237 Fixes #16437
* eth: remove redundant parentheses (#19108)Matthew Halpern2019-02-181-1/+1
|
* eth/tracers: enforce camel case variable names (#19057)Matthew Halpern2019-02-141-2/+2
|
* cmd/utils, eth: relinquish GC cache to read cache in archive modePéter Szilágyi2019-02-071-0/+6
|
* accounts, eth, clique, signer: support for external signer API (#18079)Martin Holst Swende2019-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * accounts, eth, clique: implement external backend + move sighash calc to backend * signer: implement account_Version on external API * accounts/external: enable ipc, add copyright * accounts, internal, signer: formatting * node: go fmt * flags: disallow --dev in combo with --externalsigner * accounts: remove clique-specific signing method, replace with more generic * accounts, consensus: formatting + fix error in tests * signer/core: remove (test-) import cycle * clique: remove unused import * accounts: remove CliqueHash and avoid dependency on package crypto * consensus/clique: unduplicate header encoding
* eth: make tracers respect pre- EIP 158/161 ruleMartin Holst Swende2019-02-011-4/+8
|
* cmd,eth: 16400 Add an option to stop geth once in sync. WIP for light mode ↵lhendre2019-01-302-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#17321) * cmd, eth: Added in the flag to step geth once sync based on input * cmd, eth: 16400 Add an option to stop geth once in sync. * cmd: 16400 Add an option to stop geth once in sync. WIP * cmd/geth/main, les/fletcher: added in light mode support * cmd/geth/main, les/fletcher: Cleaned Comments and code for light mode * cmd: 16400 Fixed formatting issue and cleaned code * cmd, eth, les: 16400 Fixed formatting issues * cmd, eth, les: Performed gofmt to update formatting * cmd, eth, les: Fixed bugs resulting formatting * cmd/geth, eth/, les: switched to downloader event * eth: Fixed styling and gen_config * eth/: Fix nil error in config file * cmd/geth: Updated countdown log * les/fetcher.go: Removed depcreated channel * eth/downloader.go: Removed deprecated select * cmd/geth, cmd/utils: Fixed minor issues * eth: Reverted config files to proper format * eth: Fixed typo in config file * cmd/geth, eth/down: Updated code to use header time stamp * eth/downloader: Changed the time threshold to 10 minutes * cmd/geth, eth/downloader: Updated downloading event to pass latest header * cmd/geth: Updated main to use right timer object * cmd/geth: Removed unused failed event * cmd/geth: added in correct time field with type assertion * cmd/geth, cmd/utils: Updated flag to use boolean * cmd/geth, cmd/utils, eth/downloader: Cleaned up code based on recommendations * cmd/geth: Removed unneeded import * cmd/geth, eth/downloader: fixed event field and suggested changes * cmd/geth, cmd/utils: Updated flag and linting issue
* eth/fetcher: blockFilter is not used anymore (#17971)Wenbiao Zheng2019-01-261-2/+0
|
* les: implement ultralight client (#16904)b00ris2019-01-243-10/+36
| | | | For more information about this light client mode, read https://hackmd.io/s/HJy7jjZpm
* tests: tune flaky tests that error in travis occasionally (#18508)Martin Holst Swende2019-01-231-1/+1
| | | | | | * tests: tune flaky tests that error in travis occasionally * tests: formatting
* eth: properly flush files in standardTraceBlockToFile (#18502)Martin Holst Swende2019-01-231-2/+6
|
* core, eth: fix database version (#18429)gary rong2019-01-111-2/+4
| | | | | | * core, eth: fix database version * eth: polish error message
* eth/tracer: extend create2 (#18318)gary rong2019-01-066-10/+122
| | | | | | | | | | * eth/tracer: extend create2 * eth/tracers: fix create2-flaw in prestate_tracer * eth/tracers: fix test * eth/tracers: update assets
* vendor, crypto, swarm: switch over to upstream sha3 packageDave McGregor2019-01-041-2/+2
|
* eth/downloader: progress in stateSync not used anymore (#17998)Wenbiao Zheng2018-12-221-7/+4
|
* downloader: fix edgecase where returned index is OOB for downloader (#18335)Martin Holst Swende2018-12-201-1/+9
| | | | | | | | * downloader: fix edgecase where returned index is OOB for downloader * downloader: documentation Co-Authored-By: holiman <martin@swende.se>
* cmd/geth, core, eth: implement Constantinople override flag (#18273)Martin Holst Swende2018-12-112-1/+5
| | | | | | | | * geth/core/eth: implement constantinople override flag * les: implemnent constantinople override flag for les clients * cmd/geth, eth, les: fix typo, move flag to experimentals
* cmd/utils, eth: minor polishes on whitelist codePéter Szilágyi2018-12-101-18/+11
|
* cmd, eth: Add support for `--whitelist <blocknum>=<hash>,...` flagRyan Schneider2018-12-105-5/+32
| | | | | * Rejects peers that respond with a different hash for any of the passed in block numbers. * Meant for emergency situations when the network forks unexpectedly.
* eth, internal/web3ext: tiny polishes in tracersPéter Szilágyi2018-12-101-77/+95
|
* cmd/evm, core/vm, eth: implement api methods to do stdjson dump to local ↵Martin Holst Swende2018-12-101-11/+130
| | | | filesystem
* eth/tracers: fixed incorrect storage from prestate_tracer (#18253)Max Sistemich2018-12-102-17/+14
| | | | | | * eth: fixed incorrect storage from prestate_tracer * eth/tracers: updated assets.go
* core, internal, eth, miner, les: Take VM config from BlockChain (#17955)Paweł Bylica2018-12-061-2/+2
| | | | | | | | | | | Until this commit, when sending an RPC request that called `NewEVM`, a blank `vm.Config` would be taken so as to set some options, based on the default configuration. If some extra configuration switches were passed to the blockchain, those would be ignored. This PR adds a function to get the config from the blockchain, and this is what is now used for RPC calls. Some subsequent changes need to be made, see https://github.com/ethereum/go-ethereum/pull/17955#pullrequestreview-182237244 for the details of the discussion.
* eth/downloader: fix light client cht binary search issuePéter Szilágyi2018-11-281-0/+22
|
* eth: increase timeout in TestBroadcastBlock (#18064)Felix Lange2018-11-231-2/+2
|
* core, eth/downloader: fix ancestor lookup for fast syncPéter Szilágyi2018-11-162-13/+50
|
* downloader: different sync strategyMartin Holst Swende2018-11-162-39/+155
|
* eth: fix comment typo (#18114)mr_franklin2018-11-152-2/+2
| | | | | | * consensus/clique: fix comment typo * eth,eth/downloader: fix comment typo
* cmd, core, eth, light, trie: add trie read caching layerPéter Szilágyi2018-11-155-21/+41
|
* eth: fix minor grammar issue in comment (#18091)mr_franklin2018-11-131-1/+1
|
* core/vm, eth/tracers: use pointer receiver for GetRefund (#18018)Corey Lin2018-11-081-1/+1
|
* eth, p2p: fix comment typos (#18014)Corey Lin2018-11-081-1/+1
|
* eth/downloader: speed up tests by generating chain only once (#17916)Felix Lange2018-11-072-544/+491
| | | | | | | | | | | | * core: speed up GenerateChain Use a mock implementation of ChainReader instead of creating and destroying a BlockChain object for each generated block. * eth/downloader: speed up tests by generating chain only once This change reworks the downloader tests so they share a common test blockchain instead of generating a chain in every test. The tests are roughly twice as fast now.
* eth/downloader: remove the expired id directly (#17963)Wenbiao Zheng2018-11-071-4/+3
|
* core, eth/downloader: fix validation flaw, fix downloader printout flaw (#17974)Martin Holst Swende2018-11-071-0/+1
|
* downloader: measure successfull deliveries, not failed (#17983)Martin Holst Swende2018-11-071-8/+11
| | | | | | * downloader: measure successfull deliveries, not failed * downloader: fix typos
* eth/downloader: SetBlocksIdle is not used (#17962)Wenbiao Zheng2018-10-241-7/+0
| | | | | | __ <(o )___ ( ._> / `---'
* core/vm: adds refund as part of the json standard trace (#17910)Martin Holst Swende2018-10-232-7/+20
| | | | | | | This adds the global accumulated refund counter to the standard json output as a numeric json value. Previously this was not very interesting since it was not used much, but with the new sstore gas changes the value is a lot more interesting from a consensus investigation perspective.
* eth/downloader: fix comment typos (#17956)Wenbiao Zheng2018-10-232-6/+6
|
* eth/downloader: fix invalid hash chain error due to head mini reorgPéter Szilágyi2018-10-052-3/+40
|
* core/vm: faster create/create2 (#17806)Martin Holst Swende2018-10-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | * core/vm/runtim: benchmark create/create2 * core/vm: do less hashing in CREATE2 * core/vm: avoid storing jumpdest analysis for initcode * core/vm: avoid unneccesary lookups, remove unused fields * core/vm: go formatting tests * core/vm: save jumpdest analysis locally * core/vm: use common.Hash instead of nil, fix review comments * core/vm: removed type destinations * core/vm: correct check for empty hash * eth: more elegant api_tracer * core/vm: address review concerns
* eth: fixed the minor typo inside the comments (#17830)Liang Ma2018-10-041-1/+1
|
* core, internal/ethapi: add and use LRU cache for receipts (#17610)Ryan Schneider2018-09-301-10/+2
|
* eth: broadcast blocks to at least 4 peers (#17725)ledgerwatch2018-09-302-8/+109
|
* eth/downloader: use intermediate variable for better readability (#17510)Wenbiao Zheng2018-09-301-4/+8
|
* internal/ethapi: add eth_chainId method (#17617)HackyMiner2018-09-301-0/+9
| | | This implements EIP-695.
* 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
| |