- 08 Jun, 2020 1 commit
-
-
Paweł Bylica authored
* core/vm: use fixed uint256 library instead of big * core/vm: remove intpools * core/vm: upgrade uint256, fixes uint256.NewFromBig * core/vm: use uint256.Int by value in Stack * core/vm: upgrade uint256 to v1.0.0 * core/vm: don't preallocate space for 1024 stack items (only 16) Co-authored-by:
Martin Holst Swende <martin@swende.se>
-
- 12 Mar, 2019 1 commit
-
-
Martin Holst Swende authored
* core/vm: remove function call for stack validation from evm runloop * core/vm: separate gas calc into static + dynamic * core/vm: optimize push1 * core/vm: reuse pooled bigints for ADDRESS, ORIGIN and CALLER * core/vm: use generic error message for jump/jumpi, to avoid string interpolation * testdata: fix tests for new error message * core/vm: use 64-bit memory calculations * core/vm: fix error in memory calculation * core/vm: address review concerns * core/vm: avoid unnecessary use of big.Int:BitLen()
-
- 14 Aug, 2017 1 commit
-
-
Péter Szilágyi authored
-
- 28 Feb, 2017 1 commit
-
-
Felix Lange authored
* common/math: optimize PaddedBigBytes, use it more name old time/op new time/op delta PaddedBigBytes-8 71.1ns ± 5% 46.1ns ± 1% -35.15% (p=0.000 n=20+19) name old alloc/op new alloc/op delta PaddedBigBytes-8 48.0B ± 0% 32.0B ± 0% -33.33% (p=0.000 n=20+20) * all: unify big.Int zero checks Various checks were in use. This commit replaces them all with Int.Sign, which is cheaper and less code. eg templates: func before(x *big.Int) bool { return x.BitLen() == 0 } func after(x *big.Int) bool { return x.Sign() == 0 } func before(x *big.Int) bool { return x.BitLen() > 0 } func after(x *big.Int) bool { return x.Sign() != 0 } func before(x *big.Int) int { return x.Cmp(common.Big0) } func after(x *big.Int) int { return x.Sign() } * common/math, crypto/secp256k1: make ReadBits public in package math
-
- 26 Feb, 2017 1 commit
-
-
Felix Lange authored
* 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
-
- 13 Feb, 2017 2 commits
-
-
Jeffrey Wilcke authored
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
-
Jeffrey Wilcke authored
This reverts commit 8b57c494.
-
- 02 Feb, 2017 1 commit
-
-
Jeffrey Wilcke authored
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
-
- 23 Mar, 2016 1 commit
-
-
Jeffrey Wilcke authored
The EVM is now initialised with an additional configured object that allows you to turn on debugging options.
-
- 22 Mar, 2016 1 commit
-
-
Jeffrey Wilcke authored
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.
-
- 02 Feb, 2016 1 commit
-
-
Peter Pratscher authored
Integrated code review suggestions Integrated last review comments
-
- 03 Oct, 2015 2 commits
-
-
Jeffrey Wilcke authored
* Renamed ChainManager to BlockChain * Checkpointing is no longer required and never really properly worked when the state was corrupted.
-
Jeffrey Wilcke authored
* 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`.
-
- 23 Jul, 2015 1 commit
-
-
Felix Lange authored
I forgot to update one instance of "go-ethereum" in commit 3f047be5.
-
- 22 Jul, 2015 1 commit
-
-
Felix Lange authored
All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
-
- 07 Jul, 2015 1 commit
-
-
Felix Lange authored
-
- 04 Apr, 2015 1 commit
-
-
obscuren authored
-
- 02 Apr, 2015 1 commit
-
-
Gustav Simonsson authored
* Add params package with exported variables generated from github.com/ethereum/common/blob/master/params.json * Use params package variables in applicable places * Add check for minimum gas limit in validation of block's gas limit * Remove common/params.json from go-ethereum to avoid outdated version of it
-
- 28 Mar, 2015 2 commits
- 23 Mar, 2015 1 commit
-
-
obscuren authored
-
- 19 Mar, 2015 2 commits
- 16 Mar, 2015 2 commits
- 13 Mar, 2015 1 commit
-
-
obscuren authored
* Cleaned up VM execution. VM run now takes a context * ADDMOD/MULMOD - removed incorrect cast
-
- 06 Mar, 2015 1 commit
-
-
obscuren authored
-
- 03 Mar, 2015 3 commits
- 02 Mar, 2015 1 commit
-
-
obscuren authored
-
- 01 Feb, 2015 1 commit
-
-
obscuren authored
-
- 19 Jan, 2015 1 commit
-
-
obscuren authored
-
- 12 Jan, 2015 1 commit
-
-
Paweł Bylica authored
-
- 06 Jan, 2015 1 commit
-
-
obscuren authored
-
- 05 Jan, 2015 1 commit
-
-
obscuren authored
* Added pre-compiled contract 0x04 (mem cpy) * Changed depth error to return the gas instead of consuming
-
- 18 Dec, 2014 1 commit
-
-
obscuren authored
-
- 17 Dec, 2014 1 commit
-
-
obscuren authored
* Depth check has been moved to the execution * Pre compiled execution has been moved to the VM * PrecompiledAddress has been renamed to PrecompiledAccount
-
- 12 Dec, 2014 2 commits