Commit Graph

124 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 74337c7167
added unit tests and comments 2019-06-13 13:41:28 -04:00
Trung Nguyen bacd5dc3c9
non-party must refund gas for private transactions 2019-06-12 17:09:49 -04:00
amalraj.manigmail.com 6fb33c0e32 Merge remote-tracking branch 'remotes/origin/master' into AJ-geth-upgrade-1.8.18 2019-02-13 17:26:38 +08:00
Samer Falah 07c76cc137
Merge pull request #595 from SatpalSandhu61/fix-for-bad-block-on-gas-limit
Fix for BAD BLOCK caused by "gas limit reached" for private contracts
2019-02-12 10:40:35 -05: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
SatpalSandhu61 895947de48 Currently, we can't tell the reason for evm failure, so change log message for EVM failure reason from Debug to Info. This is helpful to users and makes analysis of issues much easier. 2019-01-10 13:54:38 +08:00
SatpalSandhu61 50da8eaf0d Fix for issue 576 where private transactions can cause block gas limit to be exceeded, leading to BAD BLOCK. 2018-12-10 15:30:28 +00:00
SatpalSandhu61 5af110984a Fix for issue 576 where private transactions can cause block gas limit to be exceeded, leading to BAD BLOCK. 2018-12-10 09:58:16 +00: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
amalraj.manigmail.com 95a1b03c3e merge 1.8.12 with upstream/master to apply the fixes/changes added newly 2018-08-06 19:03:51 +08:00
amalraj.manigmail.com e6773756fb merge 1.8.12 with upstream/master to apply the fixes/changes added newly 2018-08-06 19:03:51 +08:00
Wenbiao Zheng d0082bb7ec core: fix comment typo (#17236) 2018-07-24 13:17:12 +03:00
Samer Falah 01195280b4 Fixes value transfer (#430) 2018-07-05 13:59:33 -04:00
Qvintvs 30a2c8c7ef fix raft block creating issue;
issue was that miner was subscribing to chainheadevent
2018-06-26 12:29:45 +08:00
Zekun Shi f9541a4125 update raft fix to 1.8.8 2018-06-14 12:12:20 +08:00
Samer Falah cfa9c96b5f Merge pull request #399 from jpmorganchase/private_state
validate input before calling evm
2018-06-14 11:40:03 +08:00
jpmsam be8f2f8426 validate input before calling evm 2018-06-14 11:39:22 +08:00
jpmsam 7608c1c9b8 validate input before calling evm 2018-06-07 15:45:24 -04:00
Qvintvs 622e98ad51 debug merge attempt 2018-05-31 14:21:16 +08:00
Qvintvs 4b44bea1d7 Merge attempt 2018-05-31 14:16:44 +08:00
Felix Lange 3caf16b15f
core: remove stray account creations in state transition (#16470)
The 'from' and 'to' methods on StateTransitions are reader methods and
shouldn't have inadvertent side effects on state.

It is safe to remove the check in 'from' because account existence is
implicitly checked by the nonce and balance checks. If the account has
non-zero balance or nonce, it must exist. Even if the sender account has
nonce zero at the start of the state transition or no balance, the nonce
is incremented before execution and the account will be created at that
time.

It is safe to remove the check in 'to' because the EVM creates the
account if necessary.

Fixes #15119
2018-04-10 15:33:25 +02:00
ferhat elmas dc7ca52b3b core: handle ignored error (#16065)
- according to implementation of `IntrinsicGas`
we can continue execution since problem will be detected
later. However, early return is future-proof for changes.
2018-02-14 22:02:51 +02:00
Péter Szilágyi 6f69cdd109
all: switch gas limits from big.Int to uint64 2018-01-03 14:45:35 +02:00
Patrick Mylund Nielsen 3d91976f08
Geth 1.7.2 rebase and addition of Istanbul BFT (#207) 2017-10-31 18:24:11 -04:00
Péter Szilágyi da7d57e07c
core: make txpool operate on immutable state 2017-09-05 13:34:41 +03:00
rjl493456442 28aea46ac0
core: implement Metropolis EIP 658, receipt status byte 2017-08-22 18:35:17 +03:00
Lewis Marshall 04d2de9119 core: Fix VM error logging
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-06-05 23:51:32 +01:00
changhong 17f0b11942
core: typos and comments improve
1. fix typos
2. methods recevier of struct should be same
3. comments improve

(cherry picked from commit 1ba979539582a00b7fd1a7c8a37a6852e59eac0d)
2017-05-25 17:14:33 +03:00
Péter Szilágyi 60293820b7
core: fix processing regression during receipt import 2017-05-08 12:09:35 +03:00
Péter Szilágyi 158d603528
consensus, core: drop all the legacy custom core error types 2017-04-06 17:34:19 +03:00
Péter Szilágyi e588e0ca2b
all: next batch of log polishes to contextual versions 2017-02-28 15:03:20 +02: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
Péter Szilágyi d4fd06c3dc
all: blidly swap out glog to our log15, logs need rework 2017-02-23 12:16:44 +02:00
Jeffrey Wilcke 024d41d0c2 core, core/state, core/vm: remove exported account getters (#3618)
Removed exported statedb object accessors, reducing the chance for nasty
bugs to creep in. It's also ugly and unnecessary to have these methods.
2017-02-22 23:29:59 +01:00
Felix Lange c8695fae35 logger: remove Core verbosity level (#3659) 2017-02-15 10:14:44 +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
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
Jeffrey Wilcke 508fdc3496 core: removal of dead-code
Removal of dead code that appeard as if we had a consensus issue. This
however is not the case as the proper error catching happens in the vm
package instead.
2017-01-17 21:50:08 +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
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
Jeffrey Wilcke 1097bdb1b6 core, eth: Fixed creation if private addresses on public state
Whenever a private transaction was initiated and executed the address
would be created on the public state when initialising the initial Call.
To prevent this we use the msg's address rather than using the to method
on the state transition object.

Improved private transaction tests by checking existance of private and
public addresses on the incorrect state.
2016-11-17 13:22:58 +01:00
Jeffrey Wilcke fb5564a7de core: added private tx test, added PrivateMessage
PrivateMessage embeds Message and requires IsPrivate() bool to be
defined on the implementation.
2016-11-17 12:15:04 +01:00
Jeffrey Wilcke 410edf0b1a core: set correct public state for all state transition functions
Fixed an issue where public state and private state were mixed during
the initial phase of the state transition. This causes severe issues
when creating new contracts (and addresses) and messes up the public
nonce, which, indirectly, has an effect on the contracts that are
created on the public state for both public and private txs.
2016-11-17 00:05:44 +01:00
Patrick Mylund Nielsen 46d00bf639 Return zero gas usage on private transactions whether or not you're party to the transaction 2016-11-16 13:03:42 -05:00
Patrick Mylund Nielsen 497ab68ce0 Increment sender nonce even if we are ignoring a private transaction 2016-11-16 12:57:41 -05:00
Patrick Mylund Nielsen 3c536c7db7 Remove whitespace in state_transition.go 2016-11-14 00:34:50 -05:00
Patrick Mylund Nielsen 13eb8db520 Add temporary PrivateTransactionManager integration 2016-11-14 00:33:56 -05:00
Jeffrey Wilcke 4dca5d4db7 core/types, params: EIP#155 2016-11-13 14:55:30 +01:00