1. 15 12月, 2017 1 次提交
  2. 29 11月, 2017 1 次提交
    • F
      core/vm: track 63/64 call gas off stack (#15563) · be12392f
      Felix Lange 提交于
      * core/vm: track 63/64 call gas off stack
      
      Gas calculations in gasCall* relayed the available gas for calls by
      replacing it on the stack. This lead to inconsistent traces, which we
      papered over by copying the pre-execution stack in trace mode.
      
      This change relays available gas using a temporary variable, off the
      stack, and allows removing the weird copy.
      
      * core/vm: remove stackCopy
      
      * core/vm: pop call gas into pool
      
      * core/vm: to -> addr
      be12392f
  3. 14 9月, 2017 2 次提交
  4. 04 9月, 2017 1 次提交
  5. 25 8月, 2017 1 次提交
  6. 22 8月, 2017 1 次提交
  7. 17 8月, 2017 1 次提交
  8. 16 8月, 2017 1 次提交
  9. 15 8月, 2017 2 次提交
  10. 14 8月, 2017 1 次提交
  11. 11 8月, 2017 1 次提交
  12. 18 5月, 2017 1 次提交
    • J
      consensus, core/*, params: metropolis preparation refactor · 10a57fc3
      Jeffrey Wilcke 提交于
      This commit is a preparation for the upcoming metropolis hardfork. It
      prepares the state, core and vm packages such that integration with
      metropolis becomes less of a hassle.
      
      * Difficulty calculation requires header instead of individual
        parameters
      * statedb.StartRecord renamed to statedb.Prepare and added Finalise
        method required by metropolis, which removes unwanted accounts from
        the state (i.e. selfdestruct)
      * State keeps record of destructed objects (in addition to dirty
        objects)
      * core/vm pre-compiles may now return errors
      * core/vm pre-compiles gas check now take the full byte slice as argument
        instead of just the size
      * core/vm now keeps several hard-fork instruction tables instead of a
        single instruction table and removes the need for hard-fork checks in
        the instructions
      * core/vm contains a empty restruction function which is added in
        preparation of metropolis write-only mode operations
      * Adds the bn256 curve
      * Adds and sets the metropolis chain config block parameters (2^64-1)
      10a57fc3
  13. 28 2月, 2017 1 次提交
    • F
      all: unify big.Int zero checks, use common/math in more places (#3716) · 5f782627
      Felix Lange 提交于
      * 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
      5f782627
  14. 23 2月, 2017 1 次提交
  15. 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
  16. 13 2月, 2017 1 次提交
  17. 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
  18. 07 1月, 2017 1 次提交
  19. 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
  20. 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
  21. 13 11月, 2016 1 次提交
    • J
      core, core/state, trie: EIP158, reprice & skip empty account write · 445feaee
      Jeffrey Wilcke 提交于
      This commit implements EIP158 part 1, 2, 3 & 4
      
      1. If an account is empty it's no longer written to the trie. An empty
        account is defined as (balance=0, nonce=0, storage=0, code=0).
      2. Delete an empty account if it's touched
      3. An empty account is redefined as either non-existent or empty.
      4. Zero value calls and zero value suicides no longer consume the 25k
        reation costs.
      
      params: moved core/config to params
      Signed-off-by: NJeffrey Wilcke <jeffrey@ethereum.org>
      445feaee
  22. 15 10月, 2016 1 次提交
    • J
      core, core/vm: added gas price variance table · 64af2aaf
      Jeffrey Wilcke 提交于
      This implements 1b & 1c of EIP150 by adding a new GasTable which must be
      returned from the RuleSet config method. This table is used to determine
      the gas prices for the current epoch.
      
      Please note that when the CreateBySuicide gas price is set it is assumed
      that we're in the new epoch phase.
      
      In addition this PR will serve as temporary basis while refactorisation
      in being done in the EVM64 PR, which will substentially overhaul the gas
      price code.
      64af2aaf
  23. 06 10月, 2016 2 次提交
  24. 01 10月, 2016 1 次提交
  25. 26 9月, 2016 1 次提交
  26. 22 8月, 2016 1 次提交
    • N
      core/vm: Refactor tracing to make Tracer the main interface · 781915f1
      Nick Johnson 提交于
      This CL makes several refactors:
       - Define a Tracer interface, implementing the `CaptureState` method
       - Add the VM environment as the first argument of
         `Tracer.CaptureState`
       - Rename existing functionality `StructLogger` an make it an
         implementation of `Tracer`
       - Delete `StructLogCollector` and make `StructLogger` collect the logs
         directly
       - Change all callers to use the new `StructLogger` where necessary and
         extract logs from that.
       - Deletes the apparently obsolete and likely nonfunctional 'TraceCall'
         from the eth API.
      
      Callers that only wish accumulated logs can use the `StructLogger`
      implementation straightforwardly. Callers that wish to efficiently
      capture VM traces and operate on them without excessive copying can now
      implement the `Tracer` interface to receive VM state at each step and
      do with it as they wish.
      
      This CL also removes the accumulation of logs from the vm.Environment;
      this was necessary as part of the refactor, but also simplifies it by
      removing a responsibility that doesn't directly belong to the
      Environment.
      781915f1
  27. 29 6月, 2016 1 次提交
  28. 22 6月, 2016 1 次提交
    • J
      test, cmd/evm, core, core/vm: illegal code hash implementation · 7a5b571c
      Jeffrey Wilcke 提交于
      This implements a generic approach to enabling soft forks by allowing
      anyone to put in hashes of contracts that should not be interacted from.
      This will help "The DAO" in their endevour to stop any whithdrawals from
      any DAO contract by convincing the mining community to accept their code
      hash.
      7a5b571c
  29. 16 6月, 2016 1 次提交
  30. 01 4月, 2016 1 次提交
    • 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
  31. 24 3月, 2016 1 次提交
  32. 23 3月, 2016 1 次提交
  33. 16 3月, 2016 1 次提交
  34. 18 2月, 2016 2 次提交
  35. 12 1月, 2016 1 次提交
  36. 21 10月, 2015 1 次提交