Commit Graph

12 Commits

Author SHA1 Message Date
5f7826270c all: unify big.Int zero checks, use common/math in more places (#3716)
* 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
2017-02-28 15:09:11 +01:00
d4fd06c3dc all: blidly swap out glog to our log15, logs need rework 2017-02-23 12:16:44 +02:00
c8695fae35 logger: remove Core verbosity level (#3659) 2017-02-15 10:14:44 +01:00
3fc7c97827 core, core/vm: implemented a generic environment (#3348)
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.
2016-12-06 02:16:03 +01:00
665bb43a4c light: implemented VMState.Empty() (#3357) 2016-11-28 11:31:15 +01:00
760fd65487 light: light chain, VM env and tx pool 2016-11-09 02:12:53 +01:00
22eea17b06 light: fix memory expansion bug (same as fix for core/state) 2016-09-19 15:26:55 -04:00
b6b17e5648 core/state, light: remove unused StateObject.initCode 2016-09-19 02:16:58 -04:00
d04a2e7557 all: update license information 2016-04-15 09:48:05 +02:00
436fc8d76a all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()
As we aren't really using the standarized SHA-3
2016-02-21 22:34:34 +00:00
19b2640e89 rpc: migrated the RPC insterface to a new reflection based RPC layer 2016-01-26 13:51:50 +01:00
ef422ee1e1 light: implemented odr-capable trie and state structures 2015-12-17 16:07:54 +01:00