Commit Graph

45 Commits

Author SHA1 Message Date
Sai V c215989c10
Quorum geth upgrade to 1.9.7 (#960)
Co-authored-by: amalraj.manigmail.com <amalraj.manigmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Flash Sheridan <flash@pobox.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Nguyen Kien Trung <trung.n.k@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Rob Mulholand <rmulholand@8thlight.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: soc1c <soc1c@users.noreply.github.com>
Co-authored-by: Rafael Matias <rafael@skyle.net>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Lucas Hendren <lhendre2@gmail.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: ywzqwwt <39263032+ywzqwwt@users.noreply.github.com>
Co-authored-by: zcheng9 <zcheng9@hawk.iit.edu>
Co-authored-by: zzy96 <zhou0250@e.ntu.edu.sg>
Co-authored-by: kikilass <36239971+kikilass@users.noreply.github.com>
Co-authored-by: Darrel Herbst <dherbst@gmail.com>
Co-authored-by: Ross <9055337+Chadsr@users.noreply.github.com>
Co-authored-by: Jeffery Robert Walsh <rlxrlps@gmail.com>
Co-authored-by: Marius Kjærstad <sandakersmann@users.noreply.github.com>
Co-authored-by: Piotr Dyraga <piotr.dyraga@keep.network>
Co-authored-by: Guillaume Ballet <gballet@gmail.com>
Co-authored-by: Michael Forney <mforney@mforney.org>
Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
2020-04-29 10:50:56 -04:00
amalraj.manigmail.com 47571689ee Merge remote-tracking branch 'remotes/goeth/release/1.8' into geth-upgrade-1.8.15_new
# Conflicts:
#	.travis.yml
#	README.md
#	cmd/utils/flags.go
#	consensus/consensus.go
#	consensus/ethash/consensus.go
#	consensus/ethash/ethash.go
#	core/blockchain.go
#	core/genesis_test.go
#	core/state/state_object.go
#	core/state_processor.go
#	core/vm/errors.go
#	core/vm/evm.go
#	core/vm/gas_table.go
#	core/vm/instructions_test.go
#	core/vm/interface.go
#	eth/api_tracer.go
#	eth/backend.go
#	eth/config.go
#	eth/filters/filter.go
#	les/backend.go
#	les/helper_test.go
#	miner/worker.go
#	params/config.go
#	params/version.go
2018-10-04 16:19:02 +08:00
gary rong d6254f827b all: protect self-mined block during reorg (#17656) 2018-09-20 15:09:30 +03:00
Qvintvs 4b44bea1d7 Merge attempt 2018-05-31 14:16:44 +08:00
gary rong 7beccb29be all: get rid of error when creating memory database (#16716)
* all: get rid of error when create mdb

* core: clean up variables definition

* all: inline mdb definition
2018-05-09 15:24:25 +03:00
Péter Szilágyi 55599ee95d core, trie: intermediate mempool between trie and database (#15857)
This commit reduces database I/O by not writing every state trie to disk.
2018-02-05 17:40:32 +01:00
Péter Szilágyi 6f69cdd109
all: switch gas limits from big.Int to uint64 2018-01-03 14:45:35 +02:00
gary rong 5f8888e116 accounts, consensus, core, eth: make chain maker consensus agnostic (#15497)
* accounts, consensus, core, eth: make chain maker consensus agnostic

* consensus, core: move CalcDifficulty to Engine interface

* consensus: add docs for calcDifficulty function

* consensus, core: minor comment fixups
2017-12-22 14:37:50 +02:00
Patrick Mylund Nielsen 3d91976f08
Geth 1.7.2 rebase and addition of Istanbul BFT (#207) 2017-10-31 18:24:11 -04:00
Miya Chen bf1e263128 core, light: send chain events using event.Feed (#14865) 2017-08-18 12:58:36 +02:00
Péter Szilágyi 2b50367fe9
core: fix blockchain goroutine leaks in tests 2017-08-07 16:00:47 +03:00
Péter Szilágyi 09777952ee core, consensus: pluggable consensus engines (#3817)
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.
2017-04-05 00:16:29 +02:00
Felix Lange 37dd9086ec core: refactor genesis handling
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.
2017-03-23 15:58:43 +01:00
Péter Szilágyi 567d41d936 all: swap out the C++ ethash to the pure Go one (mining todo) 2017-03-09 15:50:14 +01:00
Jeffrey Wilcke c12f4df910 params: core, core/vm, miner: 64bit gas instructions
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
2017-02-13 21:44:25 +01:00
Jeffrey Wilcke 57f4e90257 Revert "params: core, core/vm, miner: 64bit gas instructions (#3514)"
This reverts commit 8b57c49490.
2017-02-13 15:15:12 +01:00
Jeffrey Wilcke 8b57c49490 params: core, core/vm, miner: 64bit gas instructions (#3514)
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
2017-02-02 15:25:42 +01:00
Nick Johnson 17d92233d9 cmd/geth, core: add support for recording SHA3 preimages (#3543) 2017-01-17 12:19:50 +01:00
Felix Lange e171bf74f8 core/types: remove redundant SignECDSA wrappers, rename to SignTx 2017-01-05 12:59:17 +01:00
Jeffrey Wilcke 4dca5d4db7 core/types, params: EIP#155 2016-11-13 14:55:30 +01:00
Jeffrey Wilcke 445feaeef5 core, core/state, trie: EIP158, reprice & skip empty account write
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>
2016-11-13 10:44:04 +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
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 3291235711 accounts, core, eth: pass chain config for chain maker to test DAO 2016-07-15 16:52:55 +03:00
Jeffrey Wilcke 9055c16efa accounts/a/b/backends, core: chain maker homestead block set to 0
The chain maker and the simulated backend now run with a homestead phase
beginning at block 0 (i.e. there's no frontier).

This commit also fixes up #2388
2016-04-01 01:01:10 +02:00
Jeffrey Wilcke f0cbebb19f core: added basic chain configuration
Added chain configuration options and write out during genesis database
insertion. If no "config" was found, nothing is written to the database.

Configurations are written on a per genesis base. This means
that any chain (which is identified by it's genesis hash) can have their
own chain settings.
2016-04-01 01:01:10 +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
Péter Szilágyi 832b37c822 core, eth: receipt chain reconstruction 2015-10-19 10:03:09 +03:00
Gustav Simonsson 1b1f293082 core/state, core, miner: handle missing root error from state.New 2015-10-16 02:22:06 +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 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 a23478c0be core, eth, trie, xeth: merged state, chain, extra databases in one 2015-08-07 22:29:02 +02:00
Jeffrey Wilcke 1fad8798ec Merge pull request #1515 from fjl/license-fixes
all: fix license headers one more time
2015-07-28 04:29:42 -07:00
Jeffrey Wilcke 665eaff9b9 Merge pull request #1520 from obscuren/reward-5eth
core: 5 ether block reward
2015-07-25 08:57:33 -07:00
Jeffrey Wilcke 9afda6ab8c core: 5 ether block reward 2015-07-25 17:47:20 +02:00
Jeffrey Wilcke 036e6301af cmd/geth, core, eth: Version 1.0.0
Genesis release. Closes #1402

Conflicts:
	cmd/geth/main.go
2015-07-25 13:55:56 +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
Jeffrey Wilcke a32c51effd cmd, core, eth, common: genesis preparation
Implemented the --genesis flag thru which we can set a custom genesis
block, including the official Ethereum genesis block.
2015-07-10 17:37:41 +02:00
Felix Lange ea54283b30 all: update license information 2015-07-07 14:12:44 +02:00
Jeffrey Wilcke 29e2fb38f8 core, miner: miner header validation, transaction & receipt writing
* Miners do now verify their own header, not their state.
* Changed old putTx and putReceipts to be exported
* Moved writing of transactions and receipts out of the block processer
  in to the chain manager. Closes #1386
* Miner post ChainHeadEvent & ChainEvent. Closes #1388
2015-07-03 13:56:50 +02:00
Jeffrey Wilcke e349fac97d core: fixed tests 2015-06-29 18:51:49 +02:00
Jeffrey Wilcke aba901e13c core: removed write's go routine 2015-06-29 18:51:49 +02:00
Felix Lange ceaf1c080b core: add GenerateChain, GenesisBlockForTesting 2015-06-29 18:51:47 +02:00