Commit Graph

6773 Commits

Author SHA1 Message Date
Jeffrey Wilcke
44fd395141 Merge pull request #1879 from obscuren/versioning
cmd/geth: dev version number
2015-10-05 12:35:42 -07:00
Jeffrey Wilcke
7b44b8aece cmd/geth: dev version number 2015-10-05 21:11:39 +02:00
Jeffrey Wilcke
13699e2dd9 Merge pull request #1877 from obscuren/head-write
core: fixed head write on block insertion
2015-10-05 11:00:57 -07:00
Jeffrey Wilcke
20ab29f885 core: fixed head write on block insertion
Due to a rebase this probably got overlooked / ignored. This fixes the
issue of a block insertion never writing the last block.
2015-10-05 17:00:59 +02:00
Jeffrey Wilcke
5b34fa538e Merge pull request #1756 from obscuren/core-refactor
core, core/vm: refactor
2015-10-05 07:14:01 -07: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
Jeffrey Wilcke
f7a71996fb core, event/filter, xeth: refactored filter system
Moved the filtering system from `event` to `eth/filters` package and
removed the `core.Filter` object. The `filters.Filter` object now
requires a `common.Database` rather than a `eth.Backend` and invokes the
`core.GetBlockByX` directly rather than thru a "manager".
2015-10-02 22:47:43 +02:00
Jeffrey Wilcke
8b865fa9bf Merge pull request #1866 from karalabe/honor-eth-capabilities
eth/downloader: match capabilities when querying idle peers
2015-10-02 03:49:56 -07:00
Jeffrey Wilcke
0d78f96205 Merge pull request #1865 from obscuren/deadlock-chainmanager-fix
core: deadlock in chainmanager after posting RemovedTransactionEvent
2015-10-02 03:39:43 -07:00
Péter Szilágyi
47f62a67aa eth/downloader: match capabilities when querying idle peers 2015-10-02 13:20:41 +03:00
Jeffrey Wilcke
a6cc02f68f core: deadlock in chainmanager after posting RemovedTransactionEvent
This PR solves an issue with the chain manager posting a
`RemovedTransactionEvent`, the tx pool will try to
acquire the chainmanager lock which has previously been locked prior to
posting `RemovedTransactionEvent`. This results in a deadlock in the
core.
2015-10-02 12:20:18 +02:00
Jeffrey Wilcke
49ae538506 Merge pull request #1405 from fjl/lean-trie
core, trie: new trie
2015-10-01 04:34:38 -07:00
Jeffrey Wilcke
581c0901af Merge pull request #1856 from karalabe/andorid-path-fix
common: fix #1818, secondary datadir paths to fall back to
2015-10-01 04:03:04 -07:00
Péter Szilágyi
74578ab22b common: fix #1818, secondary datadir paths to fall back to 2015-10-01 12:26:19 +03:00
Jeffrey Wilcke
e3ac56d502 Merge pull request #1859 from fjl/fix-discover-refresh-race
p2p/discover: fix race involving the seed node iterator
2015-09-30 08:21:40 -07:00
Felix Lange
32dda97602 p2p/discover: ignore packet version numbers
The strict matching can get in the way of protocol upgrades.
2015-09-30 16:23:03 +02:00
Felix Lange
631bf36102 p2p/discover: remove unused lastLookup field 2015-09-30 16:23:03 +02:00
Felix Lange
b4374436f3 p2p/discover: fix race involving the seed node iterator
nodeDB.querySeeds was not safe for concurrent use but could be called
concurrenty on multiple goroutines in the following case:

- the table was empty
- a timed refresh started
- a lookup was started and initiated refresh

These conditions are unlikely to coincide during normal use, but are
much more likely to occur all at once when the user's machine just woke
from sleep. The root cause of the issue is that querySeeds reused the
same leveldb iterator until it was exhausted.

This commit moves the refresh scheduling logic into its own goroutine
(so only one refresh is ever active) and changes querySeeds to not use
a persistent iterator. The seed node selection is now more random and
ignores nodes that have not been contacted in the last 5 days.
2015-09-30 16:23:03 +02:00
Jeffrey Wilcke
46ad5a5f5b Merge pull request #1852 from obscuren/filter-nil-fix
xeth: fixed nil pointer of filter retrieval
2015-09-30 03:06:36 -07:00
Jeffrey Wilcke
9b94076717 Merge pull request #1854 from karalabe/badhasherror-formatting-loop
core: fix a formatting loop in BadHashError
2015-09-29 02:26:01 -07:00
Péter Szilágyi
b8b996be74 core: fix a formatting loop in BadHashError 2015-09-29 09:11:38 +03:00
Gustav Simonsson
1d20b0247c Update libsecp256k1 2015-09-28 17:46:38 +02:00
Jeffrey Wilcke
b9359981f4 xeth: fixed nil pointer of filter retrieval
This fix addresses an issue with filters that were (possibly) not yet
added to the filter queues but were expected. I've added additional nil
checks making sure it doesn't crash and swapped the installation of the
filter around so it's installed before use.

Closes #1665
2015-09-25 13:56:53 +02:00
Jeffrey Wilcke
7977e87ce1 Merge pull request #1843 from karalabe/cleanup-downloader-channel
eth/downloader: always send termination wakes, clean leftover
2015-09-25 04:34:59 -07:00
Bas van Kervel
8636f0e1c3 console/history respect datadir 2015-09-25 13:08:48 +02:00
Péter Szilágyi
830ddcee60 core: fix #1848, block receipts db entry for the genesis too 2015-09-24 19:38:59 +03:00
Jeffrey Wilcke
69d86442a5 Merge pull request #1803 from Gustav-Simonsson/badhashes
core: Add BadHashErr and test for BadHashes handling
2015-09-23 11:10:25 -07:00
Jeffrey Wilcke
36f46a61a7 Merge pull request #1844 from obscuren/version-file
VERSION: added version
2015-09-23 05:48:00 -07:00
Jeffrey Wilcke
6e1dc321f4 VERSION: added version 2015-09-23 14:47:20 +02:00
Felix Lange
7a2a918067 Merge pull request #1842 from fjl/rpc-fix-unknown-block
rpc/api: don't crash for unknown blocks
2015-09-23 12:57:33 +02:00
Péter Szilágyi
f459a3f0ae eth/downloader: always send termination wakes, clean leftover 2015-09-23 12:39:17 +03:00
Jeffrey Wilcke
e456f27795 Merge pull request #1827 from Gustav-Simonsson/common_tests
tests: add test for StateTests/stCallCodes.json
2015-09-23 02:12:59 -07:00
Felix Lange
90cd8ae9f2 rpc/api: don't crash for unknown blocks
Most eth RPC calls that work with blocks crashed when the block was not
found because they called Hash on a nil block. This is a regression
introduced in cdc2662c40 (#1779).

While here, remove the insane conversions in get*CountBy*. There is no
need to construct a complete BlockRes and converting
int->int64->*big.Int->[]byte->hexnum->string to format the length of a
slice as hex.
2015-09-22 23:59:26 +02:00
Felix Lange
70b6174748 cmd/geth, core: make "geth blocktest" work again
The test genesis block was not written properly, block insertion failed
immediately.

While here, fix the panic when shutting down "geth blocktest" with
Ctrl+C. The signal handler is now installed automatically, causing
ethereum.Stop to crash because everything is already stopped.
2015-09-22 23:55:31 +02:00
Felix Lange
c1a352c108 trie: add merkle proof functions 2015-09-22 22:57:37 +02:00
Felix Lange
a2d5a60418 core, core/state: batch-based state sync 2015-09-22 22:57:37 +02:00
Felix Lange
565d9f2306 core, trie: new trie 2015-09-22 22:53:49 +02:00
Felix Lange
6b91a4abe5 trie: improve benchmarks 2015-09-22 22:49:27 +02:00
Gustav Simonsson
bfde1a4305 core: Add BadHashErr and test for BadHashes handling 2015-09-22 18:02:26 +02:00
Gustav Simonsson
3340b56593 crypto: correct sig validation, add more unit tests 2015-09-22 17:33:39 +02:00
Jeffrey Wilcke
e56cbc225e Merge pull request #1835 from karalabe/make-cross
makefile: built in cross compilation targets
2015-09-21 11:47:10 -07:00
Jeffrey Wilcke
7bf8e949e7 Merge pull request #1669 from obscuren/tx-pool-auto-resend
core, xeth: chain reorg move missing transactions to transaction pool
2015-09-21 11:45:59 -07:00
Péter Szilágyi
6a05c569f2 makefile: built in cross compilation targets 2015-09-21 21:36:01 +03:00
Jeffrey Wilcke
eaa4473dbd core, core/types: readd transactions after chain re-org
Added a `Difference` method to `types.Transactions` which sets the
receiver to the difference of a to b (NOTE: not a **and** b).

Transaction pool subscribes to RemovedTransactionEvent adding back to
those potential missing from the chain.

When a chain re-org occurs remove any transactions that were removed
from the canonical chain during the re-org as well as the receipts that
were generated in the process.

Closes #1746
2015-09-21 20:33:28 +02:00
Jeffrey Wilcke
be76a68aea cmd/geth: changed version number to 1.2.0
Changed the version number of geth to 1.2.0 so that dev builds are now properly build (instead of master). Note to self; increase version number to 1.2.1 for our next actual release.
2015-09-21 16:13:07 +02:00
Jeffrey Wilcke
12c0afe4fe Merge pull request #1822 from karalabe/contain-pow
core: separate and contain POW verifier, extensive tests
2015-09-21 06:52:11 -07:00
Gustav Simonsson
5621308949 tests: add test for StateTests/stCallCodes.json 2015-09-21 11:34:02 +02:00
Péter Szilágyi
399c920380 core: separate and contain POW verifier, extensive tests 2015-09-21 10:24:49 +03:00
Jeffrey Wilcke
e40b447fea Merge pull request #1814 from Gustav-Simonsson/common_tests
tests: update common test wrappers and test files
2015-09-18 16:34:54 -07:00