Commit Graph

7943 Commits

Author SHA1 Message Date
Jeffrey Wilcke 1ad23deb8e core, core/types: implemented private transaction check
Transactions are considered private when the V param is either 37 or 38.
2016-11-01 22:25:59 +01:00
Bas van Kervel fb486961d6 core, eth: add support for storage root retrieval for accounts 2016-11-01 17:33:56 +01:00
Jeffrey Wilcke e7815c59f0 core: identify private transactions 2016-11-01 12:57:26 +01:00
Jeffrey Wilcke 763f939f47 core, core/vm: dual state & read only EVM
This commit implements a dual state approach. The dual state approach
separates public and private state by making the core vm environment
context aware.

Although not currently implemented it will need to prohibit value
transfers and it must initialise all transactions from accounts on the
public state. This means that sending transactions increments the
account nonce on the public state and contract addresses are derived
from the public state when initialised by a transaction. For obvious
reasons, contract created by private contracts are still derived from
public state.

This is required in order to have consensus over the public state at all
times as non-private participants would still process the transaction on
the public state even though private payload can not be decrypted. This
means that participants of a private group must do the same in order to
have public consensus. However the creation of the contract and
interaction still occurs on the private state.

It implements support for the following calling model:

S: sender, (X): private, X: public, ->: direction, [ ]: read only mode

1. S -> A -> B
2. S -> (A) -> (B)
3. S -> (A) -> [ B -> C ]

It does not support

1. (S) -> A
2. (S) -> (A)
3. S -> (A) -> B

Implemented "read only" mode for the EVM. Read only mode is checked
during any opcode that could potentially modify the state. If such an
opcode is encountered during "read only", it throws an exception.

The EVM is flagged "read only" when a private contract calls in to
public state.
2016-11-01 12:57:26 +01:00
Bas van Kervel f7cb85824c quorum integration 2016-10-30 09:20:48 +01:00
Péter Szilágyi 63d293cdbe Merge pull request #3195 from karalabe/fix-testnet-fastsync
cmd/utils, core, params: explicitly pick reprice fork for fast sync
2016-10-29 17:21:26 +03:00
Péter Szilágyi f0dbec0c93
cmd, params: only set default fork configs for test and mainnet 2016-10-29 17:07:07 +03:00
gluk256 79789af2e7 whisper: project restructured, version 5 introduced (#3022)
whisper: project restructured, version 5 introduced

This commits adds a draft version of the new shh v5 protocol.
The new version is not on by default, --shh still selects version 2.
2016-10-29 14:11:37 +02:00
Péter Szilágyi 8639b0fae9
cmd/utils, core, params: explicitly pick reprice fork for fast sync 2016-10-29 12:10:00 +03:00
Nick Johnson 00665a0b72 cmd/evm: Allow stdin and files as sources of bytecode (#3172)
* cmd/evm: Allow stdin and files as sources of bytecode

* cmd/evm: Print and exit instead of panicing

* cmd/evm: fix compile and vet errors
2016-10-29 12:07:38 +03:00
bas-vk b59c8399fb internal/ethapi: add personal_sign and fix eth_sign to hash message (#2940)
This commit includes several API changes:

- The behavior of eth_sign is changed. It now accepts an arbitrary
  message, prepends the well-known string

        \x19Ethereum Signed Message:\n<length of message>

  hashes the result using keccak256 and calculates the signature of
  the hash. This breaks backwards compatability!
  
- personal_sign(hash, address [, password]) is added. It has the same
  semantics as eth_sign but also accepts a password. The private key
  used to sign the hash is temporarily unlocked in the scope of the
  request.
  
- personal_recover(message, signature) is added and returns the
  address for the account that created a signature.
2016-10-28 21:25:49 +02:00
Péter Szilágyi 289b30715d Godeps, vendor: convert dependency management to trash (#3198)
This commit converts the dependency management from Godeps to the vendor
folder, also switching the tool from godep to trash. Since the upstream tool
lacks a few features proposed via a few PRs, until those PRs are merged in
(if), use github.com/karalabe/trash.

You can update dependencies via trash --update.

All dependencies have been updated to their latest version.

Parts of the build system are reworked to drop old notions of Godeps and
invocation of the go vet command so that it doesn't run against the vendor
folder, as that will just blow up during vetting.

The conversion drops OpenCL (and hence GPU mining support) from ethash and our
codebase. The short reasoning is that there's noone to maintain and having
opencl libs in our deps messes up builds as go install ./... tries to build
them, failing with unsatisfied link errors for the C OpenCL deps.

golang.org/x/net/context is not vendored in. We expect it to be fetched by the
user (i.e. using go get). To keep ci.go builds reproducible the package is
"vendored" in build/_vendor.
2016-10-28 19:05:01 +02:00
Steven Roose 7770304576 ethclient: changed TransactionByHash to only pass one argument to api method (#3209)
Fixes #3203
2016-10-27 23:10:24 +02:00
Péter Szilágyi 890ffa05f8 Merge pull request #3189 from fjl/leveldb-update
Update goleveldb, add debug.chaindbCompact
2016-10-21 19:14:11 +03:00
Hao Bryan Cheng 89014b4524 core/vm: Ignore EnableJit ChainConfig setting (#3166) 2016-10-21 17:35:03 +02:00
Péter Szilágyi f8608a5228 trie: while fast syncing, don't keep trie nodes in memory (#3186) 2016-10-21 17:34:17 +02:00
Péter Szilágyi 437c1e40b2 Merge pull request #3185 from karalabe/fix-log-race
eth/downloader: fix a data race in a log output
2016-10-21 13:25:38 +03:00
Péter Szilágyi 53db80da89
eth/downloader: fix a data race in a log output 2016-10-21 13:09:27 +03:00
Péter Szilágyi 28cc3cc960 Merge pull request #3184 from karalabe/import-gas-use
cmd/geth, code, eth/downloader: tune import logs and mem stats
2016-10-21 12:37:59 +03:00
Péter Szilágyi 1291778032
cmd/geth, code, eth/downloader: tune import logs and mem stats 2016-10-21 12:23:39 +03:00
Felix Lange b930baa580 Godeps: update github.com/syndtr/goleveldb to 6b4daa5362 2016-10-20 14:56:34 +02:00
Felix Lange 66ee2dec53 internal/ethapi: add debug.chaindbCompact 2016-10-20 14:37:01 +02:00
Péter Szilágyi f2ae2f7eef Merge pull request #3176 from karalabe/trie-stats-report
cmd/geth, trie: report on trie cache unloads, also add debug log
2016-10-19 17:35:58 +03:00
Péter Szilágyi 88a593d559
cmd/geth, trie: report on trie cache unloads, also add debug log 2016-10-19 17:31:19 +03:00
Felix Lange 5d9bb0a050 trie: add metric to track cache unloading (#3175) 2016-10-19 16:07:19 +02:00
Péter Szilágyi 8048f4d4f6 Merge pull request #3173 from karalabe/parametrized-trie-cache-get
cmd, core/state: allow configurable trie cache generations
2016-10-19 16:42:54 +03:00
Felix Lange d48e6ae66f trie: make the cache miss counter a real metric 2016-10-19 15:22:37 +02:00
Péter Szilágyi 4f46bd19d0
cmd, core/state: allow configurable trie cache generations 2016-10-19 14:55:13 +03:00
Jeffrey Wilcke ca49510e6d Merge pull request #3168 from benjaminbrent/develop
core/vm: fix GASPRICE string (resolves #2553)
2016-10-19 13:36:13 +02:00
Jeffrey Wilcke 25ac04a444 Merge pull request #3153 from fjl/trie-unload-fix
trie: improve cache unloading mechanism
2016-10-19 13:35:49 +02:00
Péter Szilágyi 8e52c2e754 Merge pull request #3161 from karalabe/trie-cache-counters
cmd/geth, trie: track and report trie cache misses
2016-10-19 14:29:24 +03:00
Péter Szilágyi 2bb5ec1e41
cmd/geth, trie: track and report trie cache misses 2016-10-19 14:12:35 +03:00
Benjamin Brent 55522373fd core/vm: fix GASPRICE string (resolves #2553) 2016-10-19 15:55:34 +11:00
Nick Johnson c9471e7782 miner: copy pending state before handing it to callers (#3162)
The pending state was not copied while not mining, leading to a data race.
2016-10-18 22:34:37 +02:00
Jeffrey Wilcke 5b262ff5ab Merge pull request #3156 from holiman/metrics-blocks
core: Add block processing time metric collection
2016-10-18 13:26:31 +02:00
Péter Szilágyi e8d0538a00 Merge pull request #3160 from karalabe/import-database-stats
cmd/geth: compact and print database stats after an import
2016-10-18 14:09:02 +03:00
Péter Szilágyi a1c63e8be6
cmd/geth: compact and print database stats after an import 2016-10-18 13:45:16 +03:00
Péter Szilágyi a64b1b4375 Merge pull request #3158 from karalabe/pretty-print-imports
common, core, eth/downloader: adjust import log formatting
2016-10-18 13:29:06 +03:00
Péter Szilágyi 64500ab0fa
common, core, eth/downloader: adjust import log formatting 2016-10-18 13:16:36 +03:00
Martin Holst Swende 00b853418e core: Add block processing time metric collection 2016-10-18 09:29:50 +02:00
Felix Lange 8d56bf5ceb trie: ensure dirty flag is unset for embedded child nodes
This was caught by the new invariant check.
2016-10-18 04:57:47 +02:00
Felix Lange 44f419ec0f core/state: bump trie cache values slightly 2016-10-18 04:57:47 +02:00
Felix Lange 177cab5fe7 trie: ensure resolved nodes stay loaded
Commit 40cdcf1183 broke the optimisation which kept nodes resolved
during Get in the trie. The decoder assigned cache generation 0
unconditionally, causing resolved nodes to get flushed on Commit.

This commit fixes it and adds two tests.
2016-10-18 04:57:47 +02:00
Felix Lange 187d6a66a5 trie: avoid loading the root node twice
New checks whether the root node is present by loading it from the
database. Keep the node around instead of discarding it.
2016-10-18 04:57:47 +02:00
Felix Lange 6952fe3a5c Merge pull request #3100 from kobigurk/develop
internal/ethapi, internal/web3ext: adds raw tx retrieval methods
2016-10-17 16:55:28 +02:00
Péter Szilágyi b19b7c39ac Merge pull request #3142 from fjl/trie-sync-fix
trie: fix regression that linked all downloaded nodes together
2016-10-15 10:58:54 +03:00
Jeffrey Wilcke 9276c4e163 Merge pull request #3141 from obscuren/reprice-block-number
params: set reprice block number to 2463000
2016-10-15 00:50:45 +02:00
Felix Lange 2cd7a0395d trie: fix regression that linked all downloaded nodes together
The trie sync code links subtries using pointers into node structs.
Since commit 40cdcf1183 nodes are no longer copied when unpacking from
an interface value, causing all nodes to get linked up as the sync
progresses. Fix it by breaking the pointer chain with an explicit copy.
2016-10-15 00:42:52 +02:00
Jeffrey Wilcke f2be249385 params: set reprice block number to 2463000 2016-10-15 00:36:49 +02:00
Péter Szilágyi 81b01f1c2b Merge pull request #3111 from obscuren/gas-price-fork
core, core/vm: added gas price variance table (EIP #150)
2016-10-14 19:32:11 +03:00