aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_makers.go
Commit message (Collapse)AuthorAgeFilesLines
* all: get rid of error when creating memory database (#16716)gary rong2018-05-091-4/+5
| | | | | | | | * all: get rid of error when create mdb * core: clean up variables definition * all: inline mdb definition
* Merge pull request #15990 from markya0616/sim_backend_block_hashMartin Holst Swende2018-03-191-1/+13
|\ | | | | accounts/abi, core: add AddTxWithChain in BlockGen for simulation
| * accounts/abi, core: add AddTxWithChain in BlockGen for simulationmark.lin2018-01-291-1/+13
| |
* | core, trie: intermediate mempool between trie and database (#15857)Péter Szilágyi2018-02-061-3/+6
|/ | | This commit reduces database I/O by not writing every state trie to disk.
* all: switch gas limits from big.Int to uint64Péter Szilágyi2018-01-031-2/+1
|
* accounts, consensus, core, eth: make chain maker consensus agnostic (#15497)gary rong2017-12-221-32/+44
| | | | | | | | | | * 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
* cmd, consensus, core, miner: instatx clique for --dev (#15323)Péter Szilágyi2017-10-241-1/+1
| | | | | | | | * cmd, consensus, core, miner: instatx clique for --dev * cmd, consensus, clique: support configurable --dev block times * cmd, core: allow --dev to use persistent storage too
* consensus, core, tests: implement Metropolis EIP 649Péter Szilágyi2017-08-241-1/+1
|
* core, light: send chain events using event.Feed (#14865)Miya Chen2017-08-181-2/+1
|
* consensus, core: EIP 100 polishes, fix chain maker diffPéter Szilágyi2017-06-301-0/+1
| | | | | | | | | | | | This PR polishes the EIP 100 difficulty adjustment algorithm to match the same mechanisms as the Homestead was implemented to keep the code uniform. It also avoids a few memory allocs by reusing big1 and big2, pulling it out of the common package and into ethash. The commit also fixes chain maker to forward the uncle hash when creating a simulated chain (it wasn't needed until now so we just skipped a copy there).
* core/state: access trie through Database interface, track errors (#14589)Felix Lange2017-06-271-2/+2
| | | | | | | | | 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).
* core: typos and comments improvechanghong2017-05-251-2/+2
| | | | | | | | 1. fix typos 2. methods recevier of struct should be same 3. comments improve (cherry picked from commit 1ba979539582a00b7fd1a7c8a37a6852e59eac0d)
* consensus, core, core/vm, parems: review fixesJeffrey Wilcke2017-05-181-3/+0
|
* consensus, core/*, params: metropolis preparation refactorJeffrey Wilcke2017-05-181-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a preparation for the upcoming metropolis hardfork. It prepares the state, core and vm packages such that integration with metropolis becomes less of a hassle. * Difficulty calculation requires header instead of individual parameters * statedb.StartRecord renamed to statedb.Prepare and added Finalise method required by metropolis, which removes unwanted accounts from the state (i.e. selfdestruct) * State keeps record of destructed objects (in addition to dirty objects) * core/vm pre-compiles may now return errors * core/vm pre-compiles gas check now take the full byte slice as argument instead of just the size * core/vm now keeps several hard-fork instruction tables instead of a single instruction table and removes the need for hard-fork checks in the instructions * core/vm contains a empty restruction function which is added in preparation of metropolis write-only mode operations * Adds the bn256 curve * Adds and sets the metropolis chain config block parameters (2^64-1)
* consensus, core, ethstats: use engine specific block beneficiary (#14318)Péter Szilágyi2017-04-121-1/+1
| | | | | | * consensus, core, ethstats: use engine specific block beneficiary * core, eth, les, miner: use explicit beneficiary during mining
* core, consensus: pluggable consensus engines (#3817)Péter Szilágyi2017-04-051-6/+7
| | | | | 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.
* core: refactor genesis handlingFelix Lange2017-03-231-25/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* all: swap out the C++ ethash to the pure Go one (mining todo)Péter Szilágyi2017-03-091-12/+1
|
* cmd/geth, core: add support for recording SHA3 preimages (#3543)Nick Johnson2017-01-171-1/+1
|
* core/vm: improved EVM run loop & instruction calling (#3378)Jeffrey Wilcke2017-01-051-1/+1
| | | | | | | | | | | | | | | 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.
* core, core/state, trie: EIP158, reprice & skip empty account writeJeffrey Wilcke2016-11-131-10/+12
| | | | | | | | | | | | | | | 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/state: implement reverts by journaling all changesFelix Lange2016-10-061-1/+1
| | | | | | | | | | 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!
* accounts, core, eth: pass chain config for chain maker to test DAOPéter Szilágyi2016-07-151-3/+25
|
* accounts/a/b/backends, core: chain maker homestead block set to 0Jeffrey Wilcke2016-04-011-15/+6
| | | | | | | 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
* core: added basic chain configurationJeffrey Wilcke2016-04-011-4/+23
| | | | | | | | | 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.
* core: Added EVM configuration optionsJeffrey Wilcke2016-03-241-1/+1
| | | | | The EVM is now initialised with an additional configured object that allows you to turn on debugging options.
* core: various typosLeif Jurvetson2016-03-161-2/+2
|
* core: fix invalid state reuse in chain maker based testsPéter Szilágyi2016-01-111-12/+7
|
* eth/downloader: fix negative balance issue in testsFelix Lange2015-12-181-0/+5
| | | | | | | | | | 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.
* core: added a new RemovedLogEventJeffrey Wilcke2015-12-011-2/+2
| | | | | | 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.
* cmd, common, core, eth, node, rpc, tests, whisper, xeth: use protocol stacksPéter Szilágyi2015-11-271-1/+1
|
* core, eth, rpc: split out block validator and state processorJeffrey Wilcke2015-11-181-7/+4
| | | | | | | | | | | | 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).
* Merge pull request #1889 from karalabe/fast-sync-rebaseJeffrey Wilcke2015-10-221-21/+47
|\ | | | | eth/63 fast synchronization algorithm
| * eth/downloader: concurrent receipt and state processingPéter Szilágyi2015-10-191-1/+1
| |
| * core, eth: receipt chain reconstructionPéter Szilágyi2015-10-191-7/+9
| |
| * core: differentiate receipt concensus and storage decodingPéter Szilágyi2015-10-191-1/+1
| |
| * core: support inserting pure header chainsPéter Szilágyi2015-10-191-13/+37
| |
* | core, core/state: move gas tracking out of core/stateFelix Lange2015-10-171-6/+5
|/ | | | | | | The amount of gas available for tx execution was tracked in the StateObject representing the coinbase account. This commit makes the gas counter a separate type in package core, which avoids unintended consequences of intertwining the counter with state logic.
* Merge pull request #1899 from obscuren/mipmap-bloomJeffrey Wilcke2015-10-171-0/+9
|\ | | | | core, eth/filters, miner, xeth: Optimised log filtering
| * core, eth/filters, miner, xeth: Optimised log filteringJeffrey Wilcke2015-10-171-1/+6
| | | | | | | | | | | | | | 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.
| * eth/filters: added benchmarkJeffrey Wilcke2015-10-161-0/+4
| |
* | Merge pull request #1869 from Gustav-Simonsson/gpu_minerJeffrey Wilcke2015-10-161-1/+1
|\ \ | | | | | | all: Add GPU mining, disabled by default
| * | all: Add GPU mining, disabled by defaultGustav Simonsson2015-10-071-1/+1
| | |
* | | core/state, core, miner: handle missing root error from state.NewGustav Simonsson2015-10-161-1/+4
| |/ |/|
* | cmd/geth, cmd/utils, core, rpc: renamed to blockchainJeffrey Wilcke2015-10-041-2/+2
|/ | | | | | * Renamed ChainManager to BlockChain * Checkpointing is no longer required and never really properly worked when the state was corrupted.
* core, core/state: batch-based state syncFelix Lange2015-09-231-5/+9
|
* core: allow modifying test-chain block timesPéter Szilágyi2015-09-171-0/+11
|
* all: move common.Database to package ethdbFelix Lange2015-09-151-3/+4
|
* core: split out TD from database and all internalsPéter Szilágyi2015-09-111-1/+0
|
* Add tests for uncle timestamps and refactor timestamp typeGustav Simonsson2015-08-251-3/+8
|
* core, eth, trie, xeth: merged state, chain, extra databases in oneJeffrey Wilcke2015-08-081-3/+3
|
* core, miner: added difficulty bombJeffrey Wilcke2015-08-051-1/+1
|
* all: fix license headers one more timeFelix Lange2015-07-241-1/+1
| | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-231-4/+4
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* cmd, core, eth, common: genesis preparationJeffrey Wilcke2015-07-101-1/+3
| | | | | Implemented the --genesis flag thru which we can set a custom genesis block, including the official Ethereum genesis block.
* Use uint64 on ts in chain_manager, block_processorGustav Simonsson2015-07-081-1/+1
|
* all: update license informationFelix Lange2015-07-071-0/+16
|
* core, miner, tests: renamed state methodsJeffrey Wilcke2015-07-041-2/+2
| | | | | | | | | | | | * Update => SyncIntermediate * Added SyncObjects SyncIntermediate only updates whatever has changed, but, as a side effect, requires much more disk space. SyncObjects will only sync whatever is required for a block and will not save intermediate state to disk. As drawback this requires more time when more txs come in.
* core, miner: miner header validation, transaction & receipt writingJeffrey Wilcke2015-07-031-1/+1
| | | | | | | | * 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
* Use uint64 for block header timestampGustav Simonsson2015-06-301-1/+1
|
* core: add GenerateChain, GenesisBlockForTestingFelix Lange2015-06-301-74/+127
|
* core/types: make blocks immutableFelix Lange2015-06-301-35/+23
|
* core, miner, xeth: renamed gas methodsobscuren2015-06-211-1/+1
| | | | | | * BuyGas => SubGas * RefundGas => AddGas * SetGasPool => SetGasLimit
* core: settable genesis nonceobscuren2015-06-091-1/+1
| | | | | | | You can set the nonce of the block with `--genesisnonce`. When the genesis nonce changes and it doesn't match with the first block in your database it will fail. A new `datadir` must be given if the nonce of the genesis block changes.
* core: don't remove transactions after block processingFelix Lange2015-06-041-2/+1
| | | | | The transaction pool drops processed transactions on its own during pool maintenance.
* core: fixed testsobscuren2015-05-191-1/+1
|
* core: fixed mining strategyobscuren2015-05-151-1/+1
|
* Integrate new ethash API and change geth makedag cmdGustav Simonsson2015-05-051-2/+2
|
* core: return the index of the block that failed when inserting a chainobscuren2015-04-291-1/+1
|
* core, miner: added value check on tx validationobscuren2015-04-261-2/+2
| | | | | | * Changed CalcGasLimit to no longer need current block * Added a gas * price + value on tx validation * Transactions in the pool are now re-validated once every X
* xeth, core, cmd/utils: Transaction can not be over block gas limitobscuren2015-04-241-1/+1
| | | | Transactions will be invalidated when the tx.gas_limit > block.gas_limit
* core: fixed testobscuren2015-04-231-1/+3
|
* core: moved TD calculation from proc to chainobscuren2015-04-201-2/+2
|
* Improved transaction poolobscuren2015-04-091-6/+7
| | | | | | | | | | The transaction pool will now some easily be able to pre determine the validity of a transaction by checking the following: * Account existst * gas limit higher than the instrinsic gas * enough funds to pay upfront costs * nonce check
* Block header changed & console miner controlobscuren2015-04-061-1/+1
| | | | | | * miner control moved to `admin.miner` * miner option to set extra data * block extra now bytes
* Improved chain manager, improved block processor, fixed testsobscuren2015-04-041-0/+1
| | | | | | * ChainManager allows cached future blocks for later processing * BlockProcessor allows a 4 second window on future blocks * Fixed tests
* Removed old (unused) argumentobscuren2015-04-021-2/+2
|
* moved state and vm to coreobscuren2015-03-231-1/+1
|
* mergeobscuren2015-03-191-1/+1
|\
| * fixed chain event. Closes #529obscuren2015-03-191-2/+2
| |
* | converted chain managerobscuren2015-03-171-5/+5
|/
* Moved ethutil => commonobscuren2015-03-161-15/+15
|
* Add additional extra database for non-protocol related dataobscuren2015-03-121-1/+1
| | | | * Add transaction to extra database after a successful block process
* Separated block db from state db. Partial fix for #416obscuren2015-03-071-1/+1
|
* uncle validationobscuren2015-03-041-1/+1
|
* Changed nonce to a uint64obscuren2015-03-041-3/+3
|
* fixed pow stuffobscuren2015-03-041-3/+3
|
* Introducing ethashMatthew Wampler-Doty2015-03-031-18/+29
|
* public functions for making chains on the flyEthan Buchman2015-02-281-0/+131