| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
all: update light logs (and a few others) to the new model
|
| | |
|
|/ |
|
|\
| |
| | |
common/hexutil: implement TextMarshaler, TextUnmarshaler
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit makes the wrapper types more generally applicable.
encoding.TextMarshaler is supported by most codec implementations (e.g.
for yaml).
The tests now ensure that package json actually recognizes the custom
marshaler implementation irrespective of how it is implemented.
The Uint type has new tests, too. These are tricky because uint size
depends on the CPU word size. Turns out that there was one incorrect
case where decoding returned ErrUint64Range instead of ErrUintRange.
|
|/
|
|
|
|
|
|
| |
* Improved the standard evm tracer output and renamed it to WriteTrace
which now takes an io.Writer to write the logs to.
* Added WriteLogs which writes logs to the given writer in a readable
format.
* evm utility now also prints logs generated during the execution.
|
|
|
|
|
| |
The evm compile command implements a simple assembly language that compiles to
EVM bytecode.
|
| |
|
|\
| |
| | |
Logger updates
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* common/math: optimize PaddedBigBytes, use it more
name old time/op new time/op delta
PaddedBigBytes-8 71.1ns ± 5% 46.1ns ± 1% -35.15% (p=0.000 n=20+19)
name old alloc/op new alloc/op delta
PaddedBigBytes-8 48.0B ± 0% 32.0B ± 0% -33.33% (p=0.000 n=20+20)
* all: unify big.Int zero checks
Various checks were in use. This commit replaces them all with Int.Sign,
which is cheaper and less code.
eg templates:
func before(x *big.Int) bool { return x.BitLen() == 0 }
func after(x *big.Int) bool { return x.Sign() == 0 }
func before(x *big.Int) bool { return x.BitLen() > 0 }
func after(x *big.Int) bool { return x.Sign() != 0 }
func before(x *big.Int) int { return x.Cmp(common.Big0) }
func after(x *big.Int) int { return x.Sign() }
* common/math, crypto/secp256k1: make ReadBits public in package math
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* common: remove CurrencyToString
Move denomination values to params instead.
* common: delete dead code
* common: move big integer operations to common/math
This commit consolidates all big integer operations into common/math and
adds tests and documentation.
There should be no change in semantics for BigPow, BigMin, BigMax, S256,
U256, Exp and their behaviour is now locked in by tests.
The BigD, BytesToBig and Bytes2Big functions don't provide additional
value, all uses are replaced by new(big.Int).SetBytes().
BigToBytes is now called PaddedBigBytes, its minimum output size
parameter is now specified as the number of bytes instead of bits. The
single use of this function is in the EVM's MSTORE instruction.
Big and String2Big are replaced by ParseBig, which is slightly stricter.
It previously accepted leading zeros for hexadecimal inputs but treated
decimal inputs as octal if a leading zero digit was present.
ParseUint64 is used in places where String2Big was used to decode a
uint64.
The new functions MustParseBig and MustParseUint64 are now used in many
places where parsing errors were previously ignored.
* common: delete unused big integer variables
* accounts/abi: replace uses of BytesToBig with use of encoding/binary
* common: remove BytesToBig
* common: remove Bytes2Big
* common: remove BigTrue
* cmd/utils: add BigFlag and use it for error-checked integer flags
While here, remove environment variable processing for DirectoryFlag
because we don't use it.
* core: add missing error checks in genesis block parser
* common: remove String2Big
* cmd/evm: use utils.BigFlag
* common/math: check for 256 bit overflow in ParseBig
This is supposed to prevent silent overflow/truncation of values in the
genesis block JSON. Without this check, a genesis block that set a
balance larger than 256 bits would lead to weird behaviour in the VM.
* cmd/utils: fixup import
|
| |
|
|
|
|
|
| |
This PR implements a differenceIterator, which allows iterating over trie nodes
that exist in one trie but not in another. This is a prerequisite for most GC
strategies, in order to find obsolete nodes.
|
|
|
|
| |
Removed exported statedb object accessors, reducing the chance for nasty
bugs to creep in. It's also ugly and unnecessary to have these methods.
|
| |
|
|
|
|
| |
of Get (#3655)
|
|
|
|
|
|
|
|
|
|
|
| |
* vendor: add github.com/btcsuite/btcd/btcec
* crypto: add btcec fallback for sign/recover without cgo
This commit adds a non-cgo fallback implementation of secp256k1
operations.
* crypto, core/vm: remove wrappers for sha256, ripemd160
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* core,eth,internal: Added `debug_getBadBlocks()` method
When bad blocks are discovered, these are stored within geth.
An RPC-endpoint makes them availablewithin the `debug`
namespace. This feature makes it easier to discover network forks.
```
* core, api: go format + docs
* core/blockchain: Documentation, fix minor nitpick
* core: fix failing blockchain test
|
|
|
|
| |
This reverts commit 8b57c494908637a5c0e74f8f7a13b3218e026757.
|
| |
|
|\
| |
| | |
core/genesis: add support for setting nonce in 'alloc'
|
| |
| |
| |
| | |
This is to be able to set `pre`-state when performing blockchain tests through Hive, we need to be able to set the nonce.
|
|\ \
| | |
| | | |
event: add new Subscription type and related utilities
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The Subscription type is gone, all uses are replaced by
*TypeMuxSubscription. This change is prep-work for the
introduction of the new Subscription type in a later commit.
gorename -from '"github.com/ethereum/go-ethereum/event"::Event' -to TypeMuxEvent
gorename -from '"github.com/ethereum/go-ethereum/event"::muxsub' -to TypeMuxSubscription
gofmt -w -r 'Subscription -> *TypeMuxSubscription' ./event/*.go
find . -name '*.go' -and -not -regex '\./vendor/.*' \| xargs gofmt -w -r 'event.Subscription -> *event.TypeMuxSubscription'
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
We must take a write lock here because `GetNonce` calls
`StateDB.GetStateObject`, which mutates the DB's live set.
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
| |
Removal of dead code that appeard as if we had a consensus issue. This
however is not the case as the proper error catching happens in the vm
package instead.
|
|
|
|
|
|
|
|
| |
* core: Made logging of reorgs more structured, also always log if reorg is > 63 blocks long
* core/blockchain: go fmt
* core/blockchain: Minor fixes to the reorg reporting
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
all: fix ineffectual assignments
|
| |
| |
| |
| |
| | |
go get github.com/gordonklaus/ineffassign
ineffassign .
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
core/types: remove redundant SignECDSA wrappers, rename to SignTx
|
| | |
|
|\ \
| | |
| | | |
core/types: dependency cleanup
|
| | |
| | |
| | |
| | | |
This removes the core/types -> leveldb dependency.
|
| |/
| |
| |
| |
| |
| |
| |
| | |
This significantly reduces the dependency closure of ethclient, which no
longer depends on core/vm as of this change.
All uses of vm.Logs are replaced by []*types.Log. NewLog is gone too,
the constructor simply returned a literal.
|
|\ \
| |/
|/| |
core,cmd/utils: bugfix for ropsten dump imports
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The run loop, which previously contained custom opcode executes have been
removed and has been simplified to a few checks.
Each operation consists of 4 elements: execution function, gas cost function,
stack validation function and memory size function. The execution function
implements the operation's runtime behaviour, the gas cost function implements
the operation gas costs function and greatly depends on the memory and stack,
the stack validation function validates the stack and makes sure that enough
items can be popped off and pushed on and the memory size function calculates
the memory required for the operation and returns it.
This commit also allows the EVM to go unmetered. This is helpful for offline
operations such as contract calls.
|
|/
|
|
|
|
|
|
|
| |
(#3455)
To address increasing complexity in code that handles signatures, this PR
discards all notion of "different" signature types at the library level. Both
the crypto and accounts package is reduced to only be able to produce plain
canonical secp256k1 signatures. This makes the crpyto APIs much cleaner,
simpler and harder to abuse.
|
| |
|
|\
| |
| | |
core: import future blocks one-by-one, enfore chain ancestry
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
| |
The transaction pool keeps track of the current nonce in its local pendingState. When a
new block comes in the pendingState is reset. During the reset it fetches multiple times
the current state through the use of the currentState callback. When a second block comes
in during the reset its possible that the state changes during the reset. If that block
holds transactions that are currently in the pool the local pendingState that is used to
determine nonces can get out of sync.
|
|
|
|
|
|
|
|
| |
Environment is now a struct (not an interface). This
reduces a lot of tech-debt throughout the codebase where a virtual
machine environment had to be implemented in order to test or run it.
The new environment is suitable to be used en the json tests, core
consensus and light client.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This field used to be assigned by the filter system and returned through
the RPC API. Now that we have a Go client that uses the underlying type,
the field needs to move. It is now assigned to true when the RemovedLogs
event is generated so the filter system doesn't need to care about the
field at all.
While here, remove the log list from ChainSideEvent. There are no users
of this field right now and any potential users could subscribe to
RemovedLogsEvent instead.
|
| |
|
| |
|
| |
|
|
|
| |
Fixed unwinding of bad hashes when already on the canon chain
|
| |
|
|\
| |
| | |
core, core/state: fixed consensus issue added touch revert
|
| |
| |
| |
| |
| | |
Implemented proper touch revert journal entries and copied a Parity
consensus bug in order to remain in sync with the current longest chain.
|
|/ |
|
| |
|
| |
|
|
|
|
| |
All account's nonce start at 0.
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
* core, core/types: refactored tx chain id checking
Refactored explicit chain id checking in to the Sender deriviation method
* cmd/utils, params: define chain ids
|
| |
| |
| |
| | |
Refactored explicit chain id checking in to the Sender deriviation method
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
These accessors were introduced by light client changes, but
the only method that is actually used is GetNumberU64. This
commit replaces all uses of .GetNumberU64 with .Number.Uint64.
|
| |
|
|
|
|
|
|
|
| |
* common/math, core/vm: implement fast EXP.
Courtesy @chfast & @karalabe
* common/math: fix go vet issues on exp calculation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* core: Add metrics collection for transaction events; replace/discard for pending and future queues, as well as invalid transactions
* core: change namespace for txpool metrics
* core: define more metrics (not yet used)
* core: implement more tx metrics for when transactions are dropped
* core: minor formatting tweeks (will squash later)
* core: remove superfluous meter, fix missing pending nofunds
* core, metrics: switch txpool meters to counters
|
|\
| |
| | |
core/state, eth/downloader, trie: reset fast-failure on progress
|
| | |
|
|\ \
| |/
|/| |
core/vm: add limit option to LogConfig
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
that specifies the maximum number of elements in the `structLogs`
output. This option is useful for debugging a transaction that
involves a large number of repetition.
For example,
```
debug.traceTransaction(tx, {disableStorage: true, limit: 2})
```
shows at most the first two steps in the `structLogs`.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
core/vm: fix GASPRICE string (resolves #2553)
|
| | | |
|
|\ \ \
| |/ /
|/| | |
trie: improve cache unloading mechanism
|
| | | |
|
|\ \ \
| | | |
| | | | |
core: Add block processing time metric collection
|
| |/ / |
|
|/ / |
|
|\ \
| | |
| | | |
core, core/vm: added gas price variance table (EIP #150)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This implements 1b & 1c of EIP150 by adding a new GasTable which must be
returned from the RuleSet config method. This table is used to determine
the gas prices for the current epoch.
Please note that when the CreateBySuicide gas price is set it is assumed
that we're in the new epoch phase.
In addition this PR will serve as temporary basis while refactorisation
in being done in the EVM64 PR, which will substentially overhaul the gas
price code.
|
|\ \ \
| | | |
| | | | |
core: add global (soft) limits on the pending transactions
|
| | | | |
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* 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
|
| | | |
|
|\ \ \
| | | |
| | | | |
core: print import stats more often
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If geth is busy importing 2048 heavy blocks it can take a while before
it prints anything. This change ensures that a message gets printed
every 8s.
|
|/ / / |
|
|\ \ \
| |/ /
|/| | |
core/types: renamed receiptRoot to receiptsRoot
|
| | | |
|
|\ \ \
| | | |
| | | | |
tests: update test files from github.com/ethereum/tests @ 45bc1d21d3c1
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
Two new tests are skipped because they're buggy. Making some newer
random state tests work required implementing the 'compressed return
value encoding'.
|
| | |
| | |
| | |
| | | |
There is no need to use the reflection-based decoder to decode []byte.
|
| | |
| | |
| | |
| | | |
The delete/remove naming has caused endless confusion in the past.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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!
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
| |
This change introduces a global, per-state cache that keeps account data
in the canon state. Thanks to @karalabe for lots of fixes.
|
| |
|
| |
|
|\
| |
| | |
core/state: Fix memory expansion bug by not copying clean objects
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
In this commit, core/types's types learn how to encode and decode
themselves as JSON. The encoding is very similar to what the RPC API
uses. The RPC API is missing some output fields (e.g. transaction
signature values) which will be added to the API in a later commit. Some
fields that the API generates are ignored by the decoder methods here.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
all: clean up tech debt left behind by the API split
|
| | |
| | |
| | |
| | |
| | | |
This ensures that package core doesn't depend on package accounts and
resolves an age-old TODO.
|
| | | |
|
| | | |
|
|/ / |
|
| |
| |
| |
| | |
Fixes #2825
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| |/
|/| |
vm: Replace some SstoreClearGas with SstoreResetGas
|
| | |
|
|\ \
| | |
| | | |
core: added CheckNonce() to Message interface
|
| | | |
|
|/ / |
|
|\ \
| | |
| | | |
eth: separate common and full node-specific API and backend service
|
| | | |
|
| | |
| | |
| | |
| | | |
This reverts commit 7a5b571c671e70e0e4807cf971c15e2d1e09d33d.
|
| | |
| | |
| | |
| | | |
This reverts commit c4de28938ff8c688c4444c8b3e8e28a52cbc62ff.
|
| | |
| | |
| | |
| | | |
This reverts commit ba784bdf36f2daf7827ec1ec864f3393ba8d86a0.
|
| | |
| | |
| | |
| | | |
This reverts commit 1e3a7d4fab36df9382d023519ef10e3c34bafa3b.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |/
|/| |
|
|\ \
| |/
|/| |
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
|
| | |
|
|/ |
|
|
|
|
| |
Fixes #2650
|
|\
| |
| | |
core, core/state, trie: enterprise hand-tuned multi-level caching
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Lazy "I'll just put return here instead of fixing the test" found by go vet.
|
|
|
|
|
| |
This fixes a few uses of unkeyed Body literals which go vet was
complaining about.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This commit serves as a temporary workaround for enabling the jit until
the block customisation PR is merged in.
|
|
|
|
|
| |
The EVM is now initialised with an additional configured object that
allows you to turn on debugging options.
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
core: fixed various typos
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
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
|
|/ |
|
|
|
|
| |
light.LightChain
|
|\
| |
| | |
core: announce ChainSideEvent during reorg
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously all blocks that were already in our chain were never re
announced as potential uncle block (e.g. ChainSideEvent). This is
problematic during mining where you want to gather as much possible
uncles as possible increasing the profit. This is now addressed in this
PR where during reorganisations of chains the old chain is regarded as
uncles.
Fixed #2298
|
|/ |
|
|\
| |
| | |
core, miner: add PendingStateEvent to track non-log updates.
|
| | |
|
|\ \
| |/
|/| |
core: improved check for contract creation
|
| | |
|
|\ \
| | |
| | | |
Closes #2241: Use Keccak-256 from golang.org/x/crypto/sha3 and mention explicitly
|
| | |
| | |
| | |
| | | |
As we aren't really using the standarized SHA-3
|
|\ \ \
| |/ /
|/| | |
core/state, trie: add node iterator, test state/trie sync consistency
|
| | | |
|
| | | |
|
| | | |
|
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Assuming the following scenario where a miner has 15% of all hashing
power and the ability to exert a moderate control over the network to
the point where if the attacker sees a message A, it can't stop A from
propagating, but what it **can** do is send a message B and ensure that
most nodes see B before A. The attacker can then selfish mine and
augment selfish mining strategy by giving his own blocks an advantage.
This change makes the time at which a block is received less relevant
and so the level of control an attacker has over the network no longer
makes a difference.
This change changes the current td algorithm `B_td > C_td` to the new
algorithm `B_td > C_td || B_td == C_td && rnd < 0.5`.
|
| |
| |
| |
| |
| |
| | |
* Removed some strange code that didn't apply state reverting properly
* Refactored code setting from vm & state transition to the executioner
* Updated tests
|
|/
|
|
|
|
|
|
| |
* change gas cost for contract creating txs
* invalidate signature with s value greater than secp256k1 N / 2
* OOG contract creation if not enough gas to store code
* new difficulty adjustment algorithm
* new DELEGATECALL op code
|
|
|
|
|
|
| |
Pending logs are now filterable through the Go API. Filter API changed
such that each filter type has it's own bucket and adding filter
explicitly requires you specify the bucket to put it in.
|
|
|
|
|
|
| |
Implemented `runtime.Call` which uses - unlike Execute - the given state
for the execution and the address of the contract you wish to execute.
Unlike `Execute`, `Call` requires a config.
|
|\
| |
| | |
core/state, trie: don't leak database writes before commit
|
| | |
|
| | |
|
|\ \
| | |
| | | |
core/vm, rpc/api: added debug_replayTransaction RPC call
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
integrated feedback
Integrated code review suggestions
Integrated last review comments
|
|/ / |
|
| | |
|
|\ \
| |/
|/| |
core/vm: resolve circular dependency to debug vm storage
|
| | |
|
|/ |
|
| |
|
|\
| |
| | |
core, eth/downloader: ensure state presence in ancestor lookup
|
| | |
|
|/ |
|
|
|
|
|
| |
In order to make this happen, kill all remaining trivial uses of
common/{rlp,value}.go. The non-trivial ones have been updated earlier.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The test chain generated by makeChainFork included invalid uncle
headers, crashing the generator during the state commit.
The headers were invalid because they used the iteration counter as the
block number, even though makeChainFork uses a block with number > 0 as
the parent. Fix this by introducing BlockGen.Number, which allows
accessing the actual number of the block being generated.
|
| |
|
|\
| |
| | |
rpc: new RPC implementation with pub/sub support
|
| | |
|
| | |
|
|/
|
|
|
|
| |
When a chain reorganisation occurs we collect the logs that were deleted
during the chain reorganisation. The removed logs are posted to the
event mux indicating that those were deleted during the reorg.
|
| |
|
| |
|