good morning!!!!

Skip to content
Snippets Groups Projects
  1. Feb 05, 2021
  2. Feb 02, 2021
  3. Jan 26, 2021
    • Zsolt Felföldi's avatar
      les: switch to new discv5 (#21940) · a72fa88a
      Zsolt Felföldi authored
      
      This PR enables running the new discv5 protocol in both LES client
      and server mode. In client mode it mixes discv5 and dnsdisc iterators
      (if both are enabled) and filters incoming ENRs for "les" tag and fork ID.
      The old p2p/discv5 package and all references to it are removed.
      
      Co-authored-by: default avatarFelix Lange <fjl@twurst.com>
      a72fa88a
  4. Jan 25, 2021
  5. Jan 13, 2021
  6. Dec 09, 2020
    • Felix Lange's avatar
      p2p/enode: avoid crashing for invalid IP (#21981) · 817a3fb5
      Felix Lange authored
      The database panicked for invalid IPs. This is usually no problem
      because all code paths leading to node DB access verify the IP, but it's
      dangerous because improper validation can turn this panic into a DoS
      vulnerability. The quick fix here is to just turn database accesses
      using invalid IP into a noop. This isn't great, but I'm planning to
      remove the node DB for discv5 long-term, so it should be fine to have
      this quick fix for half a year.
      
      Fixes #21849
      817a3fb5
  7. Nov 30, 2020
  8. Nov 25, 2020
  9. Nov 20, 2020
  10. Nov 10, 2020
    • Gary Rong's avatar
      p2p/simulations/adapters/exec: fix some issues (#21801) · c52dfd55
      Gary Rong authored
      - Remove the ws:// prefix from the status endpoint since
        the ws:// is already included in the stack.WSEndpoint().
      - Don't register the services again in the node start.
        Registration is already done in the initialization stage.
      - Expose admin namespace via websocket.
        This namespace is necessary for connecting the peers via websocket.
      - Offer logging relevant options for exec adapter.
        It's really painful to mix all log output in the single console. So
        this PR offers two additional options for exec adapter in this case
        testers can config the log output(e.g. file output) and log level
        for each p2p node.
      c52dfd55
  11. Oct 30, 2020
    • Gary Rong's avatar
      les, p2p/simulations/adapters: fix issues found while simulating les (#21761) · b63bffe8
      Gary Rong authored
      This adds a few tiny fixes for les and the p2p simulation framework:
      
      LES Parts
      
      - Keep the LES-SERVER connection even it's non-synced
      
        We had this idea to reject the connections in LES protocol if the les-server itself is
        not synced. However, in LES protocol we will also receive the connection from another
        les-server. In this case even the local node is not synced yet, we should keep the tcp
        connection for other protocols(e.g. eth protocol).
      
      - Don't count "invalid message" for non-existing GetBlockHeadersMsg request
      
        In the eth syncing mechanism (full sync, fast sync, light sync), it will try to fetch
        some non-existent blocks or headers(to ensure we indeed download all the missing chain).
        In this case, it's possible that the les-server will receive the request for
        non-existent headers. So don't count it as the "invalid message" for scheduling
        dropping.
      
      - Copy the announce object in the closure
      
        Before the les-server pushes the latest headers to all connected clients, it will create
        a closure and queue it in the underlying request scheduler. In some scenarios it's
        problematic. E.g, in private networks, the block can be mined very fast. So before the
        first closure is executed, we may already update the latest_announce object. So actually
        the "announce" object we want to send is replaced.
      
        The downsize is the client will receive two announces with the same td and then drop the
        server.
      
      P2P Simulation Framework
      
      - Don't double register the protocol services in p2p-simulation "Start".
      
        The protocols upon the devp2p are registered in the "New node stage". So don't reigster
        them again when starting a node in the p2p simulation framework
      
      - Add one more new config field "ExternalSigner", in order to use clef service in the
        framework.
      b63bffe8
  12. Oct 14, 2020
  13. Oct 13, 2020
  14. Oct 08, 2020
    • Felix Lange's avatar
      p2p/discover: remove use of shared hash instance for key derivation (#21673) · 5e86e4ed
      Felix Lange authored
      For some reason, using the shared hash causes a cryptographic incompatibility
      when using Go 1.15. I noticed this during the development of Discovery v5.1
      when I added test vector verification.
      
      The go library commit that broke this is golang/go@97240d5, but the
      way we used HKDF is slightly dodgy anyway and it's not a regression.
      5e86e4ed
  15. Sep 28, 2020
  16. Sep 22, 2020
  17. Sep 14, 2020
    • Zsolt Felföldi's avatar
      p2p/nodestate: ensure correct callback order (#21436) · 4eb92969
      Zsolt Felföldi authored
      This PR adds an extra guarantee to NodeStateMachine: it ensures that all
      immediate effects of a certain change are processed before any subsequent
      effects of any of the immediate effects on the same node. In the original
      version, if a cascaded change caused a subscription callback to be called
      multiple times for the same node then these calls might have happened in a
      wrong chronological order.
      
      For example:
      
      - a subscription to flag0 changes flag1 and flag2
      - a subscription to flag1 changes flag3
      - a subscription to flag1, flag2 and flag3 was called in the following order:
      
         [flag1] -> [flag1, flag3]
         [] -> [flag1]
         [flag1, flag3] -> [flag1, flag2, flag3]
      
      This happened because the tree of changes was traversed in a "depth-first
      order". Now it is traversed in a "breadth-first order"; each node has a
      FIFO queue for pending callbacks and each triggered subscription callback
      is added to the end of the list. The already existing guarantees are
      retained; no SetState or SetField returns until the callback queue of the
      node is empty again. Just like before, it is the responsibility of the
      state machine design to ensure that infinite state loops are not possible.
      Multiple changes affecting the same node can still happen simultaneously;
      in this case the changes can be interleaved in the FIFO of the node but the
      correct order is still guaranteed.
      
      A new unit test is also added to verify callback order in the above scenario.
      4eb92969
  18. Sep 11, 2020
  19. Aug 24, 2020
    • timcooijmans's avatar
      p2p/discover: avoid dropping unverified nodes when table is almost empty (#21396) · 7b5107b7
      timcooijmans authored
      
      This change improves discovery behavior in small networks. Very small
      networks would often fail to bootstrap because all member nodes were
      dropping table content due to findnode failure. The check is now changed
      to avoid dropping nodes on findnode failure when their bucket is almost
      empty. It also relaxes the liveness check requirement for FINDNODE/v4
      response nodes, returning unverified nodes as results when there aren't
      any verified nodes yet.
      
      The "findnode failed" log now reports whether the node was dropped
      instead of the number of results. The value of the "results" was
      always zero by definition.
      
      Co-authored-by: default avatarFelix Lange <fjl@twurst.com>
      7b5107b7
  20. Aug 05, 2020
    • Felix Lange's avatar
      p2p/nat: limit UPNP request concurrency (#21390) · 1d25039f
      Felix Lange authored
      This adds a lock around requests because some routers can't handle
      concurrent requests. Requests are also rate-limited.
       
      The Map function request a new mapping exactly when the map timeout
      occurs instead of 5 minutes earlier. This should prevent duplicate mappings.
      1d25039f
  21. Aug 03, 2020
    • rene's avatar
      node: refactor package node (#21105) · c0c01612
      rene authored
      This PR significantly changes the APIs for instantiating Ethereum nodes in
      a Go program. The new APIs are not backwards-compatible, but we feel that
      this is made up for by the much simpler way of registering services on
      node.Node. You can find more information and rationale in the design
      document: https://gist.github.com/renaynay/5bec2de19fde66f4d04c535fd24f0775.
      
      There is also a new feature in Node's Go API: it is now possible to
      register arbitrary handlers on the user-facing HTTP server. In geth, this
      facility is used to enable GraphQL.
      
      There is a single minor change relevant for geth users in this PR: The
      GraphQL API is no longer available separately from the JSON-RPC HTTP
      server. If you want GraphQL, you need to enable it using the
      ./geth --http --graphql flag combination.
      
      The --graphql.port and --graphql.addr flags are no longer available.
      c0c01612
  22. Jul 13, 2020
  23. Jun 24, 2020
  24. Jun 02, 2020
  25. May 25, 2020
  26. May 22, 2020
    • Zsolt Felföldi's avatar
      les, les/lespay: implement new server pool (#20758) · b4a26811
      Zsolt Felföldi authored
      This PR reimplements the light client server pool. It is also a first step
      to move certain logic into a new lespay package. This package will contain
      the implementation of the lespay token sale functions, the token buying and
      selling logic and other components related to peer selection/prioritization
      and service quality evaluation. Over the long term this package will be
      reusable for incentivizing future protocols.
      
      Since the LES peer logic is now based on enode.Iterator, it can now use
      DNS-based fallback discovery to find servers.
      
      This document describes the function of the new components:
      https://gist.github.com/zsfelfoldi/3c7ace895234b7b345ab4f71dab102d4
      b4a26811
  27. May 11, 2020
    • Felix Lange's avatar
      p2p: add 0 port check in dialer (#21008) · 6f54ae24
      Felix Lange authored
      * p2p: add low port check in dialer
      
      We already have a check like this for UDP ports, add a similar one in
      the dialer. This prevents dials to port zero and it's also an extra
      layer of protection against spamming HTTP servers.
      
      * p2p/discover: use errLowPort in v4 code
      
      * p2p: change port check
      
      * p2p: add comment
      
      * p2p/simulations/adapters: ensure assigned port is in all node records
      6f54ae24
  28. Apr 24, 2020
    • tgyKomgo's avatar
      p2p/enode: update code comment (#20972) · 1aa83290
      tgyKomgo authored
      It is possible to specify enode URLs using domain name since
      commit b90cdbaa, but the code comment still said that only
      IP addresses are allowed.
      
      Co-authored-by: admin@komgo.io <KomgoRocks2018!>
      1aa83290
  29. Apr 21, 2020
  30. Apr 16, 2020
    • Nishant Das's avatar
      p2p/discover: add helper methods to UDPv5 (#20918) · 7a63faf7
      Nishant Das authored
      This adds two new methods to UDPv5, AllNodes and LocalNode.
      
      AllNodes returns all the nodes stored in the local table; this is
      useful for the purposes of metrics collection and also debugging any
      potential issues with other discovery v5 implementations.
      
      LocalNode returns the local node object. The reason for exposing this
      is so that users can modify and set/delete new key-value entries in
      the local record.
      7a63faf7
  31. Apr 09, 2020
  32. Apr 08, 2020
    • Felix Lange's avatar
      build: upgrade to golangci-lint 1.24.0 (#20901) · c8e9a916
      Felix Lange authored
      * accounts/scwallet: remove unnecessary uses of fmt.Sprintf
      
      * cmd/puppeth: remove unnecessary uses of fmt.Sprintf
      
      * p2p/discv5: remove unnecessary use of fmt.Sprintf
      
      * whisper/mailserver: remove unnecessary uses of fmt.Sprintf
      
      * core: goimports -w tx_pool_test.go
      
      * eth/downloader: goimports -w downloader_test.go
      
      * build: upgrade to golangci-lint 1.24.0
      c8e9a916
    • Felix Lange's avatar
      p2p/discover: add initial discovery v5 implementation (#20750) · b7394d79
      Felix Lange authored
      This adds an implementation of the current discovery v5 spec.
      
      There is full integration with cmd/devp2p and enode.Iterator in this
      version. In theory we could enable the new protocol as a replacement of
      discovery v4 at any time. In practice, there will likely be a few more
      changes to the spec and implementation before this can happen.
      b7394d79
  33. Apr 02, 2020
  34. Apr 01, 2020
  35. Feb 27, 2020
Loading