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

RMN - minor code improvements #289

Merged
merged 3 commits into from
Nov 1, 2024
Merged

RMN - minor code improvements #289

merged 3 commits into from
Nov 1, 2024

Conversation

dimkouv
Copy link
Contributor

@dimkouv dimkouv commented Nov 1, 2024

rmnNodes, err := c.rmnHomeReader.GetRMNNodesInfo(rmnRemoteCfg.ConfigDigest)
if err != nil {
return nil, fmt.Errorf("get rmn nodes info: %w", err)
}

c.lggr.Infow("got RMN nodes info", "nodes", rmnNodes)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactoring of the logic that processes lane update requests. Extracted and unit tested a standalone function.

@@ -160,10 +160,7 @@ func (r *peerClient) getOrCreateRageP2PStream(rmnNode rmntypes.HomeNodeInfo) (St
}

rmnPeerID := rmnNode.PeerID.String()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Each rmn node has a field called StreamNamePrefix. Supports different RMN nodes that are running different RMN offchain version. v1_6 is still hardcoded in initialization until the change is integrated in RMNHome.

@@ -1,19 +1,5 @@
package slicelib

// GroupBy groups a slice based on a specific item property. The returned groups slice is deterministic.
func GroupBy[T any, K comparable](items []T, prop func(T) K) ([]K, map[K][]T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove unused function.

@dimkouv dimkouv marked this pull request as ready for review November 1, 2024 10:10
@dimkouv dimkouv requested a review from a team as a code owner November 1, 2024 10:10
@dimkouv dimkouv changed the title General - minor fixes and improvements General - RMN minor fixes and improvements Nov 1, 2024
@dimkouv dimkouv changed the title General - RMN minor fixes and improvements RMN - minor fixes and improvements Nov 1, 2024
@dimkouv dimkouv changed the title RMN - minor fixes and improvements RMN - minor code improvements Nov 1, 2024
Copy link

github-actions bot commented Nov 1, 2024

Metric dk/self-audit main
Coverage 72.5% 72.5%

@makramkd makramkd merged commit 4b133b0 into main Nov 1, 2024
4 checks passed
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.

2 participants