Commit Graph

250 Commits

Author SHA1 Message Date
Bas van Kervel 2a133748cb core/types,core/quorum: give vote transactions priority 2016-11-09 16:04:29 +01:00
Felix Lange b8bd9a71c8 all: update license information 2016-11-09 02:51:34 +01:00
Felix Lange be3865211c core/types: remove header accessors
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.
2016-11-09 02:19:07 +01:00
Zsolt Felfoldi 760fd65487 light: light chain, VM env and tx pool 2016-11-09 02:12:53 +01:00
Jeffrey Wilcke 1ad23deb8e core, core/types: implemented private transaction check
Transactions are considered private when the V param is either 37 or 38.
2016-11-01 22:25:59 +01:00
Bas van Kervel f7cb85824c quorum integration 2016-10-30 09:20:48 +01:00
bas-vk b59c8399fb internal/ethapi: add personal_sign and fix eth_sign to hash message (#2940)
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.
2016-10-28 21:25:49 +02:00
Bas van Kervel 71e8ae01b8 core/types: renamed receiptRoot to receiptsRoot 2016-10-05 12:24:42 +02:00
Péter Szilágyi b6b5ec8f75 core/types: add core type marshal methods too 2016-09-08 18:16:53 +03:00
Péter Szilágyi affffb39b3 core/types, miner: switch over to the grouped tx sets 2016-09-02 14:12:03 +03:00
Péter Szilágyi 0ef327bbee core, eth, internal, miner: optimize txpool for quick ops 2016-09-02 14:12:03 +03:00
Felix Lange 704fde01e8 core/types, core/vm: improve docs, add JSON marshaling methods
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.
2016-08-04 03:55:33 +02:00
Bas van Kervel 47ff813012 rpc: refactor subscriptions and filters 2016-08-17 12:59:58 +02:00
zsfelfoldi 00787fe781 core: added CheckNonce() to Message interface 2016-07-11 12:35:23 +02:00
Felix Lange ca18202eb9 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.
2016-05-25 02:02:51 +02:00
Fabio Berger faf663133b core: Simplify bloom9 tests with available convenience method `TestBytes` 2016-05-22 16:42:46 -07: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
Leif Jurvetson b7bb2d8589 core: various typos 2016-03-15 11:08:18 -07:00
Ricardo Catalinas Jiménez 436fc8d76a all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()
As we aren't really using the standarized SHA-3
2016-02-21 22:34:34 +00:00
Jeffrey Wilcke b6d88a0e9f core, core/vm, crypto: fixes for homestead
* Removed some strange code that didn't apply state reverting properly
* Refactored code setting from vm & state transition to the executioner
* Updated tests
2016-02-18 10:11:48 +01:00
Gustav Simonsson 371871d685 parmas, crypto, core, core/vm: homestead consensus protocol changes
* 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
2016-02-18 10:08:11 +01:00
Péter Szilágyi a2dc074b1d core, core/types, miner: fix transaction nonce-price combo sort 2016-01-22 12:33:34 +02:00
Felix Lange 1b89bd5d26 core/state, core/types use package rlp for state, receipt serialisation 2015-12-18 12:09:10 +01:00
Bas van Kervel eae81465c1 rpc: new RPC implementation with pub/sub support 2015-12-14 16:34:05 +01: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 5b0ee8ec30 core, eth, trie: fix data races and merge/review issues 2015-10-21 16:49:55 +03:00
Péter Szilágyi b97e34a8e4 eth/downloader: concurrent receipt and state processing 2015-10-19 10:03:10 +03:00
Péter Szilágyi 832b37c822 core, eth: receipt chain reconstruction 2015-10-19 10:03:09 +03:00
Péter Szilágyi 42c8afd440 core: differentiate receipt concensus and storage decoding 2015-10-19 10:03:09 +03:00
Péter Szilágyi f186b39018 eth/downloader: add fast and light sync strategies 2015-10-19 10:03:09 +03:00
Péter Szilágyi c33cc382b3 core: support inserting pure header chains 2015-10-19 10:03:09 +03:00
Jeffrey Wilcke 6dc14788a2 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.
2015-10-16 21:28:59 +02:00
Jeffrey Wilcke 361082ec4b cmd/evm, core/vm, test: refactored VM and core
* Moved `vm.Transfer` to `core` package and changed execution to call
`env.Transfer` instead of `core.Transfer` directly.
* core/vm: byte code VM moved to jump table instead of switch
* Moved `vm.Transfer` to `core` package and changed execution to call
  `env.Transfer` instead of `core.Transfer` directly.
* Byte code VM now shares the same code as the JITVM
* Renamed Context to Contract
* Changed initialiser of state transition & unexported methods
* Removed the Execution object and refactor `Call`, `CallCode` &
  `Create` in to their own functions instead of being methods.
* Removed the hard dep on the state for the VM. The VM now
  depends on a Database interface returned by the environment. In the
  process the core now depends less on the statedb by usage of the env
* Moved `Log` from package `core/state` to package `core/vm`.
2015-10-04 01:13:54 +02:00
Felix Lange 565d9f2306 core, trie: new trie 2015-09-22 22:53:49 +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 55ed8d108d Merge pull request #1789 from Gustav-Simonsson/core_remove_unused_functions
core, core/vm, core/state: remove unused functions
2015-09-11 15:29:27 -07:00
Péter Szilágyi cdc2662c40 core: split out TD from database and all internals 2015-09-11 17:42:25 +03:00
Péter Szilágyi 2b339cbbd8 core, eth: split the db blocks into headers and bodies 2015-09-11 17:42:25 +03:00
Gustav Simonsson b81a6e6ab8 core, core/vm, core/state: remove unused functions 2015-09-10 21:10:58 +02:00
Felix Lange 6ec13e7e2b Merge pull request #1701 from karalabe/eth62-sync-rebase
eth: implement eth/62 synchronization logic
2015-08-27 00:03:59 +02:00
Péter Szilágyi 47a7fe5d22 eth: port the synchronisation algo to eth/62 2015-08-25 17:48:47 +03:00
Gustav Simonsson 7324176f70 Add tests for uncle timestamps and refactor timestamp type 2015-08-25 04:46:11 +02:00
Jeffrey Wilcke 35f271b264 miner, core: sort txs by price, nonce 2015-08-05 17:44:19 +02:00
Bas van Kervel 81e2124ea2 improved error detection and handling for NewTransactionFromBytes
integrated review comments
2015-07-29 10:30:00 +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
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
Jeffrey Wilcke 0cff61beda Merge pull request #1510 from fjl/license-fixes
all: license fixes
2015-07-23 01:43:11 -07:00
Péter Szilágyi 04bb89604e core: fix an RLP encoding data race due to deep struct copy 2015-07-22 20:54:53 +03: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
Felix Lange bdae4fd573 all: add some godoc synopsis comments 2015-07-07 14:12:45 +02:00
Felix Lange ea54283b30 all: update license information 2015-07-07 14:12:44 +02:00
Jeffrey Wilcke 666a7dda36 core, eth, rpc: proper gas used. Closes #1417
Added some additional backward compatibility code for old receipts
2015-07-06 21:18:24 +02:00
Jeffrey Wilcke e6bb9c1cad core, miner: removed vm errors from consensus err checking
Removed VM errors from the consensus errors. They now used for output
only.
2015-07-06 12:43:05 +02:00
Felix Lange ec9620fb2f core/types, xeth: separate tx hash and tx signature hash 2015-07-06 10:45:45 +02:00
Jeffrey Wilcke 2feb23c1da core, eth, miner, xeth: receipt storage fix
* Added GetReceiptsFromBlock, GetReceipt, PutReceipts
* Added ContractAddress to receipt. See #1042
2015-07-04 02:32:10 +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
Gustav Simonsson 4c490db6af Use uint64 for block header timestamp 2015-06-30 10:52:11 +02:00
Felix Lange a8889b092b core/types: cache computed block values 2015-06-29 18:51:48 +02:00
Felix Lange 11b8d1df59 core/types: cache computed transaction values 2015-06-29 18:51:48 +02:00
Felix Lange 1d42888d30 core/types: make blocks immutable 2015-06-29 18:51:47 +02:00
Felix Lange 654564e164 core/types: make transactions immutable 2015-06-29 18:51:47 +02:00
Felix Lange 7aefe123e9 core/types: add Transaction.Size 2015-06-09 17:06:31 +02:00
obscuren 0f51ee6c88 crypto: return common.Address rather than raw bytes 2015-06-04 19:28:39 +02:00
obscuren b26f5e0bb7 types: block json unmarshal method added 2015-06-03 22:39:17 +02:00
Gustav Simonsson 32e1b104f8 Add EC signature validations before call to libsecp256k1 2015-06-01 21:06:52 +02:00
obscuren e3253b5d5e core: fixed an issue with storing receipts 2015-05-28 01:00:23 +02:00
obscuren 9e63798d03 core/types, eth: meassure and display propagation times 2015-04-29 19:55:30 +02:00
obscuren af73d1d682 core/types: added fake parent hash / hash to String() output 2015-04-29 12:51:05 +02:00
Gustav Simonsson 4e0a2c8e8c Validate block header UncleHash against calculated hash 2015-04-22 23:16:19 +02:00
obscuren 97b0c4b697 core: moved TD calculation from proc to chain 2015-04-20 12:01:20 +02:00
Felix Lange 574d5d6ae6 core/types: add rlp tag "nil" for Transaction.Recipient 2015-04-17 14:45:10 +02:00
obscuren ccb4722a59 core/types: Changed bloom lookup to take anything bytes backed 2015-04-15 11:58:45 +02:00
zelig 262714fc6c future queued block support
- queued       bool // flag for blockpool to skip TD check
- set to true when future block queued
- in checkTD: skip check if queued
- TODO: add test (insertchain sets future block)
2015-04-09 13:58:35 +01:00
obscuren 1c872ddf4b Changed how logs are being recorded
Logs are now recorded per transactions instead of tossing them out after
each transaction. This should also fix an issue with
`eth_getFilterLogs` (#629) Also now implemented are the `transactionHash,
blockHash, transactionIndex, logIndex` on logs. Closes #654.
2015-04-08 17:15:45 +02:00
Gustav Simonsson 2591883a18 Use logger.Error instead of 0 with glog 2015-04-07 12:48:19 +02:00
Gustav Simonsson 3f306f63d4 Forward and log EC recover err and remove dup pubkey len check 2015-04-07 12:48:19 +02:00
obscuren 9c55576c7b Block header changed & console miner control
* miner control moved to `admin.miner`
* miner option to set extra data
* block extra now bytes
2015-04-05 18:59:18 +02:00
obscuren eb1c26746d Changed R S to big int and fixed tests 2015-04-04 21:41:24 +02:00
obscuren eb8f0b85f7 Changed R & S to *big.Int 2015-04-04 21:32:24 +02:00
zelig 6ffea34d8b check TxMsg
- add validation on TxMsg checking for nil
- add test for nil transaction
- add test for zero value transaction (no extra validation needed)
2015-04-01 12:32:42 +01:00
zelig 82da6bf4d2 test for invalid rlp encoding of block in BlocksMsg
- rename Validate -> ValidateFields not to confure consensus block validation
- add nil transaction and nil uncle header validation
- remove bigint field checks: rlp already decodes *big.Int to big.NewInt(0)
- add test for nil header, nil transaction
2015-04-01 12:32:42 +01:00
zelig e1be34bce1 eth: SEC-29 eth wire protocol decoding invalid message data crashes client
- add validate method to types.Block
- validate after Decode -> error
- add tests for NewBlockMsg
2015-04-01 12:32:42 +01:00
obscuren 505f1fbcbb added tx tests and fixed block tests 2015-03-25 17:05:29 +01:00
obscuren 0ec171ccdf Copy fix 2015-03-24 13:38:16 +01:00
obscuren d8e21b39b3 Added copy function 2015-03-24 10:33:00 +01:00
obscuren 7b8a47f484 removed legacy code 2015-03-23 22:05:12 +01:00
obscuren 0330077d76 moved state and vm to core 2015-03-23 16:59:09 +01:00
obscuren c28116cb3b Fixed incorrect recipient derived 2015-03-21 14:46:50 +01:00
obscuren 62236dd95e copy over loop 2015-03-19 23:20:41 +01:00
obscuren b5a71d955c merge 2015-03-19 16:59:13 +01:00
obscuren 14a2f42f37 fixed chain event. Closes #529 2015-03-19 16:19:54 +01:00
Felix Lange d15f90645d Merge remote-tracking branch 'ethereum/conversion' into conversion 2015-03-18 13:39:01 +01:00
Felix Lange c298148a7f core/types: use package rlp instead of common.Decode 2015-03-18 13:24:34 +01:00
obscuren 942980609f conversions 2015-03-18 11:44:25 +01:00
obscuren 86661de077 Fixed tests and bloom 2015-03-17 18:00:03 +01:00
obscuren c21293cd91 bloom 2015-03-17 16:05:17 +01:00
Felix Lange ee7202fa00 Merge remote-tracking branch 'ethereum/conversion' into conversion 2015-03-17 12:01:40 +01:00
Felix Lange e91ab84dbe core/types: don't use Address zero value for invalid addresses 2015-03-17 11:58:31 +01:00
obscuren 515d9432fc converted vm 2015-03-17 11:19:23 +01:00
Felix Lange d5de6489d7 core/types: fix Transaction.Hash and add support for encoding with package rlp 2015-03-17 01:34:18 +01:00
obscuren 8ce6a36478 converted chain manager 2015-03-16 23:48:18 +01:00
obscuren 843db4978e updated blockpool 2015-03-16 23:10:26 +01:00
obscuren 6aa390abfb Merge branch 'conversion' of github.com-obscure:ethereum/go-ethereum into conversion 2015-03-16 18:43:09 +01:00
obscuren 91b0b14845 converted vm 2015-03-16 18:42:18 +01:00
Felix Lange 16df850af2 core/types: use common.{Hash,Address} in for transactions 2015-03-16 17:43:42 +01:00
obscuren bfcd2cf132 block conversion 2015-03-16 17:27:23 +01:00
obscuren f486c0ae56 new type + additional methods 2015-03-16 11:59:52 +01:00
obscuren b523441361 Moved ethutil => common 2015-03-16 11:27:38 +01:00
obscuren d9966d6158 merge 2015-03-14 23:37:21 +01:00
obscuren 387f6bba3e POW fixes 2015-03-14 16:37:57 +01:00
Felix Lange 9326541820 core/types: make Block.{ParentHash,SeedHash,MixDigest} []byte
There is no reason to keep them as ethutil.Bytes.
2015-03-13 18:41:09 +01:00
obscuren 9fb52c517b Changed V to byte. Closes #456 2015-03-12 00:18:03 +01:00
Gustav Simonsson bc45e5c6de Integrate eth_accounts and eth_transact to use new account manager
* Add from to eth_transact / xeth.Transact and add static pass in lieu
  of integrating with native Mist window for user passphrase entry
* Make eth_accounts return AccountManager.Accounts()
* Add a Generate Key menu item in Mist
2015-03-06 13:10:42 +00:00
obscuren c47866d251 Miner fixes and updates (including miner) 2015-03-05 09:14:58 +01:00
obscuren d4d505c868 Fixed genesis 2015-03-03 21:48:05 +01:00
obscuren 26de12d9bf Changed nonce to a uint64 2015-03-03 21:04:31 +01:00
obscuren 313fe3861b fixed pow stuff 2015-03-03 17:55:23 +01:00
obscuren 22b132e28f Merge branch 'publictests' of https://github.com/xcthulhu/go-ethereum into xcthulhu-publictests 2015-03-03 17:20:34 +01:00
obscuren 34ee5ab9a8 Bloom expanded by 4 2015-03-03 11:56:12 +01:00
Matthew Wampler-Doty de9f79133f Introducing ethash 2015-03-02 22:29:34 -05:00
Matthew Wampler-Doty 8653db6df0 Introducign MixDigest and SeedHash 2015-02-27 15:59:33 -05:00
obscuren 655e942597 Added GetBlock GetUncle with OOB guard 2015-02-18 13:14:21 +01:00
obscuren 32c7ebc51d Fixed mining & limited hash power 2015-02-14 16:52:14 +01:00
obscuren ce239333d5 Update balance label when mining 2015-02-13 18:15:23 +01:00
obscuren 65158d39b0 Filtering 2015-02-04 15:05:47 -08:00
obscuren b1870631a4 WIP miner 2015-02-04 05:53:22 -08:00
obscuren 67f9783e6a Moved `obscuren` secp256k1-go 2015-01-22 00:35:00 +01:00
obscuren db4aaedcbd Moved ptrie => trie. Removed old trie 2015-01-08 11:47:04 +01:00
obscuren fed3e6a808 Refactored ethutil.Config.Db out 2015-01-07 13:17:48 +01:00
obscuren 6abf8ef78f Merge 2015-01-05 17:10:42 +01:00
obscuren e2d1d832ef added nil check 2015-01-02 13:00:25 +01:00
obscuren 48d2a8b8ee Refactored tx pool and added extra fields to block
* chain manager sets td on block + td output w/ String
* added tx pool tests for removing/adding/validating
* tx pool now uses a set for txs instead of list.List
2015-01-02 12:09:38 +01:00
obscuren 2f8a45cd8b Fixed chain test & added new chain 2014-12-30 13:32:01 +01:00
obscuren 780abaec98 Switched to new trie 2014-12-23 18:35:36 +01:00
obscuren 9e5257b83b Chain importer 2014-12-23 14:33:15 +01:00
obscuren 4cd79d8ddd Refactored block & Transaction
* Includes new rlp decoder
2014-12-23 13:48:44 +01:00
obscuren 125bdc3253 Merge branch 'develop' into poc8
Conflicts:
	cmd/ethereum/flags.go
2014-12-20 02:45:05 +01:00
obscuren 0e93b98533 Transaction was generating incorrect hash because of var changes 2014-12-19 13:34:53 +01:00
obscuren 207b6c50fb Merge branch 'badsig' of https://github.com/ebuchman/go-ethereum into ebuchman-badsig
Conflicts:
	core/transaction_pool.go
2014-12-19 00:33:05 +01:00
obscuren 22d29a6d52 merge 2014-12-19 00:02:55 +01:00
obscuren 198cc69357 Gas corrections and vm fixes 2014-12-18 21:58:26 +01:00
obscuren 5ad473d758 Moved methods to messages 2014-12-18 15:33:22 +01:00
obscuren db494170dc Created generic message (easy for testing) 2014-12-18 15:18:13 +01:00
obscuren 0dc566124a Merge fixes 2014-12-18 13:22:59 +01:00
obscuren 49e0267fe7 Locks, refactor, tests
* Added additional chain tests
* Added proper mutex' on chain
* Removed ethereum dependencies
2014-12-18 13:12:54 +01:00
obscuren 1b98cbbfa4 Moved pow 2014-12-10 16:45:16 +01:00
obscuren d80f8bda94 Fixed issue in VM where LOG didn't pop anything of the stack 2014-12-05 12:32:47 +01:00
obscuren 3043b233ea Log is now interface 2014-12-04 12:35:23 +01:00
obscuren f298ffdbb8 Renamed State => StateDB 2014-12-04 11:40:20 +01:00
obscuren 9008b155d3 Renamed `chain` => `core` 2014-12-04 10:28:02 +01:00