| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
* core/blockchain: export progress
* core: polish up chain export progress report a bit
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current trie memory database/cache that we do pruning on stores
trie nodes as binary rlp encoded blobs, and also stores the node
relationships/references for GC purposes. However, most of the trie
nodes (everything apart from a value node) is in essence just a
collection of references.
This PR switches out the RLP encoded trie blobs with the
collapsed-but-not-serialized trie nodes. This permits most of the
references to be recovered from within the node data structure,
avoiding the need to track them a second time (expensive memory wise).
|
| |
|
|
|
|
|
|
|
|
| |
* core: improve getBadBlocks to return full block rlp
* core, eth, ethapi: changes to getBadBlocks formatting
* ethapi: address review concerns
|
| |
|
|
|
|
|
|
| |
* core, eth, trie: streaming GC for the trie cache
* trie: track memcache statistics
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* core: make current*Block atomic, and accessor functions mutex-free
* core: fix review concerns
* core: fix error in atomic assignment
* core/light: implement atomic getter/setter for headerchain
|
|
|
|
|
|
| |
* core: flush out trie cache more meaningfully on stop
* core: upgrade legacy tests to chain maker
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#15910)
* go-metrics: fork library and introduce ResettingTimer and InfluxDB reporter.
* vendor: change nonsense/go-metrics to ethersphere/go-metrics
* go-metrics: add tests. move ResettingTimer logic from reporter to type.
* all, metrics: pull in metrics package in go-ethereum
* metrics/test: make sure metrics are enabled for tests
* metrics: apply gosimple rules
* metrics/exp, internal/debug: init expvar endpoint when starting pprof server
* internal/debug: tiny comment formatting fix
|
|
|
|
|
|
| |
Talk about "state" instead of "trie timing", "trie memory" and remove
the overzealous warning when the limit is just reached. Since the time
limit is always reached on slow machines, move the message to info level
so users don't freak out about internal details.
|
| |
|
|
|
| |
This commit reduces database I/O by not writing every state trie to disk.
|
|\
| |
| | |
core, eth, les, light: get rid of redundant methods
|
| | |
|
|/
|
|
|
|
| |
* leveldb: Update leveldb to 211f780 (poolfix)
* core, ethdb: reuse database batches
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* core: only fire one chain head per batch
* miner: announce chan events synchronously
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ethdb: add Putter interface and Has method
* ethdb: improve docs and add IdealBatchSize
* ethdb: remove memory batch lock
Batches are not safe for concurrent use.
* core: use ethdb.Putter for Write* functions
This covers the easy cases.
* core/state: simplify StateSync
* trie: optimize local node check
* ethdb: add ValueSize to Batch
* core: optimize HasHeader check
This avoids one random database read get the block number. For many uses
of HasHeader, the expectation is that it's actually there. Using Has
avoids a load + decode of the value.
* core: write fast sync block data in batches
Collect writes into batches up to the ideal size instead of issuing many
small, concurrent writes.
* eth/downloader: commit larger state batches
Collect nodes into a batch up to the ideal size instead of committing
whenever a node is received.
* core: optimize HasBlock check
This avoids a random database read to get the number.
* core: use numberCache in HasHeader
numberCache has higher capacity, increasing the odds of finding the
header without a database lookup.
* core: write imported block data using a batch
Restore batch writes of state and add blocks, tx entries, receipts to
the same batch. The change also simplifies the miner.
This commit also removes posting of logs when a forked block is imported.
* core: fix DB write error handling
* ethdb: use RLock for Has
* core: fix HasBlock comment
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* core: remove redundant storage of transactions and receipts
* core, eth, internal: new transaction schema usage polishes
* eth: implement upgrade mechanism for db deduplication
* core, eth: drop old sequential key db upgrader
* eth: close last iterator on successful db upgrage
* core: prefix the lookup entries to make their purpose clearer
|
| |
|
|
|
|
|
|
|
|
|
| |
With this commit, core/state's access to the underlying key/value database is
mediated through an interface. Database errors are tracked in StateDB and
returned by CommitTo or the new Error method.
Motivation for this change: We can remove the light client's duplicated copy of
core/state. The light client now supports node iteration, so tracing and storage
enumeration can work with the light client (not implemented in this commit).
|
| |
|
|
|
|
|
|
|
|
| |
1. fix typos
2. methods recevier of struct should be same
3. comments improve
(cherry picked from commit 1ba979539582a00b7fd1a7c8a37a6852e59eac0d)
|
| |
|
| |
|
|
|
|
|
|
| |
* consensus, core, ethstats: use engine specific block beneficiary
* core, eth, les, miner: use explicit beneficiary during mining
|
| |
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* les: implement request distributor, fix blocking issues
* core: moved header validation before chain mutex lock
|
| |
|
| |
|
|\
| |
| | |
all: update light logs (and a few others) to the new model
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
|
|
|
|
| |
go get github.com/gordonklaus/ineffassign
ineffassign .
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
|\
| |
| | |
core: Add block processing time metric collection
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This change introduces a global, per-state cache that keeps account data
in the canon state. Thanks to @karalabe for lots of fixes.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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.
|
| |
|
|
|
|
|
| |
This fixes a few uses of unkeyed Body literals which go vet was
complaining about.
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
core, eth/filters, miner, xeth: Optimised log filtering
|
| |
| |
| |
| |
| |
| |
| | |
Log filtering is now using a MIPmap like approach where addresses of
logs are added to a mapped bloom bin. The current levels for the MIP are
in ranges of 1.000.000, 500.000, 100.000, 50.000, 1.000. Logs are
therefor filtered in batches of 1.000.
|
|/ |
|
| |
|
|
|
|
|
| |
Due to a rebase this probably got overlooked / ignored. This fixes the
issue of a block insertion never writing the last block.
|
|
* Renamed ChainManager to BlockChain
* Checkpointing is no longer required and never really properly worked
when the state was corrupted.
|