1. 12 2月, 2018 2 次提交
    • M
      rpc: dns rebind protection (#15962) · 589b603a
      Martin Holst Swende 提交于
      * cmd,node,rpc: add allowedHosts to prevent dns rebinding attacks
      
      * p2p,node: Fix bug with dumpconfig introduced in r54aeb8e4
      
      * rpc: add wildcard support for rpcallowedhosts + go fmt
      
      * cmd/geth, cmd/utils, node, rpc: ignore direct ip(v4/6) addresses in rpc virtual hostnames check
      
      * http, rpc, utils: make vhosts into map, address review concerns
      
      * node: change log messages to use geth standard (not sprintf)
      
      * rpc: fix spelling
      589b603a
    • F
      p2p, p2p/discover: misc connectivity improvements (#16069) · 9123eceb
      Felix Lange 提交于
      * p2p: add DialRatio for configuration of inbound vs. dialed connections
      
      * p2p: add connection flags to PeerInfo
      
      * p2p/netutil: add SameNet, DistinctNetSet
      
      * p2p/discover: improve revalidation and seeding
      
      This changes node revalidation to be periodic instead of on-demand. This
      should prevent issues where dead nodes get stuck in closer buckets
      because no other node will ever come along to replace them.
      
      Every 5 seconds (on average), the last node in a random bucket is
      checked and moved to the front of the bucket if it is still responding.
      If revalidation fails, the last node is replaced by an entry of the
      'replacement list' containing recently-seen nodes.
      
      Most close buckets are removed because it's very unlikely we'll ever
      encounter a node that would fall into any of those buckets.
      
      Table seeding is also improved: we now require a few minutes of table
      membership before considering a node as a potential seed node. This
      should make it less likely to store short-lived nodes as potential
      seeds.
      
      * p2p/discover: fix nits in UDP transport
      
      We would skip sending neighbors replies if there were fewer than
      maxNeighbors results and CheckRelayIP returned an error for the last
      one. While here, also resolve a TODO about pong reply tokens.
      9123eceb
  2. 22 1月, 2018 1 次提交
    • F
      p2p, p2p/discover, p2p/discv5: implement UDP port sharing (#15200) · 92580d69
      Felföldi Zsolt 提交于
      This commit affects p2p/discv5 "topic discovery" by running it on
      the same UDP port where the old discovery works. This is realized
      by giving an "unhandled" packet channel to the old v4 discovery
      packet handler where all invalid packets are sent. These packets
      are then processed by v5. v5 packets are always invalid when
      interpreted by v4 and vice versa. This is ensured by adding one
      to the first byte of the packet hash in v5 packets.
      
      DiscoveryV5Bootnodes is also changed to point to new bootnodes
      that are implementing the changed packet format with modified
      hash. Existing and new v5 bootnodes are both running on different
      ports ATM.
      92580d69
  3. 01 12月, 2017 1 次提交
    • L
      p2p/simulations: various stability fixes (#15198) · 54aeb8e4
      Lewis Marshall 提交于
      p2p/simulations: introduce dialBan
      
      - Refactor simulations/network connection getters to support
        avoiding simultaneous dials between two peers If two peers dial
        simultaneously, the connection will be dropped to help avoid
        that, we essentially lock the connection object with a
        timestamp which serves as a ban on dialing for a period of time
        (dialBanTimeout).
      
      - The connection getter InitConn can be wrapped and passed to the
        nodes via adapters.NodeConfig#Reachable field and then used by
        the respective services when they initiate connections. This
        massively stablise the emerging connectivity when running with
        hundreds of nodes bootstrapping a network.
      
      p2p: add Inbound public method to p2p.Peer
      
      p2p/simulations: Add server id to logs to support debugging
      in-memory network simulations when multiple peers are logging.
      
      p2p: SetupConn now returns error. The dialer checks the error and
      only calls resolve if the actual TCP dial fails.
      54aeb8e4
  4. 25 9月, 2017 1 次提交
    • L
      p2p: add network simulation framework (#14982) · 9feec51e
      Lewis Marshall 提交于
      This commit introduces a network simulation framework which
      can be used to run simulated networks of devp2p nodes. The
      intention is to use this for testing protocols, performing
      benchmarks and visualising emergent network behaviour.
      9feec51e
  5. 12 4月, 2017 1 次提交
    • F
      cmd/geth: add --config file flag (#13875) · 30d706c3
      Felix Lange 提交于
      * p2p/discover, p2p/discv5: add marshaling methods to Node
      
      * p2p/netutil: make Netlist decodable from TOML
      
      * common/math: encode nil HexOrDecimal256 as 0x0
      
      * cmd/geth: add --config file flag
      
      * cmd/geth: add missing license header
      
      * eth: prettify Config again, fix tests
      
      * eth: use gasprice.Config instead of duplicating its fields
      
      * eth/gasprice: hide nil default from dumpconfig output
      
      * cmd/geth: hide genesis block in dumpconfig output
      
      * node: make tests compile
      
      * console: fix tests
      
      * cmd/geth: make TOML keys look exactly like Go struct fields
      
      * p2p: use discovery by default
      
      This makes the zero Config slightly more useful. It also fixes package
      node tests because Node detects reuse of the datadir through the
      NodeDatabase.
      
      * cmd/geth: make ethstats URL settable through config file
      
      * cmd/faucet: fix configuration
      
      * cmd/geth: dedup attach tests
      
      * eth: add comment for DefaultConfig
      
      * eth: pass downloader.SyncMode in Config
      
      This removes the FastSync, LightSync flags in favour of a more
      general SyncMode flag.
      
      * cmd/utils: remove jitvm flags
      
      * cmd/utils: make mutually exclusive flag error prettier
      
      It now reads:
      
         Fatal: flags --dev, --testnet can't be used at the same time
      
      * p2p: fix typo
      
      * node: add DefaultConfig, use it for geth
      
      * mobile: add missing NoDiscovery option
      
      * cmd/utils: drop MakeNode
      
      This exposed a couple of places that needed to be updated to use
      node.DefaultConfig.
      
      * node: fix typo
      
      * eth: make fast sync the default mode
      
      * cmd/utils: remove IPCApiFlag (unused)
      
      * node: remove default IPC path
      
      Set it in the frontends instead.
      
      * cmd/geth: add --syncmode
      
      * cmd/utils: make --ipcdisable and --ipcpath mutually exclusive
      
      * cmd/utils: don't enable WS, HTTP when setting addr
      
      * cmd/utils: fix --identity
      30d706c3
  6. 11 4月, 2017 1 次提交
  7. 28 2月, 2017 1 次提交
  8. 23 2月, 2017 1 次提交
  9. 07 1月, 2017 1 次提交
  10. 23 11月, 2016 1 次提交
  11. 15 11月, 2016 1 次提交
  12. 14 11月, 2016 1 次提交
  13. 09 11月, 2016 1 次提交
  14. 15 7月, 2016 1 次提交
  15. 18 5月, 2016 1 次提交
  16. 03 5月, 2016 1 次提交
  17. 18 12月, 2015 1 次提交
  18. 03 12月, 2015 1 次提交
  19. 28 10月, 2015 1 次提交
  20. 20 8月, 2015 1 次提交
  21. 19 8月, 2015 1 次提交
  22. 04 8月, 2015 1 次提交
  23. 24 7月, 2015 1 次提交
  24. 23 7月, 2015 1 次提交
  25. 07 7月, 2015 2 次提交
  26. 24 6月, 2015 1 次提交
  27. 22 6月, 2015 1 次提交
    • F
      p2p: throttle all discovery lookups · 6fb810ad
      Felix Lange 提交于
      Lookup calls would spin out of control when network connectivity was
      lost. The throttling that was in place only took effect when the table
      returned zero results, which doesn't happen very often.
      
      The new throttling should not have a negative impact when the host is
      online. Lookups against the network take some time and dials for all
      results must complete or hit the cache before a new one is started. This
      usually takes longer than four seconds, leaving online lookups
      unaffected.
      
      Fixes #1296
      6fb810ad
  28. 09 6月, 2015 1 次提交
  29. 27 5月, 2015 2 次提交
  30. 26 5月, 2015 1 次提交
  31. 25 5月, 2015 3 次提交
    • F
      p2p: decrease frameReadTimeout to 30s · 9e1fd70b
      Felix Lange 提交于
      This detects hanging connections sooner. We send a ping every 15s and
      other implementation have similar limits.
      9e1fd70b
    • F
      p2p: new dialer, peer management without locks · 1440f9a3
      Felix Lange 提交于
      The most visible change is event-based dialing, which should be an
      improvement over the timer-based system that we have at the moment.
      The dialer gets a chance to compute new tasks whenever peers change or
      dials complete. This is better than checking peers on a timer because
      dials happen faster. The dialer can now make more precise decisions
      about whom to dial based on the peer set and we can test those
      decisions without actually opening any sockets.
      
      Peer management is easier to test because the tests can inject
      connections at checkpoints (after enc handshake, after protocol
      handshake).
      
      Most of the handshake stuff is now part of the RLPx code. It could be
      exported or move to its own package because it is no longer entangled
      with Server logic.
      1440f9a3
    • F
      p2p: delete Server.Broadcast · dbdc5fd4
      Felix Lange 提交于
      dbdc5fd4
  32. 14 5月, 2015 1 次提交
  33. 08 5月, 2015 3 次提交