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

feat: NetworkController changes to support Network Syncing #4939

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Prithpal-Sooriya
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya commented Nov 15, 2024

Explanation

A set of changes to support network syncing.

References

N/A

Changelog

@metamask/network-controller

  • ADDED: logic to use added network networkClientId if provided instead of uuidV4()
  • : Your change here

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

this is to support network syncing, where we add a new network to a synced device
Comment on lines +216 to +217
* However Custom RPC endpoints, that are synchronized between devices,
* can contain a `networkClientId` set on both devices.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For custom RPCs, the networkClientId is a random UUID.
To make it easier for syncing, if a device is adding new networks from remote, we can reuse the UUID.

This was there is less chance of having some weird state where 2 devices use the same networks + RPCs, but they are different UUIDs.

Copy link
Contributor Author

@Prithpal-Sooriya Prithpal-Sooriya Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly optional (to keep uuid eventual consistency) across devices.

@Prithpal-Sooriya Prithpal-Sooriya changed the title feat: use original networkClientId if provided when adding a network feat: NetworkController changes to support Network Syncing Nov 15, 2024
@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as draft November 15, 2024 15:21
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