1. 25 11月, 2020 1 次提交
  2. 28 7月, 2020 2 次提交
  3. 09 7月, 2020 1 次提交
  4. 02 7月, 2020 1 次提交
    • M
      core, txpool: less allocations when handling transactions (#21232) · af5c97ae
      Marius van der Wijden 提交于
      * core: use uint64 for total tx costs instead of big.Int
      
      * core: added local tx pool test case
      
      * core, crypto: various allocation savings regarding tx handling
      
      * Update core/tx_list.go
      
      * core: added tx.GasPriceIntCmp for comparison without allocation
      
      adds a method to remove unneeded allocation in comparison to tx.gasPrice
      
      * core: handle pools full of locals better
      
      * core/tests: benchmark for tx_list
      
      * core/txlist, txpool: save a reheap operation, avoid some bigint allocs
      Co-authored-by: NMartin Holst Swende <martin@swende.se>
      af5c97ae
  5. 30 6月, 2020 1 次提交
    • M
      core: types: less allocations when hashing and tx handling (#21265) · ddeea1e0
      Marius van der Wijden 提交于
      * core, crypto: various allocation savings regarding tx handling
      
      * core: reduce allocs for gas price comparison
      
      This change reduces the allocations needed for comparing different transactions to each other.
      A call to `tx.GasPrice()` copies the gas price as it has to be safe against modifications and
      also needs to be threadsafe. For comparing and ordering different transactions we don't need
      these guarantees
      
      * core: added tx.GasPriceIntCmp for comparison without allocation
      
      adds a method to remove unneeded allocation in comparison to tx.gasPrice
      
      * core/types: pool legacykeccak256 objects in rlpHash
      
      rlpHash is by far the most used function in core that allocates a legacyKeccak256 object on each call.
      Since it is so widely used it makes sense to add pooling here so we relieve the GC.
      On my machine these changes result in > 100 MILLION less allocations and > 30 GB less allocated memory.
      
      * reverted some changes
      
      * reverted some changes
      
      * trie: use crypto.KeccakState instead of replicating code
      Co-authored-by: NMartin Holst Swende <martin@swende.se>
      ddeea1e0
  6. 12 6月, 2019 1 次提交
  7. 29 12月, 2018 1 次提交
  8. 30 9月, 2018 1 次提交
  9. 20 8月, 2018 1 次提交
  10. 09 7月, 2018 1 次提交
  11. 19 6月, 2018 1 次提交
  12. 24 4月, 2018 1 次提交
  13. 18 4月, 2018 1 次提交
  14. 05 4月, 2018 1 次提交
    • S
      core/types: remove String methods from struct types (#16205) · ec8ee611
      Steven Roose 提交于
      Most of these methods did not contain all the relevant information
      inside the object and were not using a similar formatting type.
      Moreover, the existence of a suboptimal String method breaks usage
      with more advanced data dumping tools like go-spew.
      ec8ee611
  15. 06 2月, 2018 1 次提交
  16. 03 1月, 2018 1 次提交
  17. 21 12月, 2017 1 次提交
  18. 07 12月, 2017 1 次提交
  19. 01 10月, 2017 1 次提交
    • F
      ethclient, mobile: add TransactionSender (#15127) · d78ad226
      Felix Lange 提交于
      * core/types: make Signer derive address instead of public key
      
      There are two reasons to do this now: The upcoming ethclient signer
      doesn't know the public key, just the address. EIP 208 will introduce a
      new signer which derives the 'entry point' address for transactions with
      zero signature. The entry point has no public key.
      
      Other changes to the interface ease the path make to moving signature
      crypto out of core/types later.
      
      * ethclient, mobile: add TransactionSender
      
      The new method can get the right signer without any crypto, and without
      knowledge of the signature scheme that was used when the transaction was
      included.
      d78ad226
  20. 08 9月, 2017 1 次提交
  21. 24 8月, 2017 1 次提交
  22. 06 4月, 2017 1 次提交
  23. 29 3月, 2017 1 次提交
  24. 25 3月, 2017 1 次提交
  25. 23 3月, 2017 1 次提交
    • F
      core: refactor genesis handling · 37dd9086
      Felix Lange 提交于
      This commit solves several issues concerning the genesis block:
      
      * Genesis/ChainConfig loading was handled by cmd/geth code. This left
        library users in the cold. They could specify a JSON-encoded
        string and overwrite the config, but didn't get any of the additional
        checks performed by geth.
      * Decoding and writing of genesis JSON was conflated in
        WriteGenesisBlock. This made it a lot harder to embed the genesis
        block into the forthcoming config file loader. This commit changes
        things so there is a single Genesis type that represents genesis
        blocks. All uses of Write*Genesis* are changed to use the new type
        instead.
      * If the chain config supplied by the user was incompatible with the
        current chain (i.e. the chain had already advanced beyond a scheduled
        fork), it got overwritten. This is not an issue in practice because
        previous forks have always had the highest total difficulty. It might
        matter in the future though. The new code reverts the local chain to
        the point of the fork when upgrading configuration.
      
      The change to genesis block data removes compression library
      dependencies from package core.
      37dd9086
  26. 07 3月, 2017 1 次提交
  27. 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
  28. 24 1月, 2017 1 次提交
  29. 21 1月, 2017 1 次提交
  30. 05 1月, 2017 2 次提交
  31. 29 11月, 2016 1 次提交
  32. 28 11月, 2016 1 次提交
  33. 14 11月, 2016 1 次提交
  34. 13 11月, 2016 1 次提交
  35. 29 10月, 2016 1 次提交
    • B
      internal/ethapi: add personal_sign and fix eth_sign to hash message (#2940) · b59c8399
      bas-vk 提交于
      This commit includes several API changes:
      
      - The behavior of eth_sign is changed. It now accepts an arbitrary
        message, prepends the well-known string
      
              \x19Ethereum Signed Message:\n<length of message>
      
        hashes the result using keccak256 and calculates the signature of
        the hash. This breaks backwards compatability!
        
      - personal_sign(hash, address [, password]) is added. It has the same
        semantics as eth_sign but also accepts a password. The private key
        used to sign the hash is temporarily unlocked in the scope of the
        request.
        
      - personal_recover(message, signature) is added and returns the
        address for the account that created a signature.
      b59c8399
  36. 08 9月, 2016 1 次提交
  37. 02 9月, 2016 2 次提交