Minor migrator cleanup#881
Merged
Merged
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
fbac
approved these changes
Jun 9, 2025
fbac
pushed a commit
that referenced
this pull request
Jun 9, 2025
### Modify `AddNode` method to return node ID and update `WriteToRegistry` to accept context parameter for migrator cleanup - The `AddNode` method in `INodeRegistryAdmin` interface now returns a `uint32` node ID in addition to an error, with the implementation capturing the node ID from the `NodeAdded` event in [pkg/blockchain/registryAdmin.go](https://github.com/xmtp/xmtpd/pull/881/files#diff-d2eeb0eee280c4bdf2aa11a0222e19583a009cbd7aa6ee4fa791be3a892b43d9) - The `WriteToRegistry` function in [pkg/blockchain/migrator/migrator.go](https://github.com/xmtp/xmtpd/pull/881/files#diff-bc12b88012e6220f18d02533f0643cca1daf3bf6e6e7021ee4489208e28479d7) now accepts a context parameter instead of a logger and adds nodes to the canonical network when the `InCanonicalNetwork` flag is true - All callers of `AddNode` and `WriteToRegistry` have been updated to handle the new function signatures in [cmd/cli/main.go](https://github.com/xmtp/xmtpd/pull/881/files#diff-ed4d81d29a7267f93fd77e17993fd3491b9ef6ded18490b4514d10ed1d803bc2), test files, and related components #### 📍Where to Start Start with the `AddNode` method implementation in the `nodeRegistryAdmin` struct in [pkg/blockchain/registryAdmin.go](https://github.com/xmtp/xmtpd/pull/881/files#diff-d2eeb0eee280c4bdf2aa11a0222e19583a009cbd7aa6ee4fa791be3a892b43d9) to understand the core interface change. ---- _[Macroscope](https://app.macroscope.com) summarized 525f5cc._
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modify
AddNodemethod to return node ID and updateWriteToRegistryto accept context parameter for migrator cleanupAddNodemethod inINodeRegistryAdmininterface now returns auint32node ID in addition to an error, with the implementation capturing the node ID from theNodeAddedevent in pkg/blockchain/registryAdmin.goWriteToRegistryfunction in pkg/blockchain/migrator/migrator.go now accepts a context parameter instead of a logger and adds nodes to the canonical network when theInCanonicalNetworkflag is trueAddNodeandWriteToRegistryhave been updated to handle the new function signatures in cmd/cli/main.go, test files, and related components📍Where to Start
Start with the
AddNodemethod implementation in thenodeRegistryAdminstruct in pkg/blockchain/registryAdmin.go to understand the core interface change.Macroscope summarized 525f5cc.