1. 28 2月, 2017 2 次提交
  2. 27 2月, 2017 2 次提交
    • V
    • F
      common: move big integer math to common/math (#3699) · 5c8fe28b
      Felix Lange 提交于
      * 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
      5c8fe28b
  3. 23 2月, 2017 3 次提交
  4. 21 2月, 2017 1 次提交
  5. 18 2月, 2017 2 次提交
  6. 15 2月, 2017 1 次提交
  7. 14 2月, 2017 2 次提交
    • J
      params: core, core/vm, miner: 64bit gas instructions · c12f4df9
      Jeffrey Wilcke 提交于
      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
      c12f4df9
    • M
      core, eth, internal: Added `debug_getBadBlocks()` method (#3654) · 72dcd3c5
      Martin Holst Swende 提交于
      * core,eth,internal: Added `debug_getBadBlocks()` method
      
      When bad blocks are discovered, these are stored within geth.
      An RPC-endpoint makes them availablewithin the `debug`
      namespace. This feature makes it easier to discover network forks.
      
      ```
      
      * core, api: go format + docs
      
      * core/blockchain: Documentation, fix minor nitpick
      
      * core: fix failing blockchain test
      72dcd3c5
  8. 13 2月, 2017 2 次提交
  9. 02 2月, 2017 1 次提交
    • J
      params: core, core/vm, miner: 64bit gas instructions (#3514) · 8b57c494
      Jeffrey Wilcke 提交于
      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
      8b57c494
  10. 01 2月, 2017 1 次提交
  11. 27 1月, 2017 1 次提交
  12. 26 1月, 2017 1 次提交
  13. 25 1月, 2017 2 次提交
    • F
      event: deprecate TypeMux and related types · 9b62facd
      Felix Lange 提交于
      The Subscription type is gone, all uses are replaced by
      *TypeMuxSubscription. This change is prep-work for the
      introduction of the new Subscription type in a later commit.
      
         gorename -from '"github.com/ethereum/go-ethereum/event"::Event' -to TypeMuxEvent
         gorename -from '"github.com/ethereum/go-ethereum/event"::muxsub' -to TypeMuxSubscription
         gofmt -w -r 'Subscription -> *TypeMuxSubscription' ./event/*.go
         find . -name '*.go' -and -not -regex '\./vendor/.*' \| xargs gofmt -w -r 'event.Subscription -> *event.TypeMuxSubscription'
      9b62facd
    • M
      core/genesis: add support for setting nonce in 'alloc' · da92f5b2
      Martin Holst Swende 提交于
      This is to be able to set `pre`-state when performing blockchain tests through Hive, we need to be able to set the nonce.
      da92f5b2
  14. 24 1月, 2017 1 次提交
  15. 21 1月, 2017 1 次提交
  16. 18 1月, 2017 1 次提交
    • J
      core: removal of dead-code · 508fdc34
      Jeffrey Wilcke 提交于
      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.
      508fdc34
  17. 17 1月, 2017 2 次提交
  18. 13 1月, 2017 1 次提交
  19. 12 1月, 2017 1 次提交
  20. 11 1月, 2017 1 次提交
  21. 09 1月, 2017 2 次提交
  22. 07 1月, 2017 3 次提交
  23. 06 1月, 2017 3 次提交
  24. 05 1月, 2017 3 次提交
    • F
      e171bf74
    • J
      core/vm: improved EVM run loop & instruction calling (#3378) · bbc4ea4a
      Jeffrey Wilcke 提交于
      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.
      bbc4ea4a
    • P
      accounts, core, crypto, internal: use normalised V during signature handling (#3455) · 08eea0f0
      Péter Szilágyi 提交于
      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.
      08eea0f0