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

[FR] - Simplify p2p topology format #4559

Closed
Tracked by #3888
coot opened this issue Oct 25, 2022 · 4 comments · Fixed by #4563
Closed
Tracked by #3888

[FR] - Simplify p2p topology format #4559

coot opened this issue Oct 25, 2022 · 4 comments · Fixed by #4563
Assignees
Labels
area: p2p comp: networking enhancement New feature or request networking Issues and PRs related to networking peer2peer Issues / PRs related to peer-2-peer type: enhancement An improvement on the existing functionality user type: internal Created by an IOG employee

Comments

@coot
Copy link
Contributor

coot commented Oct 25, 2022

Currently the json format is more verbose than it needs to be, e.g.

{
  "LocalRoots": {
    "groups": [
      { "localRoots":
        { "accessPoints":
            [ { "address": "35.180.225.101"
              , "port": 7776
              }
            ]
        , "advertise": false
        }
      , "valency": 3
      }
    ]
  }
, "PublicRoots": [
    { "publicRoots": {
        "accessPoints": [
          { "address": "relays-new.cardano-mainnet.iohk.io"
          , "port": 3001
          }
        ]
      , "advertise": false
      }
    }
  ]
, "useLedgerAfterSlot": 45000000
}

I suggest we simplify this to something like:

{
  "localRoots": [
      { "accessPoints":
            [ { "address": "35.180.225.101"
              , "port": 7776
              }
            ]
      , "advertise": false
      , "valency": 1
      }
    ]
, "publicRoots": [
    { "accessPoints": [
          { "address": "relays-new.cardano-mainnet.iohk.io"
          , "port": 3001
          }
        ]
    , "advertise": false
    }
  ]
, "useLedgerAfterSlot": 45000000
}

Note: we ought to support both formats for a while; whenever we match the old format we should log a warning that this format will be only supported for next two major releases.

@coot coot added enhancement New feature or request networking Issues and PRs related to networking labels Oct 25, 2022
@gufmar
Copy link
Contributor

gufmar commented Oct 25, 2022

looks good to me

@CarlosLopezDeLara CarlosLopezDeLara added type: bug Something is not working type: enhancement An improvement on the existing functionality user type: internal Created by an IOG employee comp: networking area: p2p labels Oct 25, 2022
@coot coot self-assigned this Oct 25, 2022
@coot coot removed the type: bug Something is not working label Oct 25, 2022
@coot
Copy link
Contributor Author

coot commented Oct 25, 2022

@CarlosLopezDeLara this is not a bug, I removed the type: bug label.

coot added a commit that referenced this issue Oct 26, 2022
coot added a commit that referenced this issue Oct 26, 2022
coot added a commit that referenced this issue Oct 26, 2022
@coot
Copy link
Contributor Author

coot commented Oct 26, 2022

I realised that the encoding could be slightly simplified. I destructively updated the description of the issue. The gist is that LocalRoots can contain accessPoints, advertise and valency fields directly, without a need of extra object wrapper for accessPoints and advertise fields.

coot added a commit that referenced this issue Oct 26, 2022
@coot
Copy link
Contributor Author

coot commented Oct 27, 2022

Additional change: use localRoots and publicRoots instead of LocalRoots and PublicRoots - there's no need to leak Haskell naming convention of type constructors.

@coot coot added peer2peer Issues / PRs related to peer-2-peer P2P labels Nov 2, 2022
iohk-bors bot added a commit that referenced this issue Nov 7, 2022
4209: Document how to disable ledger peers r=coot a=coot



4563: New p2p topology file format r=coot a=coot

Fixes #4559.


Co-authored-by: Marcin Szamotulski <coot@coot.me>
iohk-bors bot added a commit that referenced this issue Nov 8, 2022
4563: New p2p topology file format r=coot a=coot

Fixes #4559.


Co-authored-by: Marcin Szamotulski <coot@coot.me>
@iohk-bors iohk-bors bot closed this as completed in ffcf2c0 Nov 8, 2022
mkoura added a commit to IntersectMBO/cardano-node-tests that referenced this issue Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: p2p comp: networking enhancement New feature or request networking Issues and PRs related to networking peer2peer Issues / PRs related to peer-2-peer type: enhancement An improvement on the existing functionality user type: internal Created by an IOG employee
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants