Commit Graph

335 Commits

Author SHA1 Message Date
Péter Szilágyi
b37d175e59
accounts, internal, mobile: polish accounts API, extend Android tests 2017-01-05 12:58:03 +02:00
Jeffrey Wilcke
bbc4ea4ae8 core/vm: improved EVM run loop & instruction calling (#3378)
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.
2017-01-05 11:52:10 +01:00
Péter Szilágyi
08eea0f0e4 accounts, core, crypto, internal: use normalised V during signature handling (#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.
2017-01-05 11:35:23 +01:00
Felix Lange
12c964b2b7 internal/ethapi: fix hex handling for eth_call input and eth_sendRawTransaction 2016-12-20 14:46:22 +01:00
Felix Lange
cf71f5cd60 rpc: remove HexNumber, replace all uses with hexutil types
This change couldn't be automated because HexNumber was used for numbers
of all sizes.
2016-12-20 14:41:58 +01:00
Felix Lange
adab2e16bd rpc: remove HexBytes, replace all uses with hexutil.Bytes 2016-12-20 14:35:26 +01:00
Felix Lange
2be3c4b0e3 internal/jsre: fix built-in inspect function
inspect was broken by ffaf58f0a9 (May 2016!).
Looks like nobody uses this function.
2016-12-20 14:35:14 +01:00
Felix Lange
3e4a04f34d internal/ethapi: fix hex handling for eth_sign, personal_{sign,recover} 2016-12-16 11:32:51 +01:00
bas-vk
4e36b1e3da core: bugfix state change race condition in txpool (#3412)
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.
2016-12-10 23:54:58 +01:00
Jeffrey Wilcke
3fc7c97827 core, core/vm: implemented a generic environment (#3348)
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.
2016-12-06 02:16:03 +01:00
Viktor Trón
e949a2ed2f cmd/bzzd: swarm daemon fixes (#3359)
* cmd/bzzd: add missing p2p/discovery flags
* cmd/bzzd: fix two bugs crashing bzzd if bootnodes flag given
* cmd/bzzd: make no swap default, renamed flag bzznoswap->bzzswap
* internal/web3ext: correct methods for bzz IPC module
* cmd/bzzd: ethapi param not mandatory. Warning if no blockchain
* cmd/bzzd: correct default IPC modules in help string
* cmd/utils: fix help description for networkId - add Ropsten
* cmd/bzz, swarm/api, swarm/network: add swarm networkId flag
* cmd/bzzd: change nosync flag to sync and BootTFlag
2016-11-28 13:29:33 +01:00
Felix Lange
20899c05a4 internal/build: use 'git tag --points-at' to get the current tag
This should restore support for building with git 1.x.
2016-11-27 18:42:48 +01:00
Jeffrey Wilcke
6cc87a31c6 cmd/utils, internal/web3ext: removed httpGet 2016-11-25 12:31:06 +01:00
Felix Lange
01d5fc670b internal/web3ext: remove registrar-related extensions
(cherry picked from commit d54ad55c6079ae6eab93d7f34ce5c4ec829f8e5b)
2016-11-25 12:15:12 +01:00
Felix Lange
e1e2df656a internal/build: add support for git tag in local Environment
I didn't add this initially because the command I tried was too slow.
The 'git for-each-ref ...' invocation takes 40ms on my machine. That
ought to be acceptable.
2016-11-23 10:40:22 +01:00
Péter Szilágyi
b7dfd333c5
.travis, build: Build step to push .aar to Maven Central 2016-11-14 17:56:58 +02:00
Zsolt Felfoldi
b10bcd924b core/types: turn off nonce checking for Call messages 2016-11-14 14:16:06 +01:00
Jeffrey Wilcke
4dca5d4db7 core/types, params: EIP#155 2016-11-13 14:55:30 +01:00
Jeffrey Wilcke
445feaeef5 core, core/state, trie: EIP158, reprice & skip empty account write
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>
2016-11-13 10:44:04 +01:00
Felix Lange
b8bd9a71c8 all: update license information 2016-11-09 02:51:34 +01:00
Zsolt Felfoldi
9f8d192991 les: light client protocol and API 2016-11-09 02:12:53 +01:00
Felix Lange
8b1df1a259 build: fix remote path for archive uploads (#3243)
archiveUpload did not handle absolute paths correctly. Fix it by using
the basename and ensure that uploads can be tested using -n.
2016-11-08 23:46:46 +01:00
Péter Szilágyi
9bc97a5785 build: NSIS based Windows installer (#3240)
This commit adds support for creating Windows installers to ci.go
2016-11-08 22:55:39 +01:00
Péter Szilágyi
df30ef5177
internal/build: call correct signer method 2016-11-08 10:59:19 +02:00
Felix Lange
ed2bc7fbe9 build, internal/build: misc improvements (#3229)
* travis.yml: don't create darwin/386 builds

* build: remove godep remains

* internal/build: improve archives

- enable compression for zip files
- don't write half-complete archives

* build: add -unstable to archive names
2016-11-03 14:44:16 +02:00
Péter Szilágyi
3b62c145f8
travis, build: implement uploading archives to azure 2016-11-03 10:32:53 +02:00
Kenji Siu
d85d3c74db internal/debug, internal/ethapi, rpc, swarm/storage: Ran "go fmt" 2016-11-01 18:40:36 +08:00
Jeffrey Wilcke
4dc1fb923a Merge pull request #3064 from pirapira/limit_struct_logs
core/vm: add limit option to LogConfig
2016-10-31 12:07:43 +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
Péter Szilágyi
289b30715d Godeps, vendor: convert dependency management to trash (#3198)
This commit converts the dependency management from Godeps to the vendor
folder, also switching the tool from godep to trash. Since the upstream tool
lacks a few features proposed via a few PRs, until those PRs are merged in
(if), use github.com/karalabe/trash.

You can update dependencies via trash --update.

All dependencies have been updated to their latest version.

Parts of the build system are reworked to drop old notions of Godeps and
invocation of the go vet command so that it doesn't run against the vendor
folder, as that will just blow up during vetting.

The conversion drops OpenCL (and hence GPU mining support) from ethash and our
codebase. The short reasoning is that there's noone to maintain and having
opencl libs in our deps messes up builds as go install ./... tries to build
them, failing with unsatisfied link errors for the C OpenCL deps.

golang.org/x/net/context is not vendored in. We expect it to be fetched by the
user (i.e. using go get). To keep ci.go builds reproducible the package is
"vendored" in build/_vendor.
2016-10-28 19:05:01 +02:00
Felix Lange
66ee2dec53 internal/ethapi: add debug.chaindbCompact 2016-10-20 14:37:01 +02:00
Felix Lange
6952fe3a5c Merge pull request #3100 from kobigurk/develop
internal/ethapi, internal/web3ext: adds raw tx retrieval methods
2016-10-17 16:55:28 +02:00
Péter Szilágyi
81b01f1c2b Merge pull request #3111 from obscuren/gas-price-fork
core, core/vm: added gas price variance table (EIP #150)
2016-10-14 19:32:11 +03:00
Jeffrey Wilcke
64af2aafda core, core/vm: added gas price variance table
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.
2016-10-14 18:09:17 +02:00
Nick Johnson
9e9bfc4e26 metrics, internal/debug: Add --pprofaddr flag, expose metrics via gexp 2016-10-14 12:29:08 +01:00
Kobi Gurkan
1a6682c21d internal/ethapi, internal/web3ext: adds raw tx retrieval methods 2016-10-10 12:57:15 +03:00
Felix Lange
c88e435724 Merge pull request #3088 from bas-vk/rpc-block-output
core/types: renamed receiptRoot to receiptsRoot
2016-10-06 18:32:27 +02:00
Jeffrey Wilcke
7335a70a02 Merge pull request #3092 from fjl/state-journal
core/state: implement reverts by journaling all changes
2016-10-06 16:14:22 +02:00
Felix Lange
1f1ea18b54 core/state: implement reverts by journaling all changes
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!
2016-10-06 15:32:16 +02:00
Bas van Kervel
6c959207db internal/ethapi: bugfix gas price and limit swapped in eth_resend 2016-10-05 14:21:03 +02:00
Bas van Kervel
71e8ae01b8 core/types: renamed receiptRoot to receiptsRoot 2016-10-05 12:24:42 +02:00
Felix Lange
82e09c17a9 internal/build: fix git tag env variable for AppVeyor 2016-10-03 17:19:43 +02:00
Felix Lange
b4b5921dd0 internal/build: use less edgy command to get the branch name 2016-10-03 10:22:14 +02:00
Péter Szilágyi
d4b55fc5b2 Merge pull request #3066 from fjl/build-env
build: improve debian packaging
2016-10-02 14:44:30 +03:00
Felix Lange
4f7627972e build: improve debian packaging
This commit tweaks the debian packaging tool:

* All build environment metadata can now be overriden on the command
  line. This allows testing the CI build behaviour locally.
* -unstable packages now actually contain the binaries (oops)
* packages use Go 1.7 to build
* archiving is skipped for PR builds
2016-10-02 13:08:56 +02:00
Péter Szilágyi
cb84e3f029 cmd, core, internal, light, tests: avoid hashing the code in the VM 2016-10-01 16:01:58 +03:00
Yoichi Hirai
bb6115b737 vm, ethapi: add limit option to traceTransaction
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`.
2016-09-30 17:36:00 +02:00
Péter Szilágyi
710435b51b core, eth, trie: reuse trie journals in all our code 2016-09-28 11:27:31 +03:00
Felix Lange
a59a93f476 core/state: track all accounts in canon state
This change introduces a global, per-state cache that keeps account data
in the canon state. Thanks to @karalabe for lots of fixes.
2016-09-26 10:09:52 +02:00
Péter Szilágyi
2924fdfcf7 ethereum, ethclient: add SyncProgress API endpoint 2016-09-06 13:41:43 +03:00
Péter Szilágyi
0ef327bbee core, eth, internal, miner: optimize txpool for quick ops 2016-09-02 14:12:03 +03:00
Péter Szilágyi
795b70423e core, eth, miner: only retain 1 tx/nonce, remove bad ones 2016-09-02 14:12:03 +03:00
ΞTHΞЯSPHΞЯΞ
4d300e4dec swarm: plan bee for content storage and distribution on web3
This change imports the Swarm protocol codebase. Compared to the 'swarm'
branch, a few mostly cosmetic changes had to be made:

* The various redundant log message prefixes are gone.
* All files now have LGPLv3 license headers.
* Minor code changes were needed to please go vet and make the tests
  pass on Windows.
* Further changes were required to adapt to the go-ethereum develop
  branch and its new Go APIs.

Some code has not (yet) been brought over:

* swarm/cmd/bzzhash: will reappear as cmd/bzzhash later
* swarm/cmd/bzzup.sh: will be reimplemented in cmd/bzzup
* swarm/cmd/makegenesis: will reappear somehow
* swarm/examples/album: will move to a separate repository
* swarm/examples/filemanager: ditto
* swarm/examples/files: will not be merged
* swarm/test/*: will not be merged
* swarm/services/swear: will reappear as contracts/swear when needed
2016-08-31 16:19:40 +02:00
gregg dourgarian
8dbf59fec5 common,internal: typo/misspelling fixes (#2953) 2016-08-27 15:05:09 +03:00
Felix Lange
b0d9f7372a internal/ethapi: add missing output fields
- returned headers didn't include mixHash
- returned transactions didn't include signature fields
- empty transaction input was returned as "", but should be "0x"
- returned receipts didn't include the bloom filter
- "root" in receipts was missing 0x prefix
2016-08-04 01:40:50 +02:00
Nick Johnson
8923325d5c internal/ethapi: Fix bug in opCodeWrapper usage 2016-08-24 16:10:29 +01:00
Nick Johnson
d20238c2a7 internal/ethapi: Improve tracer error reporting and serialization 2016-08-24 13:17:55 +01:00
Nick Johnson
2f99720901 core/vm, eth: Add support for javascript trace functions 2016-08-23 15:06:39 +01:00
Nick Johnson
781915f183 core/vm: Refactor tracing to make Tracer the main interface
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.
2016-08-22 09:26:15 +01:00
Felix Lange
475521dd74 Merge pull request #2909 from fjl/account-manager-cleanup
all: clean up tech debt left behind by the API split
2016-08-17 20:59:59 +02:00
Felix Lange
1a9e66915b common/compiler: simplify solc wrapper
Support for legacy version 0.9.x is gone. The compiler version is no
longer cached. Compilation results (and the version) are read directly
from stdout using the --combined-json flag. As a workaround for
ethereum/solidity#651, source code is written to a temporary file before
compilation.

Integration of solc in package ethapi and cmd/abigen is now much simpler
because the compiler wrapper is no longer passed around as a pointer.

Fixes #2806, accidentally
2016-08-17 17:39:04 +02:00
Bas van Kervel
47ff813012 rpc: refactor subscriptions and filters 2016-08-17 12:59:58 +02:00
Felix Lange
b8ba80bff7 Merge pull request #2740 from Firescar96/removepeer
node, p2p, internal: Add ability to remove peers via admin interface
2016-07-29 12:34:28 +02:00
Felix Lange
91b7690428 rpc: add new client, use it everywhere
The new client implementation supports concurrent requests,
subscriptions and replaces the various ad hoc RPC clients
throughout go-ethereum.
2016-07-22 23:21:27 +02:00
Bas van Kervel
4ee00b2309 eth/api: rename signAndSendTransaction to sendTransaction 2016-07-22 13:12:14 +02:00
Firescar96
4c3da0f2e1 node, p2p, internal: Add ability to remove peers via admin interface 2016-07-14 18:51:41 -04:00
zsfelfoldi
00787fe781 core: added CheckNonce() to Message interface 2016-07-11 12:35:23 +02:00
Péter Szilágyi
1e50f5dd28 Merge pull request #2159 from zsfelfoldi/light-backend
eth: separate common and full node-specific API and backend service
2016-06-30 12:57:50 +03:00
Justin Clark-Casey
9eb50a9624 web3ext: Remove old natspec Admin_JS stubs
This stops them from showing up on the javascript console.
2016-06-23 22:34:53 +01:00
Felix Lange
6c33ba14a4 build: add ci.go, use it everywhere
The new build script, ci.go, replaces some of the older shell scripts.
ci.go can compile go-ethereum, run the tests, create release archives
and debian source packages.
2016-06-22 13:42:39 +02:00
zsfelfoldi
3a97280ae8 eth: separate common and full node-specific API and backend service 2016-06-16 17:36:38 +02:00
Bas van Kervel
861add3d72 cmd/geth: codegansta/cli package renamed to urfave/cli 2016-06-09 15:37:13 +02:00
Felix Lange
fdba0cb03c internal/jsre: ensure Stop can be called more than once
This makes "geth js file.js" terminate again.
2016-06-02 22:49:33 +02:00
Péter Szilágyi
14ae5708d6 console, internal/jsre: colorize JavaScript exceptions too 2016-05-30 17:25:23 +03:00
Péter Szilágyi
ffaf58f0a9 cmd, console: split off the console into a reusable package 2016-05-30 17:25:23 +03:00
Bas van Kervel
64a6c2c1b6 eth: add new RPC method (personal.) SignAndSendTransaction 2016-05-20 15:54:18 +02:00
Péter Szilágyi
bc6fdad786 cmd/geth, internal/web3ext, rpc: surface rpc module, fix shh, fix miner 2016-05-11 11:49:44 +03:00
Felix Lange
ae9ed5c420 internal/debug: also rename debug_startTrace to debug_startGoTrace
This was missing from the previous change.
2016-05-06 11:15:05 +02:00
Felix Lange
844e911129 internal/debug: rename debug_trace to debug_goTrace
Reduces confusion with EVM execution tracing methods.
2016-05-06 10:27:24 +02:00
Ales Katona
572da73d4d eth: add personal_importRawKey for runtime private key import 2016-04-28 09:11:40 -06:00
Felix Lange
e728aaca72 rpc: move web3.js extensions to internal/web3ext 2016-04-15 17:36:01 +02:00
Felix Lange
bea56d84e5 internal/debug: add memStats and gcStats to API 2016-04-13 12:08:07 +02:00
Felix Lange
c1343c8872 cmd/utils, internal/debug: show all stacks for 10x Ctrl-C induced panic
Go 1.6 only prints stacks for the current goroutine by default,
but for this panic we want to see all of them.
2016-03-12 00:59:37 +01:00
Felix Lange
cafdd5931e internal/debug: don't disable heap profile collection by default
Setting runtime.MemProfileRate to 0 through the flag default
value makes it impossible to get an 'in-use' profile.
2016-03-12 00:41:34 +01:00
Felix Lange
3750d835a1 internal/debug: APIs for profiling and tracing
The debug package provides an RPC wrapper for glog settings and the
debugging facilities of the Go runtime. They can be triggered through
both command line flags and the IPC listener.
2016-01-28 13:36:11 +01:00