Commit Graph

1497 Commits

Author SHA1 Message Date
Jeffrey Wilcke 57f4e90257 Revert "params: core, core/vm, miner: 64bit gas instructions (#3514)"
This reverts commit 8b57c49490.
2017-02-13 15:15:12 +01:00
Péter Szilágyi f8f428cc18 Merge pull request #3592 from karalabe/hw-wallets
accounts: initial support for Ledger hardware wallets
2017-02-13 15:03:16 +02:00
Viktor Trón e23e86921b swarm/network: fix chunk integrity checks (#3665)
* swarm/network: integrity on incoming known chunks
* swarm/network: fix integrity check for incoming chunks
* swarm/storage: imrpoved integrity checking on chunks
* dbstore panics on corrupt chunk entry an prompts user to run cleandb
* memstore adds logging for garbage collection
* dbstore refactor item delete. correct partial deletes in Get
* cmd/swarm: added cleandb subcommand
2017-02-13 13:20:50 +01:00
gluk256 65ed6a9def whisper: add tests for mailserver (#3631) 2017-02-13 13:15:20 +01:00
Péter Szilágyi e99c788155
accounts: ledger and HD review fixes
- Handle a data race where a Ledger drops between list and open
- Prolong Ledger tx confirmation window to 30 days from 1 minute
- Simplify Ledger chainid-signature calculation and validation
- Simplify Ledger USB APDU request chunking algorithm
- Silence keystore account cache notifications for manual actions
- Only enable self derivations if wallet open succeeds
2017-02-13 14:00:12 +02:00
Péter Szilágyi 26cd41f0c7
accounts/usbwallet: make wallet responsive while Ledger is busy 2017-02-13 14:00:10 +02:00
Péter Szilágyi 205ea95802
accounts, cmd, internal, node: implement HD wallet self-derivation 2017-02-13 14:00:09 +02:00
Péter Szilágyi c5215fdd48
accounts, cmd, internal, mobile, node: canonical account URLs 2017-02-13 14:00:08 +02:00
Péter Szilágyi fad5eb0a87
accounts, cmd, eth, internal, miner, node: wallets and HD APIs 2017-02-13 14:00:07 +02:00
Péter Szilágyi 833e4d1319
accounts, cmd, eth, internal, mobile, node: split account backends 2017-02-13 14:00:02 +02:00
Zahoor Mohamed 085987ff2c cmd/swarm: manifest manipulation commands (#3645) 2017-02-13 03:33:05 +01:00
Péter Szilágyi 0cc9409fda Merge pull request #3648 from bas-vk/abigen
cmd/abigen: parse contract name as abi identifier
2017-02-10 12:11:43 +02:00
Bas van Kervel d0eeb3ebdc cmd/abigen: parse contract name as abi identifier 2017-02-06 18:16:56 +01:00
Jeffrey Wilcke 8b57c49490 params: core, core/vm, miner: 64bit gas instructions (#3514)
Reworked the EVM gas instructions to use 64bit integers rather than
arbitrary size big ints. All gas operations, be it additions,
multiplications or divisions, are checked and guarded against 64 bit
integer overflows.

In additon, most of the protocol paramaters in the params package have
been converted to uint64 and are now constants rather than variables.

* common/math: added overflow check ops
* core: vmenv, env renamed to evm
* eth, internal/ethapi, les: unmetered eth_call and cancel methods
* core/vm: implemented big.Int pool for evm instructions
* core/vm: unexported intPool methods & verification methods
* core/vm: added memoryGasCost overflow check and test
2017-02-02 15:25:42 +01:00
Felix Lange 9c45b4462c Merge pull request #3607 from zsfelfoldi/light-fix2
les: fix private net issues, enable adding peers manually again
2017-02-01 02:03:43 +01:00
gluk256 690f6ea1d7 cmd/wnode, whisper: add whisper CLI tool and mail server (#3580) 2017-01-31 11:16:20 +01:00
Péter Szilágyi 1c140f7382 Merge pull request #3615 from nolash/bzzpathfix_real5
cmd/swarm, swarm/api: bzzr improve + networkid prio
2017-01-30 16:36:30 +02:00
Shintaro Kaneko 355a42f36d cmd/geth, cmd/swarm: Fix to close file handler appropriately 2017-01-30 01:10:19 +09:00
nolash 7669c5b5ec cmd/swarm, swarm/api: bzzr improve + networkid prio
fixes #3444
fixes #3494
networkid override

Added comments to explain why test against 0 appears twice

* Command line overrides saved config, saved config overrides system default

---

fixes #3476
bzzr get with path

Finally a hopefully clean commit for this PR
Added check for empty path to avoid SIGSEGV in path parser and resolver
Added requested tests for empty path and non-existing manifest.
However signature for StartHTTPServer had changed.
Now it's hacked as so:

	StartHttpServer(api.API, &Server{Addr: "127.0.0.1:8504", CorsString: ""})

* Parse url before resolve when path and ENS is supplied, example
* swarm/api/http proxy server test for retrieval of subpath through get
* Removed nil entry assignment on subtrie leaf in recursive key retrieval
* Cleaned up path-or-no-path condition in proxy server get handler
* swarm: processed with gofmt refers to lash/go-ethereum@90daa7a
* swarm: Added public access method Parse alias to parse
* swarm: processed with gofmt References nolash/go-ethereum@2ec3fd7
* Rename parse to Parse, removed alias
2017-01-27 08:18:13 +01:00
Zsolt Felfoldi a390ca5f30 les, cmd/util: disable topic discovery with --nodiscover 2017-01-27 02:52:45 +01:00
Martin Holst Swende 935d891e9d cmd/evm: added debug flag (back) (#3554)
* evm: added debug flag (back)

* cmd/evm: gofmt
2017-01-22 22:14:09 +01:00
Péter Szilágyi d63752ef4d Merge pull request #3579 from bas-vk/natspec
cmd,eth,les,internal: remove natspec support
2017-01-17 14:38:57 +02:00
Nick Johnson 17d92233d9 cmd/geth, core: add support for recording SHA3 preimages (#3543) 2017-01-17 12:19:50 +01:00
Bas van Kervel 54a65e6d87
cmd,eth,les,internal: remove natspec support 2017-01-17 12:13:50 +01:00
Bas van Kervel 745a3adebd
core: remove support for Olympic network 2017-01-12 09:50:54 +01:00
Péter Szilágyi b52fde7cf7 Merge pull request #3546 from fjl/deps-update
vendor: update dependencies
2017-01-11 12:14:08 +02:00
Felix Lange d78f9b834a vendor: update all dependencies except Azure SDK
The Azure SDK doesn't support Go 1.5 anymore. We can't upgrade it until
Go 1.8 comes out.
2017-01-10 22:33:24 +01:00
Felix Lange 445deb7470 cmd/utils: fix comma-separated --bootnodes 2017-01-10 21:13:43 +01:00
Péter Szilágyi 02b67558e8 Merge pull request #3535 from fjl/all-ineffassign
all: fix ineffectual assignments
2017-01-09 23:53:17 +02:00
Felix Lange b9b3efb09f all: fix ineffectual assignments and remove uses of crypto.Sha3
go get github.com/gordonklaus/ineffassign
ineffassign .
2017-01-09 16:24:42 +01:00
Viktor Trón 3f1a72908c cmd/swarm: uploader uses HTTP PUT for directories (#3488) 2017-01-09 15:19:56 +01:00
Valentin Wüstholz 0a5450fe04 cmd/disasm: fix array-out-of-bounds error (#3491) 2017-01-08 01:18:22 +01:00
Péter Szilágyi 18c77744ff
all: fix spelling errors 2017-01-06 19:44:35 +02:00
Felix Lange 13e3b2f433 logger, pow/dagger, pow/ezp: delete dead code 2017-01-06 18:18:07 +01:00
Felix Lange f2da6581ba all: fix issues reported by honnef.co/go/simple/cmd/gosimple 2017-01-06 18:18:07 +01:00
Felix Lange 35a7dcb162 all: gofmt -w -s 2017-01-06 15:52:03 +01:00
Péter Szilágyi 8f9daaa3ba Merge pull request #3518 from fjl/ethclient-dependency-cleanup
core/types: dependency cleanup
2017-01-06 15:42:03 +02:00
Felix Lange 7731061903 core/vm: move Log to core/types
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.
2017-01-06 14:15:22 +01:00
Felix Lange b9683d3748 params: avoid importing p2p/discover for bootnodes
params is imported by leaf-ish library packages and should not pull in
the p2p stack.
2017-01-06 14:15:21 +01:00
Maran f087633efd swarm/api/http: add support for CORS headers (#3388) 2017-01-05 11:57:41 +01:00
Péter Szilágyi bbce726c8a Merge pull request #3515 from bas-vk/exportropsten
core,cmd/utils: bugfix for ropsten dump imports
2017-01-05 12:54:45 +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 06b381d1c9 cmd/utils: disallow `--fakepow` for live operation (#3512) 2017-01-05 11:40:56 +01:00
Bas van Kervel a1798a8188
core,cmd/utils: bugfix for ropsten dump imports 2017-01-05 11:31:57 +01:00
Péter Szilágyi 2ce30382d9
cmd/utils, eth, les: bubble --fakepow flag into eth/les too 2017-01-04 10:42:41 +02:00
Valentin Wüstholz bdaa43510b cmd/disasm: fix off-by-one error and improve error handling (#3482) 2016-12-22 00:37:27 +01:00
Péter Szilágyi 49c6f1053c Merge pull request #3421 from ethersphere/s/swarm-cmd
cmd/swarm: one command  with subcommands
2016-12-14 12:26:20 +02:00
Péter Szilágyi fdb8edf5ea Merge pull request #3427 from Arachnid/gzipdump
cmd/utils, eth: Add gzip support for chain dump and restore
2016-12-14 11:15:21 +02:00
Nick Johnson 9ba9fe818d cmd/utils, eth: Add gzip support for chain dump and restore 2016-12-14 08:59:55 +00:00
zelig 92224d27b1 cmd/swarm: testnet bootnodes IP address change 2016-12-14 08:14:52 +01:00
Péter Szilágyi b63138c3ec
cmd/geth: drop legacy android code 2016-12-13 18:17:49 +02:00
zelig 485748c416 cmd/swarm: improve uploader output and add defaultpath option 2016-12-13 12:54:13 +01:00
zelig 080699f7df cmd/swarm: ethapi not required 2016-12-13 12:54:13 +01:00
zelig 8e35f54931 cmd/swarm: trim trailing slash from bzzapi url 2016-12-13 12:54:13 +01:00
zelig d44f1a77ee cmd/swarm: add default bootnodes for testnet 3 2016-12-13 12:54:13 +01:00
zelig 4181046488 swarm/network, cmd/swarm: swarm default network id is 3 (to match Ropsten) 2016-12-13 12:54:13 +01:00
zelig 5f5d0aa4ff cmd/swarm: subsume cmd/bzz* as subcommands under swarm
cmd/swarm: subsume cmd/bzz* under cmd/swarm as subcommands
2016-12-13 12:54:05 +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
Péter Szilágyi 86f9e836be cmd/geth: tidied up the source (#3385)
cmd/geth: tidied up the source
2016-11-30 13:34:24 +02:00
Luca Zeug 3363a1c227 cmd/utils: update helpscreen's testnet description (#3377) 2016-11-29 16:23:11 +02:00
Péter Szilágyi 7267f796e6
cmd: drop DAO related choice flags since ETC diverged 2016-11-29 15:50:27 +02: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
Péter Szilágyi 4c8c5e2f74 cmd, ethstats, les, mobile, params: native netstats (#3336) 2016-11-25 16:55:06 +01:00
Felix Lange d1a95c643e Merge pull request #3325 from fjl/p2p-netrestrict
Prevent relay of invalid IPs, add --netrestrict
2016-11-25 13:59:18 +01:00
Jeffrey Wilcke 6cc87a31c6 cmd/utils, internal/web3ext: removed httpGet 2016-11-25 12:31:06 +01:00
Felix Lange 586f10ecb1 cmd/utils, VERSION: 1.5.4 unstable 2016-11-24 23:06:25 +01:00
Felix Lange 978737f5d5 cmd/utils: 1.5.3 stable 2016-11-24 23:03:13 +01:00
Jeffrey Wilcke a8ca75738a core: implemented new ropsten testnet 2016-11-23 09:34:01 +01:00
Jeffrey Wilcke aad4890082 cmd/geth, core, light, mobile: removed state account StartingNonce
All account's nonce start at 0.
2016-11-23 09:34:01 +01:00
Felix Lange e5edd3b983 cmd/bootnode, cmd/geth, cmd/bzzd: add --netrestrict 2016-11-22 22:21:18 +01:00
Aron Fischer 0d9a8207d6 cmd/bzzup: trim directory in the manifest entry path (#3299) 2016-11-18 14:41:37 +01:00
Nick Johnson e1c1fce92c cmd/utils, VERSION: 1.5.3 unstable (#3306) 2016-11-18 12:33:47 +01:00
Nick Johnson 9b95112a2d cmd/utils: Set version string to stable (#3304) 2016-11-18 11:57:48 +01:00
Sudhir Upadhyay 5806b453a9 implemented node permissioning 2016-11-17 18:50:28 -05:00
Felix Lange 20eab80189 cmd/utils, VERSION: 1.5.2 unstable 2016-11-17 14:40:32 +01:00
Jeffrey Wilcke b81baf5423 utils: bump stable 2016-11-16 10:46:22 +01:00
Péter Szilágyi 64359c9417 cmd/utils, mobile, params: set the correct field on testnet EIP 155 (#3272) 2016-11-16 00:46:40 +01:00
Felix Lange a96d6c68e2 cmd/utils: remove jit flag handling (#3273)
The jit config options are not handled, but random selection still took
place, printing confusing messages.
2016-11-15 22:20:18 +01:00
Bas van Kervel 9bb4635f70 cmd,eth enforce gas price of 0 2016-11-15 18:40:08 +01:00
Jeffrey Wilcke fd27393df3 utils: unstable 1.5.1 2016-11-15 00:40:40 +01:00
Jeffrey Wilcke 233950da40 utils: stable 1.5.0 2016-11-15 00:39:12 +01:00
Jeffrey Wilcke a672eae3d1 core, core/types: refactored tx chain id checking (#3257)
* core, core/types: refactored tx chain id checking

Refactored explicit chain id checking in to the Sender deriviation method

* cmd/utils, params: define chain ids
2016-11-14 21:37:13 +01:00
Jeffrey Wilcke 7a6c6ec946 cmd/utils, params: define chain ids 2016-11-14 17:23:39 +01:00
Péter Szilágyi dfe79cc784
cmd/utils, mobile: place bootnodes in LGPL packages 2016-11-14 18:00:14 +02:00
Péter Szilágyi 4a439c2359
mobile: port wrappers to EIP155 and EIP158 fork 2016-11-14 18:00:14 +02:00
Péter Szilágyi b61f48e5aa
cmd, mobile, node, p2p: surface the discovery V5 bootnodes 2016-11-14 18:00:14 +02:00
Péter Szilágyi de4b39a1a3
cmd/utils, mobile: update to reprice HF and light client 2016-11-14 17:56:58 +02:00
Péter Szilágyi 178da7c6a9
mobile: initial wrappers for mobile support 2016-11-14 17:56:58 +02:00
Jeffrey Wilcke a91908e567 tests: updated 2016-11-13 23:26:07 +01:00
Jeffrey Wilcke ae33883c2f cmd/utils: set temporary HF number 2016-11-13 15:50:32 +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 8247bccf71 cmd/bzzhash: add swarm hashing tool 2016-11-11 00:15:21 +01:00
Felix Lange bbf37c0404 cmd/bzzup: add swarm upload tool 2016-11-11 00:15:21 +01:00
Felix Lange e336b0d60e cmd/bzzd: add swarm server daemon 2016-11-11 00:15:21 +01:00
Felix Lange d27472cc74 cmd/v5test: delete the v5test tool 2016-11-10 17:46:45 +01:00
Kenji Siu 80ea44c485 cmd/geth: improve command help messages (#3227) 2016-11-10 13:00:09 +02:00
Péter Szilágyi 4cd2617848
cmd/geth: reinstate dropped --cache flag 2016-11-09 19:18:20 +02:00
xiekeyang 5b31794dfe cmd/geth: use a loop in TestDAOForkBlockNewChain (#3222) 2016-11-09 03:15:48 +01:00
Felix Lange b8bd9a71c8 all: update license information 2016-11-09 02:51:34 +01:00
Zsolt Felfoldi 49da42983a p2p/discv5: added new topic discovery package 2016-11-09 02:12:53 +01:00
zsfelfoldi 7db7109a5b cmd, eth: added light client and light server modes 2016-11-09 02:12:53 +01:00
Bas van Kervel 936e7473bb quorum: Add README and example files 2016-11-03 15:59:33 +01:00
Jeffrey Wilcke 763f939f47 core, core/vm: dual state & read only EVM
This commit implements a dual state approach. The dual state approach
separates public and private state by making the core vm environment
context aware.

Although not currently implemented it will need to prohibit value
transfers and it must initialise all transactions from accounts on the
public state. This means that sending transactions increments the
account nonce on the public state and contract addresses are derived
from the public state when initialised by a transaction. For obvious
reasons, contract created by private contracts are still derived from
public state.

This is required in order to have consensus over the public state at all
times as non-private participants would still process the transaction on
the public state even though private payload can not be decrypted. This
means that participants of a private group must do the same in order to
have public consensus. However the creation of the contract and
interaction still occurs on the private state.

It implements support for the following calling model:

S: sender, (X): private, X: public, ->: direction, [ ]: read only mode

1. S -> A -> B
2. S -> (A) -> (B)
3. S -> (A) -> [ B -> C ]

It does not support

1. (S) -> A
2. (S) -> (A)
3. S -> (A) -> B

Implemented "read only" mode for the EVM. Read only mode is checked
during any opcode that could potentially modify the state. If such an
opcode is encountered during "read only", it throws an exception.

The EVM is flagged "read only" when a private contract calls in to
public state.
2016-11-01 12:57:26 +01:00
Felix Lange 87670a7ac1 all: remove weird files 2016-10-30 11:02:34 +01:00
Bas van Kervel f7cb85824c quorum integration 2016-10-30 09:20:48 +01:00
Péter Szilágyi 63d293cdbe Merge pull request #3195 from karalabe/fix-testnet-fastsync
cmd/utils, core, params: explicitly pick reprice fork for fast sync
2016-10-29 17:21:26 +03:00
Péter Szilágyi f0dbec0c93
cmd, params: only set default fork configs for test and mainnet 2016-10-29 17:07:07 +03:00
gluk256 79789af2e7 whisper: project restructured, version 5 introduced (#3022)
whisper: project restructured, version 5 introduced

This commits adds a draft version of the new shh v5 protocol.
The new version is not on by default, --shh still selects version 2.
2016-10-29 14:11:37 +02:00
Péter Szilágyi 8639b0fae9
cmd/utils, core, params: explicitly pick reprice fork for fast sync 2016-10-29 12:10:00 +03:00
Nick Johnson 00665a0b72 cmd/evm: Allow stdin and files as sources of bytecode (#3172)
* cmd/evm: Allow stdin and files as sources of bytecode

* cmd/evm: Print and exit instead of panicing

* cmd/evm: fix compile and vet errors
2016-10-29 12:07:38 +03: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
Péter Szilágyi 1291778032
cmd/geth, code, eth/downloader: tune import logs and mem stats 2016-10-21 12:23:39 +03:00
Péter Szilágyi 88a593d559
cmd/geth, trie: report on trie cache unloads, also add debug log 2016-10-19 17:31:19 +03:00
Péter Szilágyi 4f46bd19d0
cmd, core/state: allow configurable trie cache generations 2016-10-19 14:55:13 +03:00
Péter Szilágyi 2bb5ec1e41
cmd/geth, trie: track and report trie cache misses 2016-10-19 14:12:35 +03:00
Péter Szilágyi a1c63e8be6
cmd/geth: compact and print database stats after an import 2016-10-18 13:45:16 +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
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
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
Felix Lange 44bc2e80dd Merge pull request #2914 from fjl/node-coinhabit
cmd/utils, node: make datadir reusable for bzzd
2016-09-29 14:24:37 +02:00
Felix Lange b04219fdbb cmd/utils: don't check for stderr redirect on windows
The redirect check did not work on Go 1.6 and below because Stat
returned an error for stdout and stderr. In Go 1.7 Stat works on stdout
but doesn't return anything meaningful, causing cmd/geth test failures
because the message is printed to stderr only. Fix it by printing to
stdout only.
2016-09-26 17:35:19 +02:00
Felix Lange b42a5b118f common, node: move datadir defaults into package node 2016-09-16 15:24:31 +02:00
Felix Lange eeb322ae64 node: ensure datadir can be co-inhabited by different instances
This change ensures that nodes started with different Name but same
DataDir values don't use the same nodekey and IPC socket.
2016-09-16 15:24:31 +02:00
Péter Szilágyi 30860491ba cmd, eth: drop the blockchain version from cli/eth configs 2016-09-15 14:09:47 +03:00
Felix Lange de54273f51 cmd/geth: fix port clash in genesis test 2016-09-05 13:24:11 +02:00
Felix Lange 6b727c0440 cmd/evm, cmd/geth, cmd/utils: move version handling to cmd/utils 2016-09-05 13:24:11 +02:00
Felix Lange 1d7d1a3499 contracts/release: move package release to contracts/
This change also deletes generator.go, moving the only interesting line
in it into release.go. The binding has been regenerated with abigen from
develop and solc v0.3.6.
2016-08-29 19:25:05 +02:00
Hellsegga 6bd9008025 cmd/geth: set correct initial nonce on testnet for import/init subcommands (#2924) 2016-08-23 11:36:40 +03:00
Felix Lange 7d9c5e0f7d Merge pull request #2928 from obscuren/remove-dao-message
cmd/utils: removed DAO oppose / support message
2016-08-22 15:33:00 +02:00
Péter Szilágyi d8cec35b10 Merge pull request #2927 from obscuren/license
cmd/geth: added copyright and license information
2016-08-22 12:38:05 +03:00
Jeffrey Wilcke 5fff491bbd cmd/geth: added copyright and license information
As per GNU GPL requirement I've added the copyright and the license
information as a subcommand as well as a copyright notice when
displaying the help command.
2016-08-22 11:17:23 +02: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
Jeffrey Wilcke 5b44a819d3 cmd/utils: removed DAO oppose / support message 2016-08-21 23:55:53 +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
Felix Lange 312263c7d9 cmd/utils, node: create account manager in package node
The account manager was previously created by packge cmd/utils as part
of flag processing and then passed down into eth.Ethereum through its
config struct. Since we are starting to create nodes which do not have
eth.Ethereum as a registered service, the code was rearranged to
register the account manager as its own service. Making it a service is
ugly though and it doesn't really fix the root cause: creating nodes
without eth.Ethereum requires duplicating lots of code.

This commit splits utils.MakeSystemNode into three functions, making
creation of other node/service configurations easier. It also moves the
account manager into Node so it can be used by those configurations
without requiring package eth.
2016-08-17 17:39:03 +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
Felix Lange 65f340bb95 Merge pull request #2821 from Arachnid/discover-enode
cmd/bootnode: Add support for outputting a node's ID on the command line
2016-07-19 18:53:22 +02:00
Péter Szilágyi 993b412160 cmd/utils, eth: display the user's current fork, minor text tweak 2016-07-16 12:38:37 +03:00
Péter Szilágyi 2c2e389b77 cmd, core, eth, miner, params, tests: finalize the DAO fork 2016-07-15 16:52:55 +03:00
Péter Szilágyi 461cdb593b core, params, tests: add DAO hard-fork balance moves 2016-07-15 16:52:55 +03:00
Péter Szilágyi a87089fd2d cmd, core, miner: add extradata validation to consensus rules 2016-07-15 16:52:55 +03:00
Péter Szilágyi 1e24c2e4f4 cmd/geth, miner, params: special extradata for DAO fork start 2016-07-15 16:52:55 +03:00
Péter Szilágyi 9e56811a37 core: gracefully handle missing homestead block config 2016-07-15 16:52:55 +03:00
Péter Szilágyi 6060e098c9 cmd, core, eth, params: implement flags to control dao fork blocks 2016-07-15 16:52:55 +03:00
Nick Johnson 91130ea3fc cmd/bootnode: Add support for outputting a node's ID on the command line 2016-07-15 11:09:37 +01:00
Matthew Di Ferrante 68b48cc045 cmd/geth: print version on geth start (#2622) 2016-07-12 14:43:15 +02:00
Péter Szilágyi 96dc42d99c cmd, common, console, eth, release: drop redundant "full"s 2016-06-30 13:03:26 +03: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
Péter Szilágyi f127799d79 Merge pull request #2750 from sybiload/develop
cmd/geth: fix the import error message
2016-06-29 14:12:46 +03:00
Yohann LEON 6b1d73446d cmd/geth: fix the import error message
cmd/geth: include the error message on import failure
2016-06-29 13:08:32 +02:00
Péter Szilágyi 6362a9d610 Revert "test, cmd/evm, core, core/vm: illegal code hash implementation"
This reverts commit 7a5b571c67.
2016-06-29 11:44:51 +03:00
Péter Szilágyi d55fc35df1 Revert "core: add voting and result tracking for the dao soft-fork"
This reverts commit c4de28938f.
2016-06-29 11:44:40 +03:00
Péter Szilágyi 67e9d33486 Revert "core: update DAO soft-fork number, clean up the code"
This reverts commit ba784bdf36.
2016-06-29 11:44:29 +03:00
Péter Szilágyi ba784bdf36 core: update DAO soft-fork number, clean up the code 2016-06-23 17:16:43 +03:00
Péter Szilágyi c4de28938f core: add voting and result tracking for the dao soft-fork 2016-06-23 16:43:35 +03:00
Jeffrey Wilcke 7a5b571c67 test, cmd/evm, core, core/vm: illegal code hash implementation
This implements a generic approach to enabling soft forks by allowing
anyone to put in hashes of contracts that should not be interacted from.
This will help "The DAO" in their endevour to stop any whithdrawals from
any DAO contract by convincing the mining community to accept their code
hash.
2016-06-22 11:38:25 +03:00
zsfelfoldi 3a97280ae8 eth: separate common and full node-specific API and backend service 2016-06-16 17:36:38 +02:00
Péter Szilágyi 79ada05756 Merge pull request #2693 from obscuren/evm-bin-create
cmd/evm: added --create flag indicating the exec code is to be created
2016-06-15 11:35:34 +03:00
Tosh Camille ac66d96c5a cmd/utils: add space between "to" and filename 2016-06-15 11:02:22 +03:00
Jeffrey Wilcke e5165aeb27 cmd/evm: added --create flag indicating the exec code is to be created
This fixes an issue if you wanted to test out code deployment rather
than running a piece of code with an argument. This solves it by adding
a --create flag that indicates the Create function should be used rather
than the Call function.

This also adds a statedb.commit call so that the proper state can be
dumped when requested using the --dump flag.
2016-06-14 17:11:33 +02:00
Jeffrey Wilcke a38be3eb48 Merge pull request #2455 from zsfelfoldi/chaindb
core: improved chain db performance by using sequential keys
2016-06-13 15:16:09 +02:00
Péter Szilágyi 90e07b19ab cmd: fix CLI package deprecation warnings 2016-06-10 11:23:00 +03:00
Bas van Kervel 861add3d72 cmd/geth: codegansta/cli package renamed to urfave/cli 2016-06-09 15:37:13 +02:00
Péter Szilágyi 7c0eb47dfb cmd/geth: fix the keystore path in the accounts help text 2016-06-08 17:00:18 +03:00
Péter Szilágyi 32258af87b cmd/geth: truly randomize console test RPC endpoints 2016-06-08 13:53:07 +03:00
zsfelfoldi f9917c8c7b core: improved chainDb using sequential keys 2016-06-07 16:38:56 +02:00
Felix Lange b57b6e341e cmd/geth: make console tests more robust
* use --port 0 to avoid p2p port conflicts
* use --maxpeers 0 so it doesn't connect to bootstrap nodes
* use geth.expectExit() to wait for termination
2016-06-03 11:08:55 +02:00
Péter Szilágyi da729e5b38 cmd/geth, console: fix reviewer issues 2016-05-31 10:59:38 +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
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
Bas van Kervel 64a6c2c1b6 eth: add new RPC method (personal.) SignAndSendTransaction 2016-05-20 15:54:18 +02:00
Felix Lange 86da6feb40 cmd/geth: fix console history exclusion
Calls to 'personal' API should be excluded from console history because
they can be called with an account passphrase as argument. The check for
such calls was inverted and didn't work.
2016-05-14 00:10:41 +02:00
Péter Szilágyi d89e57ea8d Merge pull request #2549 from karalabe/geth-tester-text-templates
cmd/geth: use text/templates in the tester, not html
2016-05-11 13:51:11 +03:00
Péter Szilágyi 284f1d6beb cmd/geth: use text/templates in the tester, not html 2016-05-11 11:58:48 +03: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 f61e203c10 cmd/utils: fix build on *BSD 2016-05-09 13:13:44 +02:00
Felix Lange 130bccc763 cmd/utils: flush trace and CPU profile data when force-qutting
Also reduce log messages a little bit.
2016-05-06 11:16:47 +02:00
Jeffrey Wilcke 14d5033c9d cmd/geth: fixed to use proper version string for output 2016-05-03 14:01:37 +02:00
Péter Szilágyi 4536b993ff cmd/geth, release: polish and deploy live release contract 2016-05-02 16:20:58 +03:00
Péter Szilágyi 586eddfd09 release, all: integrate the release service into geth 2016-05-02 16:20:21 +03:00
Gustav Simonsson ecd7199c43 common/versions, cmd/utils: add geth version contract 2016-05-02 10:31:54 +03:00
Péter Szilágyi 9672a62a38 Merge pull request #2485 from karalabe/fakepow
cmd: add a `--fakepow` flag to help benchmarking database changes
2016-04-29 14:19:38 +03:00
Felix Lange 3d6d828caf Merge pull request #2478 from fjl/geth-js-tweak
cmd/geth, jsre: improve the js command
2016-04-26 10:39:19 +02:00
Felix Lange 70b8b54cd2 Merge pull request #2481 from fjl/bootnode-fixup
cmd/bootnode: fix -genkey, add logging options
2016-04-25 12:42:28 +02:00
Felix Lange c88c89fd9e cmd/bootnode: fix -genkey, add logging options 2016-04-22 13:35:40 +02:00
Péter Szilágyi b06f44ecc2 cmd: add a `--fakepow` flag to help benchmarking database changes 2016-04-21 12:14:57 +03:00
Felix Lange 87ae0df476 cmd/geth, jsre: improve the js command
geth js stopped the JS runtime after running the first input file
and blocked for pending callbacks. This commit makes it process
all files and enables quitting with Ctrl-C regardless of callbacks.

Error reporting is also improved. If a script fails to load, the error
is printed and includes the backtrace. package jsre now ensures that
otto is aware of the filename, the backtrace will contain them.

Before:

$ geth js bad.js; echo "exit $?"
... log messages ...
exit 0

After:

$ geth js bad.js; echo "exit $?"
... log messages ...
Fatal: JavaScript Error: Invalid number of input parameters
    at web3.js:3109:20
    at web3.js:4917:15
    at web3.js:4960:5
    at web3.js:4984:23
    at checkWork (bad.js:11:9)
    at bad.js:19:1

exit 1
2016-04-20 23:33:43 +02:00
Jeffrey Wilcke 18580e152c VERSION, cmd/geth: bumped version 2016-04-19 18:17:44 +02:00
Felix Lange e728aaca72 rpc: move web3.js extensions to internal/web3ext 2016-04-15 17:36:01 +02:00
Felix Lange 6fdd0893c3 all: fix go vet warnings 2016-04-15 11:17:27 +02:00
Felix Lange d04a2e7557 all: update license information 2016-04-15 09:48:05 +02:00
Bas van Kervel 529897ea2b cmd/utils: strip excessive whitespace from api command line arguments 2016-04-14 16:23:43 +02:00
Péter Szilágyi a1f1c404c3 cmd/utils: fix accounts merge error on console unlock 2016-04-12 18:01:37 +03:00
Péter Szilágyi 1e9b504ee7 Merge pull request #2284 from fjl/accounts-addr-cache
accounts: cache key addresses
2016-04-12 17:51:09 +03:00
Felix Lange 46df50be18 accounts: improve API and add documentation
- Sign takes common.Address, not Account
- Import/Export methods work with encrypted JSON keys
2016-04-12 15:59:18 +02:00
Felix Lange 91aaddaeb3 cmd/geth: add recovery procedure for AmbiguousAddrError 2016-04-12 15:59:18 +02:00
Felix Lange ea005a0295 cmd/utils: fix --password on Windows
Text files created on Windows typically have \r\n line endings.
Trim them when reading password files.
2016-04-12 15:59:18 +02:00
Felix Lange aca9d6a1fb cmd/geth: print actual error when --unlock fails 2016-04-12 15:59:17 +02:00
Felix Lange 6f1ca0bc91 accounts: add ErrDecrypt 2016-04-12 15:58:07 +02:00
Felix Lange a9f26dcd0d accounts: cache key addresses
In order to avoid disk thrashing for Accounts and HasAccount,
address->key file mappings are now cached in memory. This makes it no
longer necessary to keep the key address in the file name. The address
of each key is derived from file content instead.

There are minor user-visible changes:

- "geth account list" now reports key file paths alongside the address.
- If multiple keys are present for an address, unlocking by address is
  not possible. Users are directed to remove the duplicate files
  instead. Unlocking by index is still possible.
- Key files are overwritten written in place when updating the password.
2016-04-12 15:58:07 +02:00
Felix Lange ee1682ffe6 cmd/geth: add tests for account commands 2016-04-12 15:58:07 +02:00
Felix Lange 46e8940b19 accounts: streamline API
- Manager.Accounts no longer returns an error.
- Manager methods take Account instead of common.Address.
- All uses of Account with unkeyed fields are converted.
2016-04-12 15:58:01 +02:00
Felix Lange 2dc20963e7 cmd/geth: move account commands to accountcmd.go 2016-04-12 15:56:49 +02:00
Felix Lange 85e6c40c00 accounts, crypto: move keystore to package accounts
The account management API was originally implemented as a thin layer
around crypto.KeyStore, on the grounds that several kinds of key stores
would be implemented later on. It turns out that this won't happen so
KeyStore is a superflous abstraction.

In this commit crypto.KeyStore and everything related to it moves to
package accounts and is unexported.
2016-04-12 15:56:49 +02:00
Felix Lange dff9b4246f cmd/geth, cmd/utils: improve input handling
These changes make prompting behave consistently on all platforms:

* The input buffer is now global.
  Buffering was previously set up for each prompt, which can cause weird
  behaviour, e.g. when running "geth account update <input.txt" where
  input.txt contains three lines. In this case, the first password
  prompt would fill up the buffer with all lines and then use only the
  first one.

* Print the "unsupported terminal" warning only once.
  Now that stdin prompting has global state, we can use it to track
  the warning there.

* Work around small liner issues, particularly on Windows.
  Prompting didn't work under most of the third-party terminal emulators
  on Windows because liner assumes line editing is always available.
2016-04-12 15:56:49 +02:00
Péter Szilágyi 9027981280 cmd/gethrpctest: add missing chain configuration config field 2016-04-12 16:44:42 +03:00
Felix Lange 83877a0f9d tests: remove eth, node, accounts dependencies
Unlocking the accounts in the test doesn't help with anything.
2016-04-12 15:34:39 +02:00
Jeffrey Wilcke 8627680e24 Merge pull request #2359 from bas-vk/rpc-optional-args
rpc: several fixes and support for optional arguments
2016-04-12 14:03:21 +02:00
Bas van Kervel aa9fff3e68 rpc: various fixes/enhancements
rpc: be less restrictive on the request id
rpc: improved documentation
console: upgrade web3.js to version 0.16.0
rpc: cache http connections
rpc: rename wsDomains parameter to wsOrigins
2016-04-12 11:02:39 +02:00
Jeffrey Wilcke 934f587bd5 Merge pull request #2431 from bas-vk/js-preload
cmd/geth: add JS preload parameter
2016-04-12 11:00:42 +02:00
Bas van Kervel 3c5329599c cmd/geth: add JS preload parameter 2016-04-11 13:32:26 +02:00
Bas van Kervel 4081868452 cmd/utils: bugfix where database is opened multiple times 2016-04-07 12:49:00 +02:00
Jeffrey Wilcke 52dc7cb452 Merge pull request #2378 from obscuren/enable-jit-a-b
cmd/utils, miner: A/B testing JIT VM. Disabled for miners
2016-04-04 11:15:23 +02:00
Péter Szilágyi c90fc3503d cmd/geth: add missing gas target flag (fixing 0 convergence issue) 2016-04-04 12:04:04 +03:00
Felix Lange cf842b3fe5 cmd/geth, eth: move --genesis deprecation warning to cmd/geth
This prevents display of the warning for --dev and --olympic.
2016-04-01 21:59:35 +02:00
Felix Lange 78b70d79ec cmd/utils: fix geth startup with empty database 2016-04-01 21:59:23 +02:00
Jeffrey Wilcke bbeaab7e64 cmd/utils, miner: A/B testing JIT VM. Disabled for miners
This PR introduces a 10% probability that you'll run the client with the
JIT enabled testing the new client and helps us potentially catch
errors when reported.

This feature is **disabled** for miners (disabling the JIT completely).
The JIT can however be force for miners if they enable both --jitvm and
--forcejit.
2016-04-01 13:44:58 +02:00
Jeffrey Wilcke f0cbebb19f core: added basic chain configuration
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.
2016-04-01 01:01:10 +02:00
Péter Szilágyi b813e4d411 accounts/abi/bind, cmd/abigen: dedup structs, exclude patterns 2016-03-26 11:43:09 +02:00
Péter Szilágyi 73308dbe0e accounts/abi/bind, cmd/abigen: port to templates, bind to solidity 2016-03-24 17:09:45 +02:00
Péter Szilágyi 86cfc22c79 accounts/abi/bind: constructor, auth utils and various backends 2016-03-24 14:15:32 +02:00
Péter Szilágyi 72826bb5ad accounts/abi/bind, cmd/abigen: Go API generator around an EVM ABI 2016-03-24 14:15:18 +02:00
Jeffrey Wilcke 75c86f8646 Merge pull request #2141 from obscuren/evm-init
core, core/vm, tests: changed the initialisation behaviour of the EVM
2016-03-23 23:20:51 +01:00
Jeffrey Wilcke 0cfa21fc7f core, eth, cmd: temporary work around for enabling the jit
This commit serves as a temporary workaround for enabling the jit until
the block customisation PR is merged in.
2016-03-23 23:02:44 +01:00
Jeffrey Wilcke 14013372ae core: Added EVM configuration options
The EVM is now initialised with an additional configured object that
allows you to turn on debugging options.
2016-03-23 23:02:42 +01:00
Jeffrey Wilcke 9866f19d6a Merge pull request #2371 from hiddentao/fix_prompt_passwd_input
Strip extraneous carriage return from end of entered password
2016-03-23 18:06:27 +01:00
Ramesh Nair 6f30034413 cmd/utils: removed password line endings when not using liner. 2016-03-23 22:53:20 +08:00
Jeffrey Wilcke 77d21e472d Merge pull request #2259 from bas-vk/http
rpc/http: improve request handling
2016-03-23 13:01:22 +01:00
Bas van Kervel a7bae3b2a6 rpc/http: improve request handling 2016-03-23 11:27:08 +01:00
Jeffrey Wilcke 342ae7ce7d core, core/vm, tests: changed the initialisation behaviour of the EVM
The EVM was previously initialised and created for every CALL, CALLCODE,
DELEGATECALL and CREATE. This PR changes this behaviour so that the same
EVM can be used through the session and beyond as long as the
Environment sticks around.
2016-03-23 00:04:00 +01: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
Péter Szilágyi e90958cd29 cmd, eth, ethdb, node: prioritise chaindata for resources, bump cache 2016-03-09 10:33:39 +02:00
Bas van Kervel 0fd251c7f7 console: allow optional password on the command line 2016-03-08 15:02:21 +01:00
Kobi Gurkan 627c2311fb cmd/utils: add --keystore 2016-03-07 14:38:56 -08:00
Jeffrey Wilcke 0d89e6c2f1 cmd/utils, params: homestead block 2016-02-29 15:04:55 +01:00
Jeffrey Wilcke 7cbcae3fac Merge pull request #2269 from obscuren/repl-multi-line
cmd/geth: removed multiline support
2016-02-29 15:04:33 +01:00
Jeffrey Wilcke ab92678fb3 cmd/utils: lower the min accepted gas price for relay and GPO to 20 shannon 2016-02-29 14:45:47 +01:00
Jeffrey Wilcke cec92f5940 cmd/geth: removed multiline support
When attempting to paste very long lines of text the REPL goes
completely fubar, never completing the paste. Removing the multiline
support "fixes" this.

Long lines of text are usually pasted when deploying contracts and as it
stands right now makes creating new contracts from the REPL impossible.
2016-02-27 16:58:27 +01: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
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
Jeffrey Wilcke aa36a6ae4f Merge pull request #2206 from fjl/update-deps
Godeps: update all dependencies
2016-02-17 13:46:30 +01:00
Felix Lange ae5bc89cad cmd/geth, jsre: improve auto-completion 2016-02-15 15:03:26 +01:00
Péter Szilágyi 770b29fd80 Merge pull request #2175 from karalabe/refactor-http-rpc
cmd, common, node, rpc: move HTTP RPC into node, drop singleton aspect
2016-02-13 14:53:48 +02:00
Felix Lange 2abf1a36b9 cmd/geth: enable multi-line mode
This was requested by some users earlier but liner didn't support
it at the time. It does now.
2016-02-12 02:41:29 +01:00
Felix Lange 4063d30b5e cmd/geth: gofmt js.go and rename ethereum.js to web3.js
Fixing the filename matters now because it will actually show
up in JS backtraces.
2016-02-12 02:20:18 +01:00
Péter Szilágyi d6c6bcc9f3 cmd/geth: update monitor to new termui code 2016-02-11 16:46:28 +02:00
Péter Szilágyi df75dbfd68 cmd, node, rpc: readd inproc RPC client, expose via node 2016-02-09 14:10:40 +02:00
Péter Szilágyi 900e124bee cmd, common, node, rpc: rework naming convention to canonical one 2016-02-09 13:24:42 +02:00
Péter Szilágyi 7486904b92 cmd, node, rpc: move websockets into node, break singleton 2016-02-05 16:53:47 +02:00
Isidoro Ghezzi cf47ef12d3 cmd/utils: fix jspath flag typo 2016-02-05 15:32:00 +01:00
Péter Szilágyi a13bc9d7a1 cmd, common, node, rpc: move HTTP RPC into node, drop singletone aspect 2016-02-05 13:45:36 +02:00
Péter Szilágyi 188ab928c3 cmd, common, node, rpc: move IPC into the node itself 2016-02-04 11:23:15 +02:00
Péter Szilágyi 5da7ec7c18 cmd, eth, rpc: fix some RPC issues with pending blocks 2016-02-03 10:35:59 +02: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
Bas van Kervel 19b2640e89 rpc: migrated the RPC insterface to a new reflection based RPC layer 2016-01-26 13:51:50 +01:00
Bas van Kervel cdd34fcb16 console: add admin.sleep and admin.sleepBlocks 2016-01-19 12:30:33 +01:00
Jeffrey Wilcke dbbcf558e2 Merge pull request #2064 from fjl/remove-common-rlp
common: remove old RLP implementation, Value and ExtPackage
2015-12-18 20:26:19 +01:00
Bas van Kervel 3c9a2c752f console: bugfix that causes the console to crash when connection to an endpoint without the personal api enabled 2015-12-18 15:30:08 +01:00
Felix Lange e6fb69296e common: remove old RLP implementation, Value and ExtPackage
In order to make this happen, kill all remaining trivial uses of
common/{rlp,value}.go. The non-trivial ones have been updated earlier.
2015-12-18 12:09:10 +01:00
Felix Lange b9aedeab0b Merge pull request #2072 from karalabe/admin-debug-apis
core, eth, node, rpc: port the admin and debug API
2015-12-15 11:33:18 +01:00
Felix Lange 9c636d2490 Merge pull request #2070 from karalabe/android-archives
Makefile, cmd/geth: support building Android archives
2015-12-14 21:32:00 +01:00
Péter Szilágyi d8370a4e15 core, eth, node, rpc: port the admin and debug API 2015-12-14 19:36:51 +02:00
Felix Lange fa187a366d Merge pull request #2035 from bas-vk/rcp-v2-rebase
rpc: new RPC implementation with pub/sub support
2015-12-14 17:38:10 +01:00
Bas van Kervel eae81465c1 rpc: new RPC implementation with pub/sub support 2015-12-14 16:34:05 +01:00
Péter Szilágyi 03f090b30b Makefile, cmd/geth: support building Android archives 2015-12-14 14:28:14 +02:00
Péter Szilágyi 0e4deeb6e7 Makefile, cmd/geth: assemble ios xcode frameworks 2015-12-08 18:05:43 +02:00
Felix Lange d648e96b3d cmd/utils: restore starting geth without any accounts and etherbase
Also remove some duplication around address/index parsing.
2015-12-01 11:55:52 +01:00
Bas van Kervel 1ead43c88c console: fix instance name printed incorrect on start 2015-11-30 09:49:10 +01:00
Jeffrey Wilcke 7dde2b902c Merge pull request #1970 from karalabe/customizable-protocol-stacks
Customizable protocol stacks
2015-11-27 10:41:22 +01:00
Péter Szilágyi 3e1000fda3 cmd, eth, node, rpc, xeth: use single-instance services 2015-11-27 11:06:12 +02:00
Péter Szilágyi 1e806c4c77 cmd, common, core, eth, node, rpc, tests, whisper, xeth: use protocol stacks 2015-11-27 11:06:12 +02:00
Péter Szilágyi 8a44451edf cmd: drop blocktest command, create gethrpctest program 2015-11-27 11:06:12 +02:00
Jeffrey Wilcke b1e0143444 cmd, crypto: fixed nil public keys and updated web3 2015-11-26 13:38:53 +01:00
Jeffrey Wilcke 1c63d08ed1 cmd/geth, cmd/utils: removed legalese
Removed the legalese confirmation dialog. This closes #1992
2015-11-19 12:03:33 +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 9aa77a3769 cmd/geth, cmd/utils: surface the light KDF flag to the CLI 2015-11-10 15:47:19 +02:00
Péter Szilágyi 90655736ed cmd/geth: fix recover command crash if no param is supplied 2015-11-05 11:53:50 +02:00
Jeffrey Wilcke 5ff0814b1f VERSION, cmd/geth: bumped version 1.4.0 2015-11-03 11:48:18 +01:00
Jeffrey Wilcke 98b036ddb6 Merge pull request #1949 from karalabe/update-command-usage
cmd/geth, cmd/utils, eth: group CLI flags by purpose
2015-10-30 10:59:36 +01:00
Péter Szilágyi 3c6e285d3b cmd/geth, cmd/utils, eth: group CLI flags by purpose 2015-10-30 11:33:12 +02:00
Felix Lange fbdb44dcc1 cmd/utils, rpc/comms: stop XEth when IPC connection ends
There are a bunch of changes required to make this work:

- in miner: allow unregistering agents, fix RemoteAgent.Stop
- in eth/filters: make FilterSystem.Stop not crash
- in rpc/comms: move listen loop to platform-independent code

Fixes #1930. I ran the shell loop there for a few minutes and didn't see
any changes in the memory profile.
2015-10-29 17:26:26 +01:00
Drake Burroughs 05ea8926c3 cmd/utils, crypto: add --lightkdf flag for lighter KDF 2015-10-28 18:46:39 +01:00
zelig 4d005a2c1d rpc api: eth_getNatSpec
* xeth, rpc: implement eth_getNatSpec for tx confirmations
* rename silly docserver -> httpclient
* eth/backend: httpclient now accessible via eth.Ethereum init-d via config.DocRoot
* cmd: introduce separate CLI flag for DocRoot (defaults to homedir)
* common/path: delete unused assetpath func, separate HomeDir func
2015-10-26 22:24:09 +01:00
zelig 6b5d077c09 fix console history, lines with leadning whitespace NOT included 2015-10-23 20:37:12 +02:00
zelig 8b81ad1fc4 console:
* lines with leading space are ommitted from history
* exit processed even with whitespace around
* all whitespace lines (not only empty ones) are ignored

add 7 missing commands to admin api autocomplete

registrar: methods now return proper error if reg addresses are not set. fixes #1457

rpc/console: fix personal.newAccount() regression. Now all comms accept interactive password

registrar: add registrar tests for errors

crypto: catch AES decryption error on presale wallet import + fix error msg format. fixes #1580

CLI: improve error message when starting a second instance of geth. fixes #1564

cli/accounts: unlock multiple accounts. fixes #1785
* make unlocking multiple accounts work with inline <() fd
* passwdfile now correctly read only once
* improve logs
* fix CLI help text for unlocking

fix regression with docRoot / admin API
* docRoot/jspath passed to rpc/api ParseApis, which passes onto adminApi
* docRoot field for JS console in order to pass when RPC is (re)started
* improve flag desc for jspath

common/docserver: catch http errors from response

fix rpc/api tests

common/natspec: fix end to end test (skipped because takes 8s)

registrar: fix major regression:
* deploy registrars on frontier
* register HashsReg and UrlHint in GlobalRegistrar.
* set all 3 contract addresses in code
* zero out addresses first in tests
2015-10-22 00:22:39 +02:00
Jeffrey Wilcke 58d0752fdd Merge pull request #1883 from obscuren/jit-vm-optimisations
core/vm: JIT segmentation
2015-10-21 12:34:32 -07:00
Péter Szilágyi aa0538db0b eth: clean out light node notions from eth 2015-10-19 10:03:10 +03:00
Péter Szilágyi 92f9a3e5fa cmd, eth: support switching client modes of operation 2015-10-19 10:03:09 +03:00
Jeffrey Wilcke b196278044 core/vm: added JIT segmenting / optimisations
* multi-push segments
* static jumps segments
2015-10-16 22:30:42 +02:00
Jeffrey Wilcke d5327ddc5f Merge pull request #1869 from Gustav-Simonsson/gpu_miner
all: Add GPU mining, disabled by default
2015-10-16 06:25:33 -07:00
Gustav Simonsson 1b1f293082 core/state, core, miner: handle missing root error from state.New 2015-10-16 02:22:06 +02:00
Jeffrey Wilcke 315a422ba7 Merge pull request #1888 from obscuren/testnet
cmd, core, eth: added official testnet
2015-10-09 01:31:37 -07:00
Jeffrey Wilcke 1de796f101 cmd, core, eth: added official testnet 2015-10-08 22:01:39 +02:00
Jeffrey Wilcke 9e91579105 Merge pull request #1885 from karalabe/olympic-fix
cmd: properly initialize Olympic for all subcommands
2015-10-08 11:33:28 -07:00
Jeffrey Wilcke bba4dcb72f Merge pull request #1880 from Gustav-Simonsson/core_transfer
core, core/vm, cmd/evm: remove redundant balance check
2015-10-08 11:32:30 -07:00
Péter Szilágyi 2547c9c9b7 cmd: properly initialize Olympic for all subcommands 2015-10-07 18:25:33 +03:00
Gustav Simonsson ec6a548ee3 all: Add GPU mining, disabled by default 2015-10-07 13:19:30 +02:00
Jeffrey Wilcke 27528ad3d2 Merge pull request #1851 from bas-vk/historyfile
console/history respect datadir
2015-10-07 01:51:13 -07:00
Gustav Simonsson e1616f77c7 core, core/vm, cmd/evm: remove redundant balance check 2015-10-06 12:42:34 +02:00
Jeffrey Wilcke 7b44b8aece cmd/geth: dev version number 2015-10-05 21:11:39 +02:00
Jeffrey Wilcke 7c7692933c cmd/geth, cmd/utils, core, rpc: renamed to blockchain
* Renamed ChainManager to BlockChain
* Checkpointing is no longer required and never really properly worked
when the state was corrupted.
2015-10-04 01:13:56 +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
Péter Szilágyi 74578ab22b common: fix #1818, secondary datadir paths to fall back to 2015-10-01 12:26:19 +03:00
Bas van Kervel 8636f0e1c3 console/history respect datadir 2015-09-25 13:08:48 +02:00
Felix Lange 70b6174748 cmd/geth, core: make "geth blocktest" work again
The test genesis block was not written properly, block insertion failed
immediately.

While here, fix the panic when shutting down "geth blocktest" with
Ctrl+C. The signal handler is now installed automatically, causing
ethereum.Stop to crash because everything is already stopped.
2015-09-22 23:55:31 +02:00
Jeffrey Wilcke 7bf8e949e7 Merge pull request #1669 from obscuren/tx-pool-auto-resend
core, xeth: chain reorg move missing transactions to transaction pool
2015-09-21 11:45:59 -07: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 be76a68aea cmd/geth: changed version number to 1.2.0
Changed the version number of geth to 1.2.0 so that dev builds are now properly build (instead of master). Note to self; increase version number to 1.2.1 for our next actual release.
2015-09-21 16:13:07 +02:00
Gustav Simonsson 47ca6904b3 tests: use lastblockhash field to validate reorgs and block headers 2015-09-18 17:48:31 +02:00
Kobi Gurkan 1a1a1ee4ff cmd/geth: extradata is correcly initialized with console 2015-09-16 21:01:21 +03:00
Jeffrey Wilcke 985b5f29ed Merge pull request #1801 from fjl/ethdb
all: move common.Database to ethdb and add NewBatch
2015-09-16 07:50:14 -07:00
Kobi Gurkan 321733ab23 cmd/geth: adds extradata flag 2015-09-15 23:35:36 +03:00
Felix Lange 8c4dab77ba all: move common.Database to package ethdb 2015-09-14 23:36:30 +02:00
Péter Szilágyi cdc2662c40 core: split out TD from database and all internals 2015-09-11 17:42:25 +03:00
Felix Lange 4e075e4013 Merge pull request #1773 from obscuren/dev-mode
cmd/geth, cmd/utils, eth: added dev mode flag
2015-09-10 21:15:33 +02:00
Jeffrey Wilcke f04b3a6f29 cmd/geth, cmd/utils, eth: added dev mode flag
Dev mode enabled some debugging flags such as:

* VM debugging mode
* Simpler proof of work
* Whisper enabled by default
* Datadir to a tmp datadir
* Maxpeers set to 0
* Gas price of 0
* Random listen port
2015-09-09 08:53:05 +02:00
Bas van Kervel f69121357d cmd/geth Autocompletion bugfix which let the console crash 2015-09-06 16:25:55 +02:00
Kobi Gurkan 1a86adc5a2 cmd/geth: honor datadir when attaching 2015-09-03 10:28:30 +03: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 17f65cd1e5 eth: update metrics collection to handle eth/62 algos 2015-08-25 17:48:47 +03: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
Péter Szilágyi 42f44dda54 eth, eth/downloader: handle header requests, table driven proto tests 2015-08-24 17:57:28 +03:00
Jeffrey Wilcke d51d0022ce cmd/geth: bumped version 1.1.0 2015-08-20 21:43:36 +02:00
Jeffrey Wilcke 54088b0b8b cmd/geth: bumped version 1.0.3 2015-08-20 13:08:08 +02:00
Jeffrey Wilcke 9fb7bc7443 geth: bumped version 1.0.2 2015-08-19 23:05:39 +02:00
Jeffrey Wilcke 269c5c7107 Revert "fdtrack: temporary hack for tracking file descriptor usage"
This reverts commit 5c949d3b3b.
2015-08-19 21:46:01 +02:00
Maran 4d5501c46a cmd/geth: Fix chain purging from cmd line 2015-08-18 15:56:37 +02:00
Jeffrey Wilcke 5c5c3930b7 Merge pull request #1659 from bas-vk/exec-output
Javascript --exec output
2015-08-15 06:23:29 -07:00
Jeffrey Wilcke cd81356ace Merge pull request #1658 from bas-vk/liner-ctrl-c
Clear current line on ctrl-C
2015-08-14 04:36:15 -07:00
Bas van Kervel c472b8f725 main clear current line on ctrl-C 2015-08-14 13:23:41 +02:00
Jeffrey Wilcke 3a66c4ed47 Merge pull request #1642 from ethereum/fix-js-console-windows
cmd/geth, jsre: restore command line editing on windows
2015-08-14 04:14:11 -07:00
Bas van Kervel 87d1cde7e4 main print console output for js statement given by the exec argument 2015-08-14 13:06:34 +02:00
Jeffrey Wilcke 28b14d3e6d Merge pull request #1635 from bas-vk/useragent
support for user agents
2015-08-13 16:25:33 -07:00
Jeffrey Wilcke 73c4e6005c Merge pull request #1638 from obscuren/jit-fixes
core/vm: fixed jit error & added inline docs
2015-08-13 11:49:01 -07:00
Felix Lange 31a2793662 cmd/geth: remove spaces in client identifier 2015-08-12 13:32:52 +02:00
Bas van Kervel f9cbd16f27 support for user agents 2015-08-12 12:22:16 +02:00
Felix Lange 0ef80bb3d0 cmd/geth, jsre: restore command line editing on windows
PR #856 broke command line editing by wrapping stdout with a filter that
interprets ANSI escape sequences to fix colored printing on windows.
Implement the printer in Go instead so it can do its own
platform-dependent coloring.

As a nice side effect, the JS console is now noticeably more responsive
when printing results.

Fixes #1608
Fixes #1612
2015-08-12 12:04:00 +02:00
Jeffrey Wilcke 9cacec70f9 cmd/evm, core/vm, tests: changed DisableVm to EnableVm 2015-08-11 18:43:22 +02:00
Jeffrey Wilcke 67c8ccc309 cmd/ethtest: added trace flag for debugging 2015-08-11 11:46:52 +02:00
Jeffrey Wilcke 2fcf7f1241 Merge pull request #1604 from obscuren/db-merge
core, eth, trie, xeth: merged state, chain, extra databases in one
2015-08-09 05:16:37 -07:00
Jeffrey Wilcke 07cb8092e7 Merge pull request #1611 from obscuren/expdiff-olympic-fix
cmd/utils, core: disable exp diff for olympic net
2015-08-09 05:15:13 -07:00
Jeffrey Wilcke eec38c5853 cmd/geth, core/vm: setup vm settings and defaulted JIT disabled 2015-08-09 02:06:16 +02:00
Jeffrey Wilcke c93f0b9f4b Merge pull request #1490 from obscuren/jit-vm
core/vm: jit vm
2015-08-08 06:36:26 -07:00
Jeffrey Wilcke a23478c0be core, eth, trie, xeth: merged state, chain, extra databases in one 2015-08-07 22:29:02 +02:00
caktux 3ccab5a1e8 string version for build server 2015-08-07 14:13:33 -04:00
Jeffrey Wilcke 184e9ae9a8 core, tests: reduced state copy by N calls
Reduced the amount of state copied that are required by N calls by doing
a balance check prior to any state modifications.
2015-08-07 12:52:23 +02:00
Jeffrey Wilcke 846f34f78b core/vm, tests: implemented semi-jit vm
* changed stack and removed stack ptr. Let go decide on slice reuse.
2015-08-07 12:52:17 +02:00
Jeffrey Wilcke 785b3e7a57 cmd/geth, eth: added canonical extra data
Implemented canonical extra data according to
https://github.com/ethereum/wiki/wiki/Extra-Data
2015-08-07 12:24:32 +02:00