Commit Graph

216 Commits

Author SHA1 Message Date
Bas van Kervel eae81465c1 rpc: new RPC implementation with pub/sub support 2015-12-14 16:34:05 +01:00
Bas van Kervel 98cbe1356e miner: bugfix were blockhash in receipts and logs is left empty 2015-11-19 16:02:49 +01:00
Péter Szilágyi e86e0ecdc8 core, eth, miner, xeth: clean up tx/receipt db accessors 2015-11-19 16:03:32 +02:00
Jeffrey Wilcke a1d9ef48c5 core, eth, rpc: split out block validator and state processor
This removes the burden on a single object to take care of all
validation and state processing. Now instead the validation is done by
the `core.BlockValidator` (`types.Validator`) that takes care of both
header and uncle validation through the `ValidateBlock` method and state
validation through the `ValidateState` method. The state processing is
done by a new object `core.StateProcessor` (`types.Processor`) and
accepts a new state as input and uses that to process the given block's
transactions (and uncles for rewords) to calculate the state root for
the next block (P_n + 1).
2015-11-18 14:24:42 +01:00
Jeffrey Wilcke 8c38f8d815 miner: synchronise start / stop
This PR fixes an issue where the remote worker was stopped twice and not
properly handled. This adds a synchronised running check to the start
and stop methods preventing closing of a channel more than once.
2015-10-31 02:18:41 +01:00
Felix Lange fbdb44dcc1 cmd/utils, rpc/comms: stop XEth when IPC connection ends
There are a bunch of changes required to make this work:

- in miner: allow unregistering agents, fix RemoteAgent.Stop
- in eth/filters: make FilterSystem.Stop not crash
- in rpc/comms: move listen loop to platform-independent code

Fixes #1930. I ran the shell loop there for a few minutes and didn't see
any changes in the memory profile.
2015-10-29 17:26:26 +01:00
Jeffrey Wilcke 0467a6ceec Merge pull request #1889 from karalabe/fast-sync-rebase
eth/63 fast synchronization algorithm
2015-10-21 11:44:22 -07:00
Péter Szilágyi 832b37c822 core, eth: receipt chain reconstruction 2015-10-19 10:03:09 +03:00
Felix Lange de8d5aaa92 core, core/state: move gas tracking out of core/state
The amount of gas available for tx execution was tracked in the
StateObject representing the coinbase account. This commit makes the gas
counter a separate type in package core, which avoids unintended
consequences of intertwining the counter with state logic.
2015-10-17 10:24:34 +02:00
Jeffrey Wilcke 10ed107ba2 Merge pull request #1899 from obscuren/mipmap-bloom
core, eth/filters, miner, xeth: Optimised log filtering
2015-10-16 12:35:24 -07:00
Jeffrey Wilcke 6dc14788a2 core, eth/filters, miner, xeth: Optimised log filtering
Log filtering is now using a MIPmap like approach where addresses of
logs are added to a mapped bloom bin. The current levels for the MIP are
in ranges of 1.000.000, 500.000, 100.000, 50.000, 1.000. Logs are
therefor filtered in batches of 1.000.
2015-10-16 21:28:59 +02:00
Jeffrey Wilcke d5327ddc5f Merge pull request #1869 from Gustav-Simonsson/gpu_miner
all: Add GPU mining, disabled by default
2015-10-16 06:25:33 -07:00
Gustav Simonsson 1b1f293082 core/state, core, miner: handle missing root error from state.New 2015-10-16 02:22:06 +02:00
Péter Szilágyi 402fd6e8c6 core, eth, event, miner, xeth: fix event post / subscription race 2015-10-12 16:22:03 +03:00
Gustav Simonsson ec6a548ee3 all: Add GPU mining, disabled by default 2015-10-07 13:19:30 +02:00
Jeffrey Wilcke 7c7692933c cmd/geth, cmd/utils, core, rpc: renamed to blockchain
* Renamed ChainManager to BlockChain
* Checkpointing is no longer required and never really properly worked
when the state was corrupted.
2015-10-04 01:13:56 +02:00
Jeffrey Wilcke 361082ec4b cmd/evm, core/vm, test: refactored VM and core
* Moved `vm.Transfer` to `core` package and changed execution to call
`env.Transfer` instead of `core.Transfer` directly.
* core/vm: byte code VM moved to jump table instead of switch
* Moved `vm.Transfer` to `core` package and changed execution to call
  `env.Transfer` instead of `core.Transfer` directly.
* Byte code VM now shares the same code as the JITVM
* Renamed Context to Contract
* Changed initialiser of state transition & unexported methods
* Removed the Execution object and refactor `Call`, `CallCode` &
  `Create` in to their own functions instead of being methods.
* Removed the hard dep on the state for the VM. The VM now
  depends on a Database interface returned by the environment. In the
  process the core now depends less on the statedb by usage of the env
* Moved `Log` from package `core/state` to package `core/vm`.
2015-10-04 01:13:54 +02:00
Felix Lange a2d5a60418 core, core/state: batch-based state sync 2015-09-22 22:57:37 +02:00
Jeffrey Wilcke 58fbcaa750 Merge pull request #1810 from karalabe/pure-header-verifications-2
core, eth, miner: use pure header validation
2015-09-16 14:21:12 -07:00
Péter Szilágyi 821619e1c3 core, eth, miner: use pure header validation 2015-09-16 10:46:28 +03:00
Felix Lange 8c4dab77ba all: move common.Database to package ethdb 2015-09-14 23:36:30 +02:00
Péter Szilágyi cdc2662c40 core: split out TD from database and all internals 2015-09-11 17:42:25 +03:00
Bas van Kervel 652eea71fe put unlock after lock 2015-09-08 12:42:29 +02:00
Bas van Kervel 618065895b agent/miner Prevent the CpuAgent to be started multiple times 2015-09-08 11:27:55 +02:00
Christoph Jentzsch 0fda4c4e15 fix block time issue
currently, under normal circumstances, you always set the timestamp to previous.Time() + 1.
credits to https://www.reddit.com/r/ethereum/comments/3jcs5r/code_avg_block_time_vs_difficulty_adjustment/cuoi4op

style
2015-09-03 00:05:05 +02:00
Gustav Simonsson d9addf79fa Improve error string and remove unneeded else clause 2015-08-28 03:42:01 +02:00
Gustav Simonsson 829201382b rpc: return error code for eth_getWork when no work ready 2015-08-26 12:46:50 +02:00
Gustav Simonsson 7324176f70 Add tests for uncle timestamps and refactor timestamp type 2015-08-25 04:46:11 +02:00
Jeffrey Wilcke b4369e1015 core, miner: write miner receipts 2015-08-18 21:46:26 +02:00
Jeffrey Wilcke a23478c0be core, eth, trie, xeth: merged state, chain, extra databases in one 2015-08-07 22:29:02 +02:00
Jeffrey Wilcke d7580f21f6 Merge pull request #1595 from obscuren/extra-data
cmd/geth, eth: added canonical extra data
2015-08-07 05:00:36 -07:00
Jeffrey Wilcke 132df860d9 miner, rpc: added length check for extra data 2015-08-07 12:24:44 +02:00
Jeffrey Wilcke c32073b11f miner, rpc: added submit hashrate for remote agents 2015-08-06 12:58:54 +02:00
Jeffrey Wilcke 35f271b264 miner, core: sort txs by price, nonce 2015-08-05 17:44:19 +02:00
Jeffrey Wilcke f12e0161ca Merge pull request #1588 from obscuren/diff-bomb
core, miner: added difficulty bomb
2015-08-05 04:26:57 -07:00
Jeffrey Wilcke 71d32f54f7 core, miner: added difficulty bomb 2015-08-05 13:09:09 +02:00
Jeffrey Wilcke d8590d9790 miner: fixed worker race condition 2015-08-04 20:54:21 +02:00
Felix Lange bfbcfbe4a9 all: fix license headers one more time
I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
2015-07-23 18:35:11 +02:00
Felix Lange 3f047be5aa all: update license headers to distiguish GPL/LGPL
All code outside of cmd/ is licensed as LGPL. The headers
now reflect this by calling the whole work "the go-ethereum library".
2015-07-22 18:51:45 +02:00
Péter Szilágyi 3029349761 miner: fix current work data race 2015-07-20 14:37:43 +03:00
Jeffrey Wilcke 1b9ef0e52d miner: moved state sync
Moved the state sync so it only syncs the state when the block mining yield a possitive result
2015-07-16 14:19:27 +02:00
Jeffrey Wilcke e870e61bc9 miner: smart mining
Work is now handled and carried over multiple sessions. Previously one
session only was assumed, potentially resulting in invalid (outdated)
work

* Larger work / result queue
* Full validation option
2015-07-15 20:37:12 +02:00
Jeffrey Wilcke 97d22be318 Merge pull request #1441 from obscuren/logs-return-fix
miner, xeth: fire log event during mining. Fix return raw tx
2015-07-09 07:24:35 -07:00
Jeffrey Wilcke 819ecd4508 miner, xeth: fire log event during mining. Fix return raw tx 2015-07-08 15:34:11 +02:00
Gustav Simonsson 5d6d40f329 Use uint64 on ts in chain_manager, block_processor 2015-07-08 13:21:06 +02:00
Felix Lange bdae4fd573 all: add some godoc synopsis comments 2015-07-07 14:12:45 +02:00
Felix Lange ea54283b30 all: update license information 2015-07-07 14:12:44 +02:00
Jeffrey Wilcke 37c1a8f69d eth,miner,rpc: set coinbase 2015-07-07 10:58:47 +02:00
Jeffrey Wilcke e6bb9c1cad core, miner: removed vm errors from consensus err checking
Removed VM errors from the consensus errors. They now used for output
only.
2015-07-06 12:43:05 +02:00
Jeffrey Wilcke bcc1660abc core, miner, tests: added test, implemented bad block reporting 2015-07-05 15:14:31 +02:00