Commit Graph

68 Commits

Author SHA1 Message Date
Sai V c215989c10
Quorum geth upgrade to 1.9.7 (#960)
Co-authored-by: amalraj.manigmail.com <amalraj.manigmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Flash Sheridan <flash@pobox.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Nguyen Kien Trung <trung.n.k@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Rob Mulholand <rmulholand@8thlight.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: soc1c <soc1c@users.noreply.github.com>
Co-authored-by: Rafael Matias <rafael@skyle.net>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Lucas Hendren <lhendre2@gmail.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: ywzqwwt <39263032+ywzqwwt@users.noreply.github.com>
Co-authored-by: zcheng9 <zcheng9@hawk.iit.edu>
Co-authored-by: zzy96 <zhou0250@e.ntu.edu.sg>
Co-authored-by: kikilass <36239971+kikilass@users.noreply.github.com>
Co-authored-by: Darrel Herbst <dherbst@gmail.com>
Co-authored-by: Ross <9055337+Chadsr@users.noreply.github.com>
Co-authored-by: Jeffery Robert Walsh <rlxrlps@gmail.com>
Co-authored-by: Marius Kjærstad <sandakersmann@users.noreply.github.com>
Co-authored-by: Piotr Dyraga <piotr.dyraga@keep.network>
Co-authored-by: Guillaume Ballet <gballet@gmail.com>
Co-authored-by: Michael Forney <mforney@mforney.org>
Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
2020-04-29 10:50:56 -04:00
Trung Nguyen 712f4907ee
permission: refactor hex node id to avoid many changes 2019-09-09 16:19:57 -04:00
vsmk98 b4756e56d3 permission: Reverted privateAbigen related changes as separate PR is there for this 2019-05-15 11:12:18 +08:00
vsmk98 afc9e3a967 permissions: node level validation for transactions 2019-04-17 19:16:16 +08:00
amalraj.manigmail.com 32729b9f28 remove TODO related to review 2019-02-25 16:30:54 +08:00
amalraj.manigmail.com a8f7b2ca33 update newly added methods 2019-02-12 22:08:42 +08:00
amalraj.manigmail.com 73667e7942 merge 1.8.18 with quorum/master
refactor raft & istanbul based on upstream changes
fix unit test cases
2019-02-08 17:29:01 +08:00
amalraj.manigmail.com 4dbd95947d Merge branch 'goeth-1.8.18' into geth-upgrade-1.8.18
# Conflicts:
#	.github/CONTRIBUTING.md
#	.travis.yml
#	core/blockchain.go
#	core/vm/evm.go
#	core/vm/logger_test.go
#	eth/handler_test.go
#	eth/tracers/tracer_test.go
#	internal/ethapi/api.go
#	internal/web3ext/web3ext.go
#	p2p/discover/node.go
#	p2p/server.go
#	swarm/network/simulations/discovery/discovery_test.go
2019-01-29 19:08:50 +08:00
amalraj.manigmail.com bc529a509d Merge branch 'goeth-1.8.18' into geth-upgrade-1.8.18
# Conflicts:
#	.github/CONTRIBUTING.md
#	.travis.yml
#	core/blockchain.go
#	core/vm/evm.go
#	core/vm/logger_test.go
#	eth/handler_test.go
#	eth/tracers/tracer_test.go
#	internal/ethapi/api.go
#	internal/web3ext/web3ext.go
#	p2p/discover/node.go
#	p2p/server.go
#	swarm/network/simulations/discovery/discovery_test.go
2019-01-29 19:08:14 +08:00
amalraj.manigmail.com 2914b3c99d Merge remote-tracking branch 'remotes/origin/master' into geth-upgrade-1.8.18
# Conflicts:
#	consensus/ethash/consensus.go
#	eth/bloombits.go
#	params/protocol_params.go
2019-01-25 22:24:03 +08:00
Jitendra Bhurat 7803a2f7ef Setting the private state to public state if contract address is not present in the private state 2018-12-06 11:02:12 -05:00
SatpalSandhu61 470f34a784 Revert fix for eth_estimateGas due to side-effect where attempt to purely read private state doesn't work correctly. 2018-11-07 13:51:05 +00:00
SatpalSandhu61 97dfe51a56 Remove logging used for investigation. 2018-10-24 11:59:40 +01:00
SatpalSandhu61 e6dd33d71b Adding fix for eth_estimateGas - ensure private state is initialised before creating EVM. 2018-10-23 09:03:34 +01:00
amalraj.manigmail.com 47571689ee Merge remote-tracking branch 'remotes/goeth/release/1.8' into geth-upgrade-1.8.15_new
# Conflicts:
#	.travis.yml
#	README.md
#	cmd/utils/flags.go
#	consensus/consensus.go
#	consensus/ethash/consensus.go
#	consensus/ethash/ethash.go
#	core/blockchain.go
#	core/genesis_test.go
#	core/state/state_object.go
#	core/state_processor.go
#	core/vm/errors.go
#	core/vm/evm.go
#	core/vm/gas_table.go
#	core/vm/instructions_test.go
#	core/vm/interface.go
#	eth/api_tracer.go
#	eth/backend.go
#	eth/config.go
#	eth/filters/filter.go
#	les/backend.go
#	les/helper_test.go
#	miner/worker.go
#	params/config.go
#	params/version.go
2018-10-04 16:19:02 +08:00
Ryan Schneider b69942befe core, internal/ethapi: add and use LRU cache for receipts (#17610) 2018-09-29 22:53:31 +02:00
amalraj.manigmail.com 7c548e0f74 Merge remote-tracking branch 'remotes/geth/release/1.8' into merge-193
changes related  to merge conflicts
2018-07-24 16:15:38 +08:00
amalraj.manigmail.com c3c479d2aa Merge remote-tracking branch 'remotes/geth/release/1.8' into merge-193
# Conflicts:
#	.github/CODEOWNERS
#	.travis.yml
#	README.md
#	VERSION
#	accounts/abi/argument.go
#	accounts/abi/bind/backends/simulated.go
#	accounts/abi/bind/bind_test.go
#	accounts/abi/event_test.go
#	accounts/abi/numbers.go
#	accounts/abi/numbers_test.go
#	accounts/abi/reflect.go
#	accounts/accounts.go
#	accounts/keystore/keystore.go
#	accounts/keystore/keystore_wallet.go
#	accounts/usbwallet/internal/trezor/trezor.go
#	accounts/usbwallet/ledger.go
#	accounts/usbwallet/wallet.go
#	appveyor.yml
#	build/ci.go
#	build/goimports.sh
#	cmd/ethkey/generate.go
#	cmd/ethkey/inspect.go
#	cmd/ethkey/main.go
#	cmd/ethkey/message.go
#	cmd/ethkey/utils.go
#	cmd/faucet/faucet.go
#	cmd/geth/chaincmd.go
#	cmd/geth/config.go
#	cmd/geth/main.go
#	cmd/geth/misccmd.go
#	cmd/geth/usage.go
#	cmd/p2psim/main.go
#	cmd/puppeth/genesis.go
#	cmd/puppeth/module_dashboard.go
#	cmd/puppeth/wizard_faucet.go
#	cmd/puppeth/wizard_genesis.go
#	cmd/puppeth/wizard_netstats.go
#	cmd/puppeth/wizard_node.go
#	cmd/puppeth/wizard_wallet.go
#	cmd/swarm/config.go
#	cmd/swarm/config_test.go
#	cmd/swarm/db.go
#	cmd/swarm/hash.go
#	cmd/swarm/main.go
#	cmd/swarm/manifest.go
#	cmd/swarm/run_test.go
#	cmd/swarm/upload.go
#	cmd/swarm/upload_test.go
#	cmd/utils/flags.go
#	cmd/wnode/main.go
#	common/bytes.go
#	common/compiler/solidity.go
#	common/hexutil/hexutil.go
#	common/math/big.go
#	common/math/integer.go
#	common/mclock/mclock.go
#	common/types.go
#	common/types_template.go
#	consensus/clique/clique.go
#	consensus/consensus.go
#	consensus/ethash/algorithm.go
#	consensus/ethash/consensus.go
#	consensus/ethash/ethash.go
#	containers/vagrant/Vagrantfile
#	contracts/ens/ens_test.go
#	core/asm/compiler.go
#	core/asm/lexer.go
#	core/block_validator.go
#	core/blockchain.go
#	core/blockchain_test.go
#	core/chain_makers.go
#	core/database_util.go
#	core/database_util_test.go
#	core/events.go
#	core/genesis.go
#	core/genesis_alloc.go
#	core/genesis_test.go
#	core/headerchain.go
#	core/rawdb/accessors_chain.go
#	core/rawdb/accessors_indexes.go
#	core/rawdb/accessors_metadata.go
#	core/rawdb/schema.go
#	core/state/state_test.go
#	core/state/statedb.go
#	core/state/sync.go
#	core/state_processor.go
#	core/state_transition.go
#	core/tx_journal.go
#	core/tx_list.go
#	core/tx_pool.go
#	core/tx_pool_test.go
#	core/types.go
#	core/types/block.go
#	core/types/block_test.go
#	core/types/gen_receipt_json.go
#	core/types/log.go
#	core/types/receipt.go
#	core/types/transaction.go
#	core/types/transaction_signing.go
#	core/types/transaction_signing_test.go
#	core/types/transaction_test.go
#	core/vm/errors.go
#	core/vm/evm.go
#	core/vm/gas.go
#	core/vm/gas_table.go
#	core/vm/instructions.go
#	core/vm/instructions_test.go
#	core/vm/interface.go
#	core/vm/interpreter.go
#	core/vm/intpool.go
#	core/vm/jump_table.go
#	core/vm/logger.go
#	core/vm/logger_test.go
#	core/vm/memory_table.go
#	core/vm/opcodes.go
#	core/vm/runtime/env.go
#	core/vm/runtime/runtime.go
#	crypto/crypto.go
#	crypto/crypto_test.go
#	eth/api.go
#	eth/api_backend.go
#	eth/api_tracer.go
#	eth/backend.go
#	eth/config.go
#	eth/downloader/downloader.go
#	eth/downloader/queue.go
#	eth/downloader/statesync.go
#	eth/filters/filter.go
#	eth/filters/filter_system.go
#	eth/filters/filter_system_test.go
#	eth/gen_config.go
#	eth/handler.go
#	eth/handler_test.go
#	eth/helper_test.go
#	eth/protocol.go
#	eth/sync.go
#	eth/tracers/internal/tracers/4byte_tracer.js
#	eth/tracers/internal/tracers/assets.go
#	eth/tracers/tracer_test.go
#	eth/tracers/tracers_test.go
#	ethclient/ethclient.go
#	ethdb/database.go
#	ethdb/interface.go
#	ethdb/memory_database.go
#	ethstats/ethstats.go
#	event/feed.go
#	internal/ethapi/api.go
#	internal/ethapi/backend.go
#	internal/guide/guide_test.go
#	internal/web3ext/web3ext.go
#	les/api_backend.go
#	les/backend.go
#	les/fetcher.go
#	les/handler.go
#	les/helper_test.go
#	les/odr_requests.go
#	les/odr_test.go
#	les/retrieve.go
#	les/server.go
#	les/serverpool.go
#	light/lightchain.go
#	light/odr_test.go
#	light/postprocess.go
#	light/txpool.go
#	log/README.md
#	log/doc.go
#	log/format.go
#	log/handler.go
#	log/logger.go
#	log/root.go
#	metrics/exp/exp.go
#	metrics/influxdb/influxdb.go
#	metrics/metrics.go
#	metrics/resetting_timer.go
#	metrics/resetting_timer_test.go
#	metrics/timer_test.go
#	miner/worker.go
#	mobile/accounts.go
#	mobile/ethereum.go
#	mobile/geth.go
#	node/config.go
#	node/doc.go
#	p2p/discover/database.go
#	p2p/discover/database_test.go
#	p2p/discover/table.go
#	p2p/discover/table_test.go
#	p2p/discover/udp.go
#	p2p/discover/udp_test.go
#	p2p/discv5/udp.go
#	p2p/enr/enr.go
#	p2p/enr/enr_test.go
#	p2p/enr/entries.go
#	p2p/protocols/protocol.go
#	p2p/protocols/protocol_test.go
#	p2p/rlpx_test.go
#	p2p/server.go
#	p2p/simulations/adapters/docker.go
#	p2p/simulations/adapters/exec.go
#	p2p/simulations/adapters/inproc.go
#	p2p/simulations/adapters/types.go
#	p2p/simulations/http.go
#	p2p/simulations/http_test.go
#	p2p/simulations/mocker.go
#	p2p/simulations/network.go
#	p2p/simulations/network_test.go
#	p2p/testing/protocolsession.go
#	params/bootnodes.go
#	params/config.go
#	params/denomination.go
#	params/gas_table.go
#	params/protocol_params.go
#	params/version.go
#	rpc/http.go
#	rpc/json.go
#	rpc/utils.go
#	signer/core/api.go
#	swarm/api/api.go
#	swarm/api/api_test.go
#	swarm/api/client/client.go
#	swarm/api/client/client_test.go
#	swarm/api/config.go
#	swarm/api/config_test.go
#	swarm/api/filesystem.go
#	swarm/api/filesystem_test.go
#	swarm/api/http/error.go
#	swarm/api/http/error_templates.go
#	swarm/api/http/error_test.go
#	swarm/api/http/roundtripper.go
#	swarm/api/http/server.go
#	swarm/api/http/server_test.go
#	swarm/api/http/templates.go
#	swarm/api/manifest.go
#	swarm/api/manifest_test.go
#	swarm/api/storage.go
#	swarm/api/storage_test.go
#	swarm/api/uri.go
#	swarm/api/uri_test.go
#	swarm/fuse/fuse_dir.go
#	swarm/fuse/fuse_file.go
#	swarm/fuse/swarmfs.go
#	swarm/fuse/swarmfs_test.go
#	swarm/fuse/swarmfs_unix.go
#	swarm/fuse/swarmfs_util.go
#	swarm/metrics/flags.go
#	swarm/network/depo.go
#	swarm/network/forwarding.go
#	swarm/network/hive.go
#	swarm/network/kademlia/address.go
#	swarm/network/kademlia/kaddb.go
#	swarm/network/kademlia/kademlia.go
#	swarm/network/kademlia/kademlia_test.go
#	swarm/network/messages.go
#	swarm/network/protocol.go
#	swarm/network/syncdb.go
#	swarm/network/syncdb_test.go
#	swarm/network/syncer.go
#	swarm/services/swap/swap.go
#	swarm/services/swap/swap/swap.go
#	swarm/storage/chunker.go
#	swarm/storage/chunker_test.go
#	swarm/storage/common_test.go
#	swarm/storage/database.go
#	swarm/storage/dbstore.go
#	swarm/storage/dbstore_test.go
#	swarm/storage/dpa.go
#	swarm/storage/dpa_test.go
#	swarm/storage/localstore.go
#	swarm/storage/memstore.go
#	swarm/storage/netstore.go
#	swarm/storage/pyramid.go
#	swarm/storage/swarmhasher.go
#	swarm/storage/types.go
#	swarm/swarm.go
#	swarm/swarm_test.go
#	swarm/testutil/http.go
#	tests/block_test_util.go
#	tests/difficulty_test.go
#	tests/init.go
#	tests/state_test_util.go
#	tests/transaction_test.go
#	tests/util.go
#	tests/vm_test_util.go
#	trie/database.go
#	trie/encoding.go
#	trie/hasher.go
#	trie/iterator.go
#	trie/proof.go
#	trie/proof_test.go
#	trie/secure_trie.go
#	trie/sync.go
#	trie/sync_test.go
#	trie/trie.go
#	vendor/github.com/docker/docker/pkg/reexec/command_linux.go
#	vendor/github.com/docker/docker/pkg/reexec/command_unix.go
#	vendor/github.com/docker/docker/pkg/reexec/command_unsupported.go
#	vendor/github.com/docker/docker/pkg/reexec/command_windows.go
#	vendor/github.com/docker/docker/pkg/reexec/reexec.go
#	vendor/github.com/eapache/channels/.gitignore
#	vendor/github.com/eapache/queue/.gitignore
#	vendor/github.com/naoina/toml/encode.go
#	vendor/github.com/naoina/toml/parse.go
#	vendor/github.com/naoina/toml/parse.peg
#	vendor/github.com/naoina/toml/parse.peg.go
#	vendor/github.com/rcrowley/go-metrics/.gitignore
#	vendor/github.com/rcrowley/go-metrics/.travis.yml
#	vendor/github.com/rcrowley/go-metrics/README.md
#	vendor/github.com/rcrowley/go-metrics/counter.go
#	vendor/github.com/rcrowley/go-metrics/debug.go
#	vendor/github.com/rcrowley/go-metrics/ewma.go
#	vendor/github.com/rcrowley/go-metrics/exp/exp.go
#	vendor/github.com/rcrowley/go-metrics/gauge.go
#	vendor/github.com/rcrowley/go-metrics/gauge_float64.go
#	vendor/github.com/rcrowley/go-metrics/graphite.go
#	vendor/github.com/rcrowley/go-metrics/healthcheck.go
#	vendor/github.com/rcrowley/go-metrics/histogram.go
#	vendor/github.com/rcrowley/go-metrics/json.go
#	vendor/github.com/rcrowley/go-metrics/log.go
#	vendor/github.com/rcrowley/go-metrics/meter.go
#	vendor/github.com/rcrowley/go-metrics/metrics.go
#	vendor/github.com/rcrowley/go-metrics/opentsdb.go
#	vendor/github.com/rcrowley/go-metrics/registry.go
#	vendor/github.com/rcrowley/go-metrics/runtime.go
#	vendor/github.com/rcrowley/go-metrics/sample.go
#	vendor/github.com/rcrowley/go-metrics/syslog.go
#	vendor/github.com/rcrowley/go-metrics/timer.go
#	vendor/github.com/rcrowley/go-metrics/writer.go
#	vendor/github.com/syndtr/goleveldb/leveldb/db.go
#	vendor/golang.org/x/sys/unix/mksysnum_linux.pl
#	vendor/golang.org/x/sys/unix/types_linux.go
#	vendor/vendor.json
#	whisper/shhclient/client.go
#	whisper/whisperv5/api.go
#	whisper/whisperv5/peer_test.go
#	whisper/whisperv5/whisper.go
#	whisper/whisperv6/api.go
#	whisper/whisperv6/peer_test.go
#	whisper/whisperv6/whisper.go
2018-07-24 16:11:05 +08:00
Péter Szilágyi e1f1d3085c
accounts, eth, les: blockhash based filtering on all code paths 2018-07-12 18:16:54 +03:00
williambannas 9402f96597 eth: conform better to the golint standards (#16783)
* eth: made changes to conform better to the golint standards

* eth: fix comment nit
2018-06-14 13:14:52 +03:00
Qvintvs 4b44bea1d7 Merge attempt 2018-05-31 14:16:44 +08:00
Péter Szilágyi 49719e21bc
core, eth: minor txpool event cleanups 2018-05-18 12:08:24 +03:00
rjl493456442 a2e43d28d0
all: collate new transaction events together 2018-05-18 11:46:44 +03:00
kiel barry 4747aad160 eth: golint fixes to variable names (#16711) 2018-05-09 10:59:00 +03:00
Péter Szilágyi 6cf0ab38bd
core/rawdb: separate raw database access to own package (#16666) 2018-05-07 14:35:06 +03:00
Péter Szilágyi 5cf1d35470
eth, les, light: filter on logs only, derive receipts on demand 2018-02-22 19:12:43 +02:00
Steven Roose 8b3f7906f9 Remove unused raftHasNoPending 2017-12-18 12:09:54 +01:00
Patrick Mylund Nielsen 3d91976f08
Geth 1.7.2 rebase and addition of Istanbul BFT (#207) 2017-10-31 18:24:11 -04:00
Steven Roose 3089a92337 Use latest block when pending is indicated with RAFT (#181) 2017-09-18 22:57:55 -04:00
Péter Szilágyi f585f9eee8
core, eth: clean up bloom filtering, add some tests 2017-09-06 11:14:19 +03:00
Zsolt Felfoldi 4ea4d2dc34
core, eth: add bloombit indexer, filter based on it 2017-09-06 11:13:13 +03:00
Péter Szilágyi da7d57e07c
core: make txpool operate on immutable state 2017-09-05 13:34:41 +03:00
Miya Chen bf1e263128 core, light: send chain events using event.Feed (#14865) 2017-08-18 12:58:36 +02:00
Péter Szilágyi 4c1d0b164b
eth: drop leftover from previous nonce protection scheme 2017-07-05 16:53:40 +03:00
Péter Szilágyi 48ee7f9de7
core, eth, les: polish txpool API around local/remote txs 2017-07-05 16:51:55 +03:00
Felix Lange 9e5f03b6c4 core/state: access trie through Database interface, track errors (#14589)
With this commit, core/state's access to the underlying key/value database is
mediated through an interface. Database errors are tracked in StateDB and
returned by CommitTo or the new Error method.

Motivation for this change: We can remove the light client's duplicated copy of
core/state. The light client now supports node iteration, so tracing and storage
enumeration can work with the light client (not implemented in this commit).
2017-06-27 15:57:06 +02:00
Joel Burget 852ac74467 Raft updates (#104)
* Move raft checkpoint logging to logger package.

This allows us to use it everywhere and turn it on / off from command
flags.

* Return an error when the pending block is requested in Raft mode.
2017-05-04 16:49:48 -04:00
Péter Szilágyi a7b9e484d0 consensus, core, ethstats: use engine specific block beneficiary (#14318)
* consensus, core, ethstats: use engine specific block beneficiary

* core, eth, les, miner: use explicit beneficiary during mining
2017-04-12 16:38:31 +03:00
Felföldi Zsolt 9aca9e6deb cmd, les, eth, eth/gasprice: using new gas price oracle (#13853)
* cmd, les, eth, eth/gasprice: using new gas price oracle

* eth/gasprice: renamed source file

* eth/gasprice: added security checks for gpo params

* eth/gasprice: fixed naming issues

* eth/gasprice: max limit, maxEmpty
2017-04-06 17:20:42 +03:00
Felix Lange c213fd1fd8 all: import "context" instead of "golang.org/x/net/context"
There is no need to depend on the old context package now that the
minimum Go version is 1.7. The move to "context" eliminates our weird
vendoring setup. Some vendored code still uses golang.org/x/net/context
and it is now vendored in the normal way.

This change triggered new vet checks around context.WithTimeout which
didn't fire with golang.org/x/net/context.
2017-03-22 20:49:15 +01:00
Péter Szilágyi 9b84caf3a5 core, eth, les: support resuming fast sync on heavy rollback (#3743) 2017-03-22 01:37:24 +01:00
Felix Lange 5c8fe28b72 common: move big integer math to common/math (#3699)
* common: remove CurrencyToString

Move denomination values to params instead.

* common: delete dead code

* common: move big integer operations to common/math

This commit consolidates all big integer operations into common/math and
adds tests and documentation.

There should be no change in semantics for BigPow, BigMin, BigMax, S256,
U256, Exp and their behaviour is now locked in by tests.

The BigD, BytesToBig and Bytes2Big functions don't provide additional
value, all uses are replaced by new(big.Int).SetBytes().

BigToBytes is now called PaddedBigBytes, its minimum output size
parameter is now specified as the number of bytes instead of bits. The
single use of this function is in the EVM's MSTORE instruction.

Big and String2Big are replaced by ParseBig, which is slightly stricter.
It previously accepted leading zeros for hexadecimal inputs but treated
decimal inputs as octal if a leading zero digit was present.

ParseUint64 is used in places where String2Big was used to decode a
uint64.

The new functions MustParseBig and MustParseUint64 are now used in many
places where parsing errors were previously ignored.

* common: delete unused big integer variables

* accounts/abi: replace uses of BytesToBig with use of encoding/binary

* common: remove BytesToBig

* common: remove Bytes2Big

* common: remove BigTrue

* cmd/utils: add BigFlag and use it for error-checked integer flags

While here, remove environment variable processing for DirectoryFlag
because we don't use it.

* core: add missing error checks in genesis block parser

* common: remove String2Big

* cmd/evm: use utils.BigFlag

* common/math: check for 256 bit overflow in ParseBig

This is supposed to prevent silent overflow/truncation of values in the
genesis block JSON. Without this check, a genesis block that set a
balance larger than 256 bits would lead to weird behaviour in the VM.

* cmd/utils: fixup import
2017-02-26 22:21:51 +01:00
Jeffrey Wilcke c12f4df910 params: core, core/vm, miner: 64bit gas instructions
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-13 21:44:25 +01:00
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
Guilherme Salgado 566a72744a Check that msg.To() is not nil in GetVMEnv
Otherwise it will panic when msg is creating a contract.

Closes: #50
2017-02-10 14:54:43 +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 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
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
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