Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Add RPC eth_chainId for querying the current blockchain chain ID #6329

Merged
merged 12 commits into from
Sep 26, 2017

Commits on Aug 18, 2017

  1. Add RPC eth_chainId for querying the current blockchain chain ID

    Currently although we can use `net_version` RPC call to get the
    current network ID, there's no RPC for querying the chain ID. This
    makes it impossible to determine the current actual blockchain using
    the RPC. An ETH/ETC client can accidentally connect to an ETC/ETH RPC
    endpoint without knowing it unless it tries to sign a transaction or
    it fetch a transaction that is known to have signed with a chain
    ID. This has since caused trouble for application developers, such as
    MetaMask, to add multi-chain support.
    
    The same RPC endpoint is also about to be merged for ETC's
    go-ethereum: ethereumproject/go-ethereum#336
    sorpaas committed Aug 18, 2017
    Configuration menu
    Copy the full SHA
    6995f05 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7f8f215 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fb354fc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    87787d2 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2017

  1. Configuration menu
    Copy the full SHA
    c3cfa16 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2017

  1. Configuration menu
    Copy the full SHA
    9bea238 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    29dcabb View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2017

  1. Configuration menu
    Copy the full SHA
    64e2256 View commit details
    Browse the repository at this point in the history
  2. Use U256 to return chainId and fix for master

    u64 returns decimal integer, and there seems to be no type called
    U64. So here I use U256 to return the hex integer.
    sorpaas committed Sep 17, 2017
    Configuration menu
    Copy the full SHA
    cf8e189 View commit details
    Browse the repository at this point in the history
  3. Fix chainID test

    Before EIP155 fork number, chainID should be null.
    sorpaas committed Sep 17, 2017
    Configuration menu
    Copy the full SHA
    b8beb21 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2017

  1. Change both parity_chainId and transaction::chainId to use U64

    This makes it consistent that all chain ids returned are hex string.
    sorpaas committed Sep 18, 2017
    Configuration menu
    Copy the full SHA
    4da73e9 View commit details
    Browse the repository at this point in the history
  2. Fix wrong U64 serialization

    sorpaas committed Sep 18, 2017
    Configuration menu
    Copy the full SHA
    1831fff View commit details
    Browse the repository at this point in the history