Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network: fixes to public address support #5851

Merged
merged 6 commits into from
Dec 7, 2023

Commits on Dec 4, 2023

  1. network: fixes to public address support

    1. requestTracker changes:
      - Remove http.Request.RemoteAddr overwriting in request tracker
      - Remove http.Request from request tracker
      - Add a new remoteAddresss() method that returns a most suitable address
    
    2. public addr changes:
      - no otherPublicAddr outside of requestTracker
      - new remoteAddresss() method provides most meaningful address for incoming requests
    
    Rationale:
    There is a chain http.Handler's in wsNetwork: request tracker and wsNetwork itself.
    Tracked request is created/updated in the first ServeHTTP and used to save a pointer to http.Request object.
    This request object is actually gets copied in mux.ServeHTTP that calls downstream wsNetwork's ServeHTTP making
    the request non-usable in the main wsNetwork's ServeHTTP so removed.
    
    otherPublicAddr is an address reported by a peer via our custom X-Algorand-Location header that the only
    correct value for wsPeer.rootURL (host:port accepting connections) but cannot be trusted.
    Unconditionally rewriting it with remoteAddr obtained from a tcp connection is too much and a new
    remoteAddresss() method attempts to provide the most meaningful trusted value.
    
    Fixes algorand#5713
    algorandskiy committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    6e2a2fe View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2023

  1. Apply suggestions from code review

    Co-authored-by: Gary <982483+gmalouf@users.noreply.github.com>
    algorandskiy and gmalouf committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    368ee34 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1cf125e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b3b5402 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b40783d View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2023

  1. Apply suggestions from code review

    Co-authored-by: Jason Paulos <jasonpaulos@users.noreply.github.com>
    algorandskiy and jasonpaulos committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    793f8ca View commit details
    Browse the repository at this point in the history