Commit Graph

803 Commits

Author SHA1 Message Date
vsmk98 4e3c907531 additionla log messages for permissioning 2018-07-31 01:42:51 +00:00
Qvintvs a67eccbcd8 debug tests 2018-06-01 12:51:35 +08:00
Qvintvs 622e98ad51 debug merge attempt 2018-05-31 14:21:16 +08:00
Qvintvs 4b44bea1d7 Merge attempt 2018-05-31 14:16:44 +08:00
Jim Zhang 51274bd368 reformatted with 'gofmt' 2018-04-19 15:02:05 -04:00
Jim Zhang c535103027 Addressing Sam's comment in the PR: make the FullFake engine the default so other test/fake flavors can still be used 2018-04-18 17:49:31 -04:00
Jim Zhang 2e19f7905d Disable ethash by replacing with ethash.NewFullFake 2018-03-18 22:48:07 -04:00
Patrick Mylund Nielsen bbc8e726e5
Merge pull request #270 from getamis/feature/update_istanbul
consensus, core, eth, miner, params: update istanbul engine
2018-02-27 20:57:21 -05:00
Joel Burget 85f1bc2998 Add missing private bloom setting / checking. 2018-02-15 16:41:57 -05:00
mark.lin 9ac24f9aaa consensus, core, eth, miner, params: update istanbul engine 2018-01-31 10:27:08 +08:00
Steven Roose 8b3f7906f9 Remove unused raftHasNoPending 2017-12-18 12:09:54 +01:00
Brian Schroeder 0905eda48e Re-add GPO creation in backend
Clique consensus requires a GPO to function.
2017-11-16 09:35:20 -05:00
Patrick Mylund Nielsen 3d91976f08
Geth 1.7.2 rebase and addition of Istanbul BFT (#207) 2017-10-31 18:24:11 -04:00
Steven Roose 3089a92337 Use latest block when pending is indicated with RAFT (#181) 2017-09-18 22:57:55 -04:00
Brian Schroeder 5dfdecef4c Dynamic raft membership support (#130) 2017-08-28 17:43:44 -04:00
Joel Burget 852ac74467 Raft updates (#104)
* Move raft checkpoint logging to logger package.

This allows us to use it everywhere and turn it on / off from command
flags.

* Return an error when the pending block is requested in Raft mode.
2017-05-04 16:49:48 -04:00
Joel Burget b6286320ef Add Raft-based consensus (#79)
This was implemented by Joel Burget (@joelburget) and Brian Schroeder (@bts).
2017-03-23 13:41:02 -05:00
Jeffrey Wilcke 9d5d5dd3e5 core, eth: support private state log and bloom filtering 2017-02-16 11:17:29 +01:00
Guilherme Salgado 566a72744a Check that msg.To() is not nil in GetVMEnv
Otherwise it will panic when msg is creating a contract.

Closes: #50
2017-02-10 14:54:43 +01:00
Sudhir Upadhyay 5806b453a9 implemented node permissioning 2016-11-17 18:50:28 -05:00
Bas van Kervel 2ea7af01c4 core: check private state for to existance first 2016-11-17 15:06:32 +01:00
Patrick Mylund Nielsen eed0947154 GetVMEnv fix 2016-11-16 18:36:12 -05:00
Bas van Kervel c371524cbb eth: look in private an public state on reading state data 2016-11-16 18:51:06 +01:00
Bas van Kervel 9bb4635f70 cmd,eth enforce gas price of 0 2016-11-15 18:40:08 +01:00
Bas van Kervel d3a871c2f4 core,eth: support calling public accounts 2016-11-03 09:51:01 +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 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 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
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 1291778032
cmd/geth, code, eth/downloader: tune import logs and mem stats 2016-10-21 12:23:39 +03:00
Péter Szilágyi 64500ab0fa
common, core, eth/downloader: adjust import log formatting 2016-10-18 13:16:36 +03:00
Felix Lange 40cdcf1183 trie, core/state: improve memory usage and performance (#3135)
* trie: store nodes as pointers

This avoids memory copies when unwrapping node interface values.

name      old time/op  new time/op  delta
Get        388ns ± 8%   215ns ± 2%  -44.56%  (p=0.000 n=15+15)
GetDB      363ns ± 3%   202ns ± 2%  -44.21%  (p=0.000 n=15+15)
UpdateBE  1.57µs ± 2%  1.29µs ± 3%  -17.80%  (p=0.000 n=13+15)
UpdateLE  1.92µs ± 2%  1.61µs ± 2%  -16.25%  (p=0.000 n=14+14)
HashBE    2.16µs ± 6%  2.18µs ± 6%     ~     (p=0.436 n=15+15)
HashLE    7.43µs ± 3%  7.21µs ± 3%   -2.96%  (p=0.000 n=15+13)

* trie: close temporary databases in GetDB benchmark

* trie: don't keep []byte from DB load around

Nodes decoded from a DB load kept hashes and values as sub-slices of
the DB value. This can be a problem because loading from leveldb often
returns []byte with a cap that's larger than necessary, increasing
memory usage.

* trie: unload old cached nodes

* trie, core/state: use cache unloading for account trie

* trie: use explicit private flags (fixes Go 1.5 reflection issue).

* trie: fixup cachegen overflow at request of nick

* core/state: rename journal size constant
2016-10-14 19:04:33 +03:00
Felix Lange 82b14a05f2 eth: move "timed out DAO fork check, dropping" to debug level 2016-10-07 21:03:38 +02:00
Jeffrey Wilcke 7335a70a02 Merge pull request #3092 from fjl/state-journal
core/state: implement reverts by journaling all changes
2016-10-06 16:14:22 +02:00
Felix Lange 1f1ea18b54 core/state: implement reverts by journaling all changes
This commit replaces the deep-copy based state revert mechanism with a
linear complexity journal. This commit also hides several internal
StateDB methods to limit the number of ways in which calling code can
use the journal incorrectly.

As usual consultation and bug fixes to the initial implementation were
provided by @karalabe, @obscuren and @Arachnid. Thank you!
2016-10-06 15:32:16 +02:00
Péter Szilágyi e482b5694f eth: monitor malicious header retrieval requests 2016-10-05 16:34:07 +03:00
Péter Szilágyi 710435b51b core, eth, trie: reuse trie journals in all our code 2016-09-28 11:27:31 +03:00
Felix Lange a59a93f476 core/state: track all accounts in canon state
This change introduces a global, per-state cache that keeps account data
in the canon state. Thanks to @karalabe for lots of fixes.
2016-09-26 10:09:52 +02:00
Péter Szilágyi 30860491ba cmd, eth: drop the blockchain version from cli/eth configs 2016-09-15 14:09:47 +03:00
Péter Szilágyi 2924fdfcf7 ethereum, ethclient: add SyncProgress API endpoint 2016-09-06 13:41:43 +03:00
Péter Szilágyi 0ef327bbee core, eth, internal, miner: optimize txpool for quick ops 2016-09-02 14:12:03 +03:00
Péter Szilágyi 795b70423e core, eth, miner: only retain 1 tx/nonce, remove bad ones 2016-09-02 14:12:03 +03:00
Felix Lange d62d5fe59a accounts/abi/bind: use ethereum interfaces
In this commit, contract bindings and their backend start using the
Ethereum Go API interfaces offered by ethclient. This makes ethclient a
suitable replacement for the old remote backend and gets us one step
closer to the final stable Go API that is planned for go-ethereum 1.5.

The changes in detail:

* Pending state is optional for read only contract bindings.
  BoundContract attempts to discover the Pending* methods via an
  interface assertion. There are a couple of advantages to this:
  ContractCaller is just two methods and can be implemented on top of
  pretty much anything that provides Ethereum data. Since the backend
  interfaces are now disjoint, ContractBackend can simply be declared as
  a union of the reader and writer side.

* Caching of HasCode is removed. The caching could go wrong in case of
  chain reorganisations and removing it simplifies the code a lot.
  We'll figure out a performant way of providing ErrNoCode before the
  1.5 release.

* BoundContract now ensures that the backend receives a non-nil context
  with every call.
2016-08-22 14:01:28 +02:00
Felix Lange 0c9a858f2d eth: don't call ValidateFields
ValidateFields was introduced before the rlp decoder disallowed nil
values. Decoding RLP will never return nil values, there is no need
to check for them.
2016-08-04 03:30:05 +02:00
Stein Dekker 4ce83bf57b eth/fetcher: small typo fix (#2932) 2016-08-23 18:23:34 +03:00
Nick Johnson 2f99720901 core/vm, eth: Add support for javascript trace functions 2016-08-23 15:06:39 +01:00
Péter Szilágyi f81cff539a Merge pull request #2923 from Arachnid/tracing
core: Refactor tracing to make Tracer the main interface
2016-08-22 12:31:47 +03:00
Nick Johnson 781915f183 core/vm: Refactor tracing to make Tracer the main interface
This CL makes several refactors:
 - Define a Tracer interface, implementing the `CaptureState` method
 - Add the VM environment as the first argument of
   `Tracer.CaptureState`
 - Rename existing functionality `StructLogger` an make it an
   implementation of `Tracer`
 - Delete `StructLogCollector` and make `StructLogger` collect the logs
   directly
 - Change all callers to use the new `StructLogger` where necessary and
   extract logs from that.
 - Deletes the apparently obsolete and likely nonfunctional 'TraceCall'
   from the eth API.

Callers that only wish accumulated logs can use the `StructLogger`
implementation straightforwardly. Callers that wish to efficiently
capture VM traces and operate on them without excessive copying can now
implement the `Tracer` interface to receive VM state at each step and
do with it as they wish.

This CL also removes the accumulation of logs from the vm.Environment;
this was necessary as part of the refactor, but also simplifies it by
removing a responsibility that doesn't directly belong to the
Environment.
2016-08-22 09:26:15 +01:00
Péter Szilágyi 454dc9b7c2 eth/fetcher: fix a log message formatting issue 2016-08-19 14:04:03 +03:00