1. 23 3月, 2017 1 次提交
    • F
      all: import "context" instead of "golang.org/x/net/context" · c213fd1f
      Felix Lange 提交于
      There is no need to depend on the old context package now that the
      minimum Go version is 1.7. The move to "context" eliminates our weird
      vendoring setup. Some vendored code still uses golang.org/x/net/context
      and it is now vendored in the normal way.
      
      This change triggered new vet checks around context.WithTimeout which
      didn't fire with golang.org/x/net/context.
      c213fd1f
  2. 16 3月, 2017 1 次提交
  3. 09 3月, 2017 1 次提交
  4. 02 3月, 2017 1 次提交
    • P
      Logger updates 3 (#3730) · 9184249b
      Péter Szilágyi 提交于
      * accounts, cmd, eth, ethdb: port logs over to new system
      
      * ethdb: drop concept of cache distribution between dbs
      
      * eth: fix some log nitpicks to make them nicer
      9184249b
  5. 28 2月, 2017 2 次提交
    • 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
    • P
      e588e0ca
  6. 27 2月, 2017 2 次提交
    • P
      46eea4d1
    • 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
  7. 23 2月, 2017 2 次提交
  8. 18 2月, 2017 1 次提交
  9. 17 2月, 2017 1 次提交
  10. 13 2月, 2017 12 次提交
  11. 03 2月, 2017 1 次提交
  12. 21 1月, 2017 1 次提交
    • P
      accounts/abi/bind, internal/ethapi: binary search gas estimation (#3587) · 682875ad
      Péter Szilágyi 提交于
      Gas estimation currently mostly works, but can underestimate for more funky
      refunds. This is because various ops (e.g. CALL) need more gas to run than they
      actually consume (e.g. 2300 stipend that is refunded if not used). With more
      intricate contract interplays, it becomes almost impossible to return a proper
      value to the user.
      
      This commit swaps out the simplistic gas estimation to a binary search approach,
      honing in on the correct gas use. This does mean that gas estimation needs to
      rerun the transaction log(max-price) times to measure whether it fails or not,
      but it's a price paid by the transaction issuer, and it should be worth it to
      support proper estimates.
      682875ad
  13. 17 1月, 2017 2 次提交
  14. 13 1月, 2017 1 次提交
  15. 09 1月, 2017 5 次提交
  16. 07 1月, 2017 1 次提交
  17. 06 1月, 2017 2 次提交
    • F
      all: gofmt -w -s · 35a7dcb1
      Felix Lange 提交于
      35a7dcb1
    • F
      core/vm: move Log to core/types · 77310619
      Felix Lange 提交于
      This significantly reduces the dependency closure of ethclient, which no
      longer depends on core/vm as of this change.
      
      All uses of vm.Logs are replaced by []*types.Log. NewLog is gone too,
      the constructor simply returned a literal.
      77310619
  18. 05 1月, 2017 3 次提交