Skip to content

Conversation

@mkysel
Copy link
Collaborator

@mkysel mkysel commented 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
  • The WriteToRegistry function in pkg/blockchain/migrator/migrator.go 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, test files, and related components

📍Where to Start

Start with the AddNode method implementation in the nodeRegistryAdmin struct in pkg/blockchain/registryAdmin.go to understand the core interface change.


Macroscope summarized 525f5cc.

@mkysel mkysel requested a review from a team as a code owner June 9, 2025 17:06
@graphite-app
Copy link

graphite-app bot commented Jun 9, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@mkysel mkysel merged commit 0d18054 into main Jun 9, 2025
9 checks passed
@mkysel mkysel deleted the mkysel/cli branch June 9, 2025 19:11
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._
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.

3 participants