1. 04 Apr, 2017 1 commit
  2. 23 Mar, 2017 1 commit
    • Felix Lange's avatar
      core: refactor genesis handling · 37dd9086
      Felix Lange authored
      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
  3. 26 Feb, 2017 1 commit
    • Felix Lange's avatar
      common: move big integer math to common/math (#3699) · 5c8fe28b
      Felix Lange authored
      * 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
  4. 06 Jan, 2017 2 commits
  5. 13 Nov, 2016 1 commit
    • Jeffrey Wilcke's avatar
      core, core/state, trie: EIP158, reprice & skip empty account write · 445feaee
      Jeffrey Wilcke authored
      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: 's avatarJeffrey Wilcke <jeffrey@ethereum.org>
      445feaee
  6. 06 Oct, 2016 1 commit
  7. 15 Jul, 2016 1 commit
  8. 07 Jun, 2016 1 commit
  9. 15 Apr, 2016 1 commit
  10. 09 Mar, 2016 1 commit
  11. 18 Feb, 2016 1 commit
  12. 19 Nov, 2015 1 commit
  13. 21 Oct, 2015 1 commit
  14. 19 Oct, 2015 1 commit
  15. 16 Oct, 2015 1 commit
    • Jeffrey Wilcke's avatar
      core, eth/filters, miner, xeth: Optimised log filtering · 6dc14788
      Jeffrey Wilcke authored
      Log filtering is now using a MIPmap like approach where addresses of
      logs are added to a mapped bloom bin. The current levels for the MIP are
      in ranges of 1.000.000, 500.000, 100.000, 50.000, 1.000. Logs are
      therefor filtered in batches of 1.000.
      6dc14788
  16. 11 Sep, 2015 1 commit
  17. 05 Aug, 2015 1 commit