Commit Graph

923 Commits

Author SHA1 Message Date
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 59b8245bbc Merge pull request #3516 from fjl/types-drop-sign-ecdsa
core/types: remove redundant SignECDSA wrappers, rename to SignTx
2017-01-06 15:55:55 +02: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 d3b751e4d9 trie: remove dependency on ethdb
This removes the core/types -> leveldb dependency.
2017-01-06 14:15:22 +01: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 e171bf74f8 core/types: remove redundant SignECDSA wrappers, rename to SignTx 2017-01-05 12:59:17 +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 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
Bas van Kervel a1798a8188
core,cmd/utils: bugfix for ropsten dump imports 2017-01-05 11:31:57 +01:00
Péter Szilágyi c44830ebf3
core, light: allow zero cost txs from inexistent accounts too 2016-12-16 13:30:39 +02:00
Péter Szilágyi 745026b7b4 Merge pull request #3433 from karalabe/badblock-order-fix
core: import future blocks one-by-one, enfore chain ancestry
2016-12-14 16:45:48 +02:00
Péter Szilágyi a59fcc33e6
core: import future blocks one-by-one, enfore chain ancestry 2016-12-13 16:19:45 +02:00
Bas van Kervel 9f1520b4c0 core: init pending state in tx pool on creation 2016-12-13 10:38:04 +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
Felix Lange f52a1ae849 core, core/vm, eth/filters: move Removed field into vm.Log
This field used to be assigned by the filter system and returned through
the RPC API. Now that we have a Go client that uses the underlying type,
the field needs to move. It is now assigned to true when the RemovedLogs
event is generated so the filter system doesn't need to care about the
field at all.

While here, remove the log list from ChainSideEvent. There are no users
of this field right now and any potential users could subscribe to
RemovedLogsEvent instead.
2016-12-05 10:57:11 +01:00
Steven Roose 61ccb43487 core/types: Document Transaction.To (#3366) 2016-11-28 21:56:38 +01:00
Felix Lange 24f288770e core/types: use package hexutil for JSON handling 2016-11-28 11:22:52 +01:00
Felix Lange 65e6319b12 core/vm: use package hexutil for JSON handling 2016-11-28 11:22:52 +01:00
Jeffrey Wilcke 801a13f791 core: fixed unwinding bad hash (#3347)
Fixed unwinding of bad hashes when already on the canon chain
2016-11-28 10:37:42 +01:00
Jeffrey Wilcke 6061707371 core: eip unit tests (#3309) 2016-11-28 01:33:28 +01:00
Felix Lange fa0e057f8a Merge pull request #3341 from obscuren/touch-delete-fix
core, core/state: fixed consensus issue added touch revert
2016-11-24 23:01:34 +01:00
Jeffrey Wilcke 12d654a6fc core, core/state: fixed consensus issue added touch revert
Implemented proper touch revert journal entries and copied a Parity
consensus bug in order to remain in sync with the current longest chain.
2016-11-24 22:12:54 +01:00
Péter Szilágyi 529c502876
core: remove dead event 2016-11-24 15:23:01 +02:00
Jeffrey Wilcke c04c8f10f0 core: improved bad block error reporting (#3320) 2016-11-23 13:32:25 +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
Nick Johnson c8695209f6 core: Don't perform EIP150 hash check on uncles (#3303) 2016-11-18 12:01:54 +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
Péter Szilágyi 178da7c6a9
mobile: initial wrappers for mobile support 2016-11-14 17:56:58 +02:00
Jeffrey Wilcke 6c9c1e6712 core, core/types: refactored tx chain id checking
Refactored explicit chain id checking in to the Sender deriviation method
2016-11-14 15:59:31 +01:00
Zsolt Felfoldi b10bcd924b core/types: turn off nonce checking for Call messages 2016-11-14 14:16:06 +01:00
Jeffrey Wilcke 648bd22427 core/vm/runtime: fixed go vet 2016-11-13 23:26:10 +01:00
Jeffrey Wilcke 0231d8f86d core, params: EIP#170 2016-11-13 23:26:10 +01:00
Jeffrey Wilcke 4dca5d4db7 core/types, params: EIP#155 2016-11-13 14:55:30 +01:00
Jeffrey Wilcke 779ddb1832 core/vm, params: EIP160: EXP reprice 2016-11-13 10:44:04 +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
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 1b73c79234 common/math, core/vm: implement fast EXP (#3214)
* common/math, core/vm: implement fast EXP.

Courtesy @chfast & @karalabe

* common/math: fix go vet issues on exp calculation
2016-11-02 13:43:15 +02:00
Martin Holst Swende 36956da4d2 core: metrics collection for transaction events (#3157)
* core: Add metrics collection for transaction events; replace/discard for pending and future queues, as well as invalid transactions

* core: change namespace for txpool metrics

* core: define more metrics (not yet used)

* core: implement more tx metrics for when transactions are dropped

* core: minor formatting tweeks (will squash later)

* core: remove superfluous meter, fix missing pending nofunds

* core, metrics: switch txpool meters to counters
2016-11-01 14:46:11 +02:00
Péter Szilágyi f4d878f3d8 Merge pull request #3216 from karalabe/fastsync-bigdb-tuning
core/state, eth/downloader, trie: reset fast-failure on progress
2016-11-01 13:31:12 +02:00
Péter Szilágyi 90b16a3e85
core/state, eth/downloader, trie: reset fast-failure on progress 2016-10-31 14:19:14 +02: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
Péter Szilágyi f0dbec0c93
cmd, params: only set default fork configs for test and mainnet 2016-10-29 17:07:07 +03:00