Commit Graph

50 Commits

Author SHA1 Message Date
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
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
zsfelfoldi 00787fe781 core: added CheckNonce() to Message interface 2016-07-11 12:35:23 +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
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
Gustav Simonsson b81a6e6ab8 core, core/vm, core/state: remove unused functions 2015-09-10 21:10:58 +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
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
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 ea54283b30 all: update license information 2015-07-07 14:12:44 +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
Felix Lange 11b8d1df59 core/types: cache computed transaction values 2015-06-29 18:51:48 +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
Gustav Simonsson 32e1b104f8 Add EC signature validations before call to libsecp256k1 2015-06-01 21:06:52 +02:00
Felix Lange 574d5d6ae6 core/types: add rlp tag "nil" for Transaction.Recipient 2015-04-17 14:45:10 +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 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
obscuren 505f1fbcbb added tx tests and fixed block tests 2015-03-25 17:05:29 +01:00
obscuren c28116cb3b Fixed incorrect recipient derived 2015-03-21 14:46:50 +01:00
Felix Lange c298148a7f core/types: use package rlp instead of common.Decode 2015-03-18 13:24:34 +01:00
Felix Lange e91ab84dbe core/types: don't use Address zero value for invalid addresses 2015-03-17 11:58:31 +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
Felix Lange 16df850af2 core/types: use common.{Hash,Address} in for transactions 2015-03-16 17:43:42 +01:00
obscuren b523441361 Moved ethutil => common 2015-03-16 11:27:38 +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 67f9783e6a Moved `obscuren` secp256k1-go 2015-01-22 00:35:00 +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 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 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 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