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

Adjust discv5_updateNodeInfo JSON-RPC to specify key and value #1569

Merged
merged 1 commit into from
May 9, 2023

Conversation

kdeme
Copy link
Contributor

@kdeme kdeme commented Apr 28, 2023

Accompanying spec PR: ethereum/portal-network-specs#207

The current version was not following the spec, but also not the above spec PR, as a nameless tuple basically required the parameter to look like:

{
  "params": [
    [
      {
        "Field0": "0xabcd",
        "Field1": "0xffff"
      },
      {
        "Field0": "0xffff",
        "Field1": "0xffff"
      }
    ]
  ]
}

Which now becomes:

{
  "params": [
    [
      {
        "key": "0xabcd",
        "value": "0xffff"
      },
      {
        "key": "0xffff",
        "value": "0xffff"
      }
    ]
  ]
}

I don't think there is some way to define a Nim type that results in something like:

{
  "params": [
    [
      {
        "0xabcd": "0xffff"
      },
      {
        "0xffff": "0xffff"
      }
    ]
  ]
}

I think that requires custom parsing of the JsonNode, so going with the more verbose version.

@kdeme kdeme merged commit 9097548 into master May 9, 2023
@kdeme kdeme deleted the adjust-discv5-updateNodeInfo-jsonrpc branch May 9, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant