Commit Graph

812 Commits

Author SHA1 Message Date
Gustav Simonsson 42e4e18667 [release 1.4.12] core: short-circuit balance change if zero value
(cherry picked from commit 25ed5fedda)
2016-09-26 08:49:59 +03:00
Nick Johnson e44b2dc881 [release 1.4.12] core/state: Fix memory expansion bug by not copying clean objects
(cherry picked from commit 581b320b9d)
2016-09-19 04:23:36 +03:00
Bas van Kervel c4ed34f008 [release/1.4.11] core: ensure the canonical block is written before the canonical hash is set
(cherry picked from commit bb8059f6aa)

Conflicts:
	core/blockchain.go
	core/database_util.go
	core/headerchain.go
	eth/filters/filter.go
2016-08-18 15:25:16 +02:00
Felix Lange d1696dbf07 [release/1.4.11] core/vm: hide ecrecover error message
Fixes #2825

(cherry picked from commit e4736fe469)
2016-08-18 15:01:23 +02:00
Péter Szilágyi 1b2941cd56 [release/1.4.10] cmd, core, eth, miner, params, tests: finalize the DAO fork
(cherry picked from commit 2c2e389b77)
2016-07-16 14:30:07 +03:00
Péter Szilágyi b8c0883770 [release/1.4.10] accounts, core, eth: pass chain config for chain maker to test DAO
(cherry picked from commit 3291235711)
2016-07-16 14:30:05 +03:00
Péter Szilágyi 14bad7e212 [release/1.4.10] core, params, tests: add DAO hard-fork balance moves
(cherry picked from commit 461cdb593b)
2016-07-16 14:30:03 +03:00
Péter Szilágyi 8c20fe17bd [release/1.4.10] core, eth: enforce network split post DAO hard-fork
(cherry picked from commit 7f00e8c033)
2016-07-16 14:30:00 +03:00
Péter Szilágyi a0cc73a27a [release/1.4.10] cmd, core, miner: add extradata validation to consensus rules
(cherry picked from commit a87089fd2d)
2016-07-16 14:29:59 +03:00
Péter Szilágyi 5c3051e6fa [release/1.4.10] core: gracefully handle missing homestead block config
(cherry picked from commit 9e56811a37)
2016-07-16 14:29:54 +03:00
Péter Szilágyi 3dd46bc884 [release/1.4.10] cmd, core, eth, params: implement flags to control dao fork blocks
(cherry picked from commit 6060e098c9)
2016-07-16 14:29:52 +03:00
Péter Szilágyi da776556d0 [release/1.4.10] core: solve a remote-import/local-mine data race
(cherry picked from commit f5a29eab5c)
2016-07-16 14:29:41 +03:00
Péter Szilágyi adb065a328 [release/1.4.9] Revert "test, cmd/evm, core, core/vm: illegal code hash implementation"
This reverts commit a9c94cbf48.
2016-06-29 11:53:41 +03:00
Péter Szilágyi c793cb3385 [release/1.4.9] Revert "core: add voting and result tracking for the dao soft-fork"
This reverts commit f31a3a251a.
2016-06-29 11:53:23 +03:00
Péter Szilágyi 3eef19598e [release/1.4.9] Revert "core: update DAO soft-fork number, clean up the code"
This reverts commit aefffc9ed8.
2016-06-29 11:53:06 +03:00
Péter Szilágyi f4aebd4c8d [release/1.4.9] Revert "core: update the DAO soft fork proposal to the final block"
This reverts commit b170a80cdc.
2016-06-29 11:52:05 +03:00
Péter Szilágyi b170a80cdc [release/1.4.8] core: update the DAO soft fork proposal to the final block
(cherry picked from commit 1e3a7d4fab)
2016-06-24 16:20:36 +03:00
Péter Szilágyi aefffc9ed8 [release/1.4.8] core: update DAO soft-fork number, clean up the code
(cherry picked from commit ba784bdf36)
2016-06-24 13:18:31 +03:00
Péter Szilágyi f31a3a251a [release/1.4.8] core: add voting and result tracking for the dao soft-fork
(cherry picked from commit c4de28938f)
2016-06-24 13:18:28 +03:00
Jeffrey Wilcke a9c94cbf48 [release/1.4.8] test, cmd/evm, core, core/vm: illegal code hash implementation
This implements a generic approach to enabling soft forks by allowing
anyone to put in hashes of contracts that should not be interacted from.
This will help "The DAO" in their endevour to stop any whithdrawals from
any DAO contract by convincing the mining community to accept their code
hash.

(cherry picked from commit 7a5b571c67)
2016-06-24 13:18:25 +03:00
Jeffrey Wilcke f7fdfa4eac [release/1.4.7] core/state, eth: Updated suicides objects when tracing transactions
Consensus rules dictate that objects can only be removed during the
finalisation of the transaction (i.e. after all calls have finished).
Thus calling a suicided contract twice from the same transaction:
A->B(S)->ret(A)->B(S) results in 2 suicides. Calling the suicided
object twice from two transactions: A->B(S), A->B, results in only one
suicide and a call to an empty object.

Our current debug tracing functionality replays all transaction that
were executed prior to the targetted transaction in order to provide
the user with an accurate trace.

As a side effect to calling StateDB.IntermediateRoot it also deletes any
suicides objects. Our tracing code never calls this function because it
isn't interested in the intermediate root. Becasue of this it caused a
bug in the tracing code where transactions that were send to priviously
deleted objects resulted in two suicides rather than one suicide and a
call to an empty object.

Fixes #2542

(cherry picked from commit bb3651abc8)
2016-06-14 17:12:05 +03:00
Felix Lange 44b912ec64 [release/1.4.6] core: add missing lock in TxPool.{GetTransaction,RemoveTx}
Fixes #2650

(cherry picked from commit fc85dd175e)
2016-06-06 16:22:00 +03:00
Péter Szilágyi af53767e16 [release/1.4.6] core, core/state, trie: enterprise hand-tuned multi-level caching
(cherry picked from commit 748d1c171d)
2016-06-06 16:21:39 +03:00
Péter Szilágyi 7632acf6b4 [release/1.4.6] core/state: return the starting nonce for non-existent accs (testnet)
(cherry picked from commit 8ee84584a4)
2016-06-06 16:21:37 +03:00
Felix Lange 9ccb70da7b [release/1.4.6] eth: enable bad block reports
We used to have reporting of bad blocks, but it was disabled
before the Frontier release. We need it back because users
are usually unable to provide the full RLP data of a bad
block when it occurs.

A shortcoming of this particular implementation is that the
origin peer is not tracked for blocks received during eth/63
sync. No origin peer info is still better than no report at
all though.

(cherry picked from commit ca18202eb9)
2016-06-06 16:21:34 +03:00
Fabio Berger 8d2775e3d7 [release/1.4.6] core: Simplify bloom9 tests with available convenience method `TestBytes`
(cherry picked from commit faf663133b)
2016-06-06 16:21:07 +03:00
Jeffrey Wilcke aa18aad7ad [release/1.4.4] core: fixed pointer assignment
This fixes an issue where it's theoretical possible to cause a consensus
failure when hitting the lower end of the difficulty, though pratically
impossible it's worth a fix.
2016-05-12 17:31:57 +02:00
Felix Lange 56ed6152a1 core, eth, miner: improve shutdown synchronisation
Shutting down geth prints hundreds of annoying error messages in some
cases. The errors appear because the Stop method of eth.ProtocolManager,
miner.Miner and core.TxPool is asynchronous. Left over peer sessions
generate events which are processed after Stop even though the database
has already been closed.

The fix is to make Stop synchronous using sync.WaitGroup.

For eth.ProtocolManager, in order to make use of WaitGroup safe, we need
a way to stop new peer sessions from being added while waiting on the
WaitGroup. The eth protocol Run function now selects on a signaling
channel and adds to the WaitGroup only if ProtocolManager is not
shutting down.

For miner.worker and core.TxPool the number of goroutines is static,
WaitGroup can be used in the usual way without additional
synchronisation.
2016-05-09 13:03:08 +02:00
Nicholas Johnson c74a575725 core: Provide a public accessor for ChainConfig
This is necessary for external users of the go-ethereum code who want to, for instance, build a custom node that plays back transactions, as core.ApplyTransaction requires a ChainConfig as a parameter.
2016-04-29 12:42:03 +01:00
Jeffrey Wilcke c1a4dcfc87 core, eth: added json tag field for proper unmarshalling
According to our own instructions the genesis config attribute should be
"config". The genesis definition in the go code, however, has a field
called `ChainConfig`. This field now has a `json:"config"` struct tag so
that the json is properly unmarshalled.

This fixes #2482
2016-04-25 12:48:31 +02:00
Felix Lange 6fdd0893c3 all: fix go vet warnings 2016-04-15 11:17:27 +02:00
Felix Lange 68c755a238 core/state: fix TestDump
Lazy "I'll just put return here instead of fixing the test" found by go vet.
2016-04-15 11:16:56 +02:00
Felix Lange 24cdac41f3 core, core/types, eth: add and use Block.Body
This fixes a few uses of unkeyed Body literals which go vet was
complaining about.
2016-04-15 10:57:37 +02:00
Felix Lange d04a2e7557 all: update license information 2016-04-15 09:48:05 +02:00
Péter Szilágyi e9254bb0f9 core, miner: remove Frontier canary 2016-04-04 13:18:34 +03:00
Jeffrey Wilcke 1f3596c25a core: transition db now also returns the required gas amount
Exposes some core methods to transition and compute new state
information and adds an additional return value to the transition db
method to fetch required gas for that particular message (excluding gas
refunds from any SSTORE[X] = 0 and SUICIDE.

Fixes #2395
2016-04-01 01:01:10 +02: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 0cfa21fc7f core, eth, cmd: temporary work around for enabling the jit
This commit serves as a temporary workaround for enabling the jit until
the block customisation PR is merged in.
2016-03-23 23:02:44 +01:00
Jeffrey Wilcke 14013372ae core: Added EVM configuration options
The EVM is now initialised with an additional configured object that
allows you to turn on debugging options.
2016-03-23 23:02:42 +01:00
Jeffrey Wilcke 342ae7ce7d core, core/vm, tests: changed the initialisation behaviour of the EVM
The EVM was previously initialised and created for every CALL, CALLCODE,
DELEGATECALL and CREATE. This PR changes this behaviour so that the same
EVM can be used through the session and beyond as long as the
Environment sticks around.
2016-03-23 00:04:00 +01:00
Péter Szilágyi 2855a93ede Merge pull request #2341 from leijurv/patch-2
core: fixed various typos
2016-03-16 11:22:33 +02:00
Leif Jurvetson 434e4b31d8 core, eth: replace reorganiz with reorganis 2016-03-15 12:03:17 -07:00
Leif Jurvetson b7bb2d8589 core: various typos 2016-03-15 11:08:18 -07:00
Leif Jurvetson c7727191ae core: fixed various typos 2016-03-15 09:12:03 -07:00
Jeffrey Wilcke 8a3ce5450a Merge pull request #2311 from obscuren/future-proc-fix
core: added future proc mutex lock
2016-03-11 18:26:57 +01:00
Jeffrey Wilcke 558d18d2b0 core: added future proc mutex lock
Added a future lock which prevents the anything being added or removed
from or to the set when looping over the set of blocks. This fixes a nil
pointer in the range loop when trying to retrieve a block from the set
which was previously available but removed due to regular chain
processing.

Fixes #2305
2016-03-11 09:52:36 +01:00
Péter Szilágyi daad2b2559 core: cache fresh headers and tds to avoid db trashing 2016-03-10 21:40:34 +02:00
zsfelfoldi 73d21ea6af core: create a header chain structure shared by core.BlockChain and light.LightChain 2016-03-10 14:57:32 +01:00
Jeffrey Wilcke bff9ceb6b8 Merge pull request #2301 from obscuren/uncle-fix
core: announce ChainSideEvent during reorg
2016-03-10 14:21:41 +01:00