1. 08 5月, 2017 1 次提交
  2. 06 4月, 2017 1 次提交
  3. 28 2月, 2017 1 次提交
  4. 27 2月, 2017 1 次提交
    • 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
  5. 23 2月, 2017 2 次提交
  6. 15 2月, 2017 1 次提交
  7. 14 2月, 2017 1 次提交
    • 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
  8. 13 2月, 2017 1 次提交
  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. 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
  11. 05 1月, 2017 1 次提交
    • 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
  12. 06 12月, 2016 1 次提交
    • J
      core, core/vm: implemented a generic environment (#3348) · 3fc7c978
      Jeffrey Wilcke 提交于
      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.
      3fc7c978
  13. 13 11月, 2016 2 次提交
  14. 11 7月, 2016 1 次提交
  15. 01 4月, 2016 2 次提交
    • J
      core: transition db now also returns the required gas amount · 1f3596c2
      Jeffrey Wilcke 提交于
      Exposes some core methods to transition and compute new state
      information and adds an additional return value to the transition db
      method to fetch required gas for that particular message (excluding gas
      refunds from any SSTORE[X] = 0 and SUICIDE.
      
      Fixes #2395
      1f3596c2
    • J
      core: added basic chain configuration · f0cbebb1
      Jeffrey Wilcke 提交于
      Added chain configuration options and write out during genesis database
      insertion. If no "config" was found, nothing is written to the database.
      
      Configurations are written on a per genesis base. This means
      that any chain (which is identified by it's genesis hash) can have their
      own chain settings.
      f0cbebb1
  16. 24 3月, 2016 1 次提交
  17. 18 2月, 2016 2 次提交
  18. 16 2月, 2016 1 次提交
  19. 17 10月, 2015 1 次提交
    • F
      core, core/state: move gas tracking out of core/state · de8d5aaa
      Felix Lange 提交于
      The amount of gas available for tx execution was tracked in the
      StateObject representing the coinbase account. This commit makes the gas
      counter a separate type in package core, which avoids unintended
      consequences of intertwining the counter with state logic.
      de8d5aaa
  20. 04 10月, 2015 1 次提交
    • J
      cmd/evm, core/vm, test: refactored VM and core · 361082ec
      Jeffrey Wilcke 提交于
      * 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`.
      361082ec
  21. 02 9月, 2015 1 次提交
  22. 24 7月, 2015 1 次提交
  23. 23 7月, 2015 1 次提交
  24. 07 7月, 2015 1 次提交
  25. 06 7月, 2015 1 次提交
  26. 04 7月, 2015 1 次提交
  27. 02 7月, 2015 1 次提交
  28. 30 6月, 2015 4 次提交
  29. 21 6月, 2015 1 次提交
  30. 17 6月, 2015 1 次提交
  31. 11 6月, 2015 1 次提交
  32. 10 6月, 2015 1 次提交
  33. 02 6月, 2015 1 次提交