aboutsummaryrefslogtreecommitdiffstats
path: root/les
Commit message (Collapse)AuthorAgeFilesLines
* core: implement Metropolis EIP 658, receipt status byterjl4934564422017-08-221-2/+2
|
* core, light: send chain events using event.Feed (#14865)Miya Chen2017-08-185-8/+34
|
* les: fix megacheck warnings (#14941)Felföldi Zsolt2017-08-098-96/+6
| | | | | | * les: fix megacheck warnings * les: fixed testGetProofs
* Merge pull request #14737 from holiman/txpool_localaccountsPéter Szilágyi2017-07-101-3/+3
|\ | | | | Txpool localaccounts
| * core, eth, les: polish txpool API around local/remote txsPéter Szilágyi2017-07-051-3/+3
| |
* | eth/downloader, les, light: Changes in response to reviewNick Johnson2017-07-031-14/+1
| |
* | eth, les: Refactor downloader peer to use structsNick Johnson2017-06-291-47/+73
| |
* | eth, les, light: Refactor downloader to use blockchain interfaceNick Johnson2017-06-281-3/+1
|/
* core/state: access trie through Database interface, track errors (#14589)Felix Lange2017-06-273-46/+29
| | | | | | | | | 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).
* les: code refactoring (#14416)Felföldi Zsolt2017-06-2115-441/+699
| | | | | | | | | | | | This commit does various code refactorings: - generalizes and moves the request retrieval/timeout/resend logic out of LesOdr (will be used by a subsequent PR) - reworks the peer management logic so that all services can register with peerSet to get notified about added/dropped peers (also gets rid of the ugly getAllPeers callback in requestDistributor) - moves peerSet, LesOdr, requestDistributor and retrieveManager initialization out of ProtocolManager because I believe they do not really belong there and the whole init process was ugly and ad-hoc
* les: fix goroutine leak in execQueue (#14480)Felix Lange2017-05-172-30/+118
| | | | | | | | | | | execQueue used an atomic counter to track whether the queue had been closed, but the checking the counter didn't happen because the queue was blocked on its channel. Fix it by using a condition variable instead of sync/atomic. I tried an implementation based on channels first, but it was hard to make it reliable. quit now waits for the queue loop to exit.
* cmd, eth, les, mobile: make networkid uint64 everywherePéter Szilágyi2017-04-253-10/+10
|
* all: update license informationFelix Lange2017-04-142-2/+2
|
* cmd/utils, node: remove unused solc references and improve RPC config (#14324)bas-vk2017-04-131-5/+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-121-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-123-3/+4
| | | | | | * consensus, core, ethstats: use engine specific block beneficiary * core, eth, les, miner: use explicit beneficiary during mining
* les: allow LES connection to other servers (#13889)Felföldi Zsolt2017-04-111-2/+3
|
* Merge pull request #13870 from karalabe/miners-fixesPéter Szilágyi2017-04-071-1/+2
|\ | | | | 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-1/+2
| |
* | cmd, les, eth, eth/gasprice: using new gas price oracle (#13853)Felföldi Zsolt2017-04-062-2/+7
|/ | | | | | | | | | | | * 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
* core, consensus: pluggable consensus engines (#3817)Péter Szilágyi2017-04-054-18/+16
| | | | | 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-233-22/+27
| | | | | | | | | | | | | | | | | | | | | | | | 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-235-9/+14
| | | | | | | | | | 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.
* les: implement request distributor, fix blocking issues (#3660)Felföldi Zsolt2017-03-2315-306/+839
| | | | | * les: implement request distributor, fix blocking issues * core: moved header validation before chain mutex lock
* core, eth, les: support resuming fast sync on heavy rollback (#3743)Péter Szilágyi2017-03-221-0/+1
|
* cmd, eth, les, node, pow: disk caching and progress reportsPéter Szilágyi2017-03-091-6/+1
|
* all: swap out the C++ ethash to the pure Go one (mining todo)Péter Szilágyi2017-03-091-1/+2
|
* all: update light logs (and a few others) to the new modelPéter Szilágyi2017-03-038-214/+211
|
* eth, les: shorten genesis block mismatch error messageFelix Lange2017-02-281-1/+1
|
* common: move big integer math to common/math (#3699)Felix Lange2017-02-272-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-238-124/+121
|
* params: core, core/vm, miner: 64bit gas instructionsJeffrey Wilcke2017-02-142-5/+7
| | | | | | | | | | | | | | | | | 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
* Revert "params: core, core/vm, miner: 64bit gas instructions (#3514)"Jeffrey Wilcke2017-02-132-7/+5
| | | | This reverts commit 8b57c494908637a5c0e74f8f7a13b3218e026757.
* params: core, core/vm, miner: 64bit gas instructions (#3514)Jeffrey Wilcke2017-02-022-5/+7
| | | | | | | | | | | | | | | | 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, cmd/util: disable topic discovery with --nodiscoverZsolt Felfoldi2017-01-271-3/+9
|
* les: remove delayed les server startingZsolt Felfoldi2017-01-261-27/+3
|
* les: add unknown peers to server pool instead of rejecting themZsolt Felfoldi2017-01-262-38/+45
|
* Merge pull request #3579 from bas-vk/natspecPéter Szilágyi2017-01-171-2/+0
|\ | | | | cmd,eth,les,internal: remove natspec support
| * cmd,eth,les,internal: remove natspec supportBas van Kervel2017-01-171-2/+0
| |
* | cmd/geth, core: add support for recording SHA3 preimages (#3543)Nick Johnson2017-01-171-1/+2
|/
* les: fixed transaction sending deadlock (#3568)Felföldi Zsolt2017-01-161-1/+0
|
* Merge pull request #3535 from fjl/all-ineffassignPéter Szilágyi2017-01-101-2/+1
|\ | | | | all: fix ineffectual assignments
| * all: fix ineffectual assignments and remove uses of crypto.Sha3Felix Lange2017-01-091-2/+1
| | | | | | | | | | go get github.com/gordonklaus/ineffassign ineffassign .
* | Merge pull request #3519 from zsfelfoldi/light-topic5Péter Szilágyi2017-01-0910-121/+271
|\ \ | |/ |/| les: fixed selectPeer deadlock, improved request distribution
| * les: fixed selectPeer deadlock, improved request distributionZsolt Felfoldi2017-01-0610-121/+271
| | | | | | | | les/flowcontrol: using proper types for relative and absolute times
* | all: fix spelling errorsPéter Szilágyi2017-01-071-1/+1
| |
* | all: gofmt -w -sFelix Lange2017-01-068-21/+21
| |
* | Merge pull request #3516 from fjl/types-drop-sign-ecdsaPéter Szilágyi2017-01-061-7/+7
|\ \ | | | | | | core/types: remove redundant SignECDSA wrappers, rename to SignTx
| * | core/types: remove redundant SignECDSA wrappers, rename to SignTxFelix Lange2017-01-051-7/+7
| |/
* / core/vm: move Log to core/typesFelix Lange2017-01-061-1/+1
|/ | | | | | | | 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-4/+2
|
* rpc: remove HexNumber, replace all uses with hexutil typesFelix Lange2016-12-201-2/+3
| | | | | This change couldn't be automated because HexNumber was used for numbers of all sizes.
* Merge pull request #3413 from zsfelfoldi/light-topic4Felix Lange2016-12-1313-472/+1778
|\ | | | | les, p2p/discv5: implement server pool, improve peer selection, light fetcher and topic searching
| * les, light: add block availability check for ODR requestsZsolt Felfoldi2016-12-105-6/+59
| |
| * eth, les: defer starting LES service until ETH initial sync is finishedZsolt Felfoldi2016-12-102-3/+29
| |
| * les: using random request IDsZsolt Felfoldi2016-12-103-11/+10
| |
| * les: improved header fetcher and server statisticsZsolt Felfoldi2016-12-109-481/+801
| |
| * les: fixed light fetcher request ID matchingZsolt Felfoldi2016-12-082-5/+11
| |
| * les: implement light server poolZsolt Felfoldi2016-12-085-45/+947
| |
* | core: bugfix state change race condition in txpool (#3412)bas-vk2016-12-112-3/+7
|/ | | | | | | | 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-6/+17
| | | | | | | | 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.
* cmd, ethstats, les, mobile, params: native netstats (#3336)Péter Szilágyi2016-11-251-0/+1
|
* common/httpclient, les: removed httpclientJeffrey Wilcke2016-11-251-3/+0
|
* les: fixed loggingJeffrey Wilcke2016-11-161-1/+1
|
* core/types: turn off nonce checking for Call messagesZsolt Felfoldi2016-11-141-2/+2
|
* p2p/discv5: fixed bootnode connect issuesZsolt Felfoldi2016-11-141-2/+3
|
* les/flowcontrol: fixed locking schemeZsolt Felfoldi2016-11-141-4/+7
|
* Merge pull request #3179 from obscuren/eip-158Felix Lange2016-11-145-80/+41
|\ | | | | EIP158 & 160 Hardfork
| * core/types, params: EIP#155Jeffrey Wilcke2016-11-133-62/+24
| |
| * core, core/state, trie: EIP158, reprice & skip empty account writeJeffrey Wilcke2016-11-135-18/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | les: cleaned up logging (#3256)Jeffrey Wilcke2016-11-132-24/+29
|/
* les: add missing nil check and handle quit in findServersZsolt Felfoldi2016-11-111-2/+5
|
* les: print 'experimental feature' warning on startupFelix Lange2016-11-091-0/+3
|
* all: update license informationFelix Lange2016-11-0919-22/+89
|
* core/types: remove header accessorsFelix Lange2016-11-094-7/+7
| | | | | | 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-094-5/+53
|
* les: light client protocol and APIZsolt Felfoldi2016-11-0919-0/+5087