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

chore: easy setup fleets for lpt #3125

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

NagyZoltanPeter
Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter commented Oct 17, 2024

Description

A greater upgrade for liteprotocoltester.

Changes

  • Added various metrics to follow test performance and failures.
  • Dashboard defined to follow test performance and failure counts.
  • Added ENR support for service and bootstrap peer configuration.
  • Added bootstrap capabilities using peer exchange.
  • If bootstrap node is defined, max 100 nodes will be gathered via PeerExchange.
  • PeerExchange nodes will be tested for connectivity and report created.
  • If further nodes are available (via bootstrap node and PX) in case of failure during test, the service node will be switched to another service node. (derived through internal thresholds).
  • jenkins job defined to build and create and deploy image of liteprotocoltester

Extension

A new repository https://github.com/waku-org/lpt-runner created to ease the usage and run against various waku networks and fleets.

Issue

#2999

@NagyZoltanPeter NagyZoltanPeter marked this pull request as ready for review October 17, 2024 10:45
Copy link

github-actions bot commented Oct 17, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3125

Built from c6e2b4e

Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

Woooow amazing PR! 🔥 🔥 🔥 Thanks so much!

Left a bunch of random comments but mostly nitpicks.

Really looking forward to deploy the LPT and use it on the fleets! 😍

apps/liteprotocoltester/tester_config.nim Outdated Show resolved Hide resolved

return ok(peerInfo)

randomize()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want this call on a global scope or inside a proc? if it's globally, better to put it before every proc definition so it's easier to see

apps/liteprotocoltester/service_peer_management.nim Outdated Show resolved Hide resolved
Comment on lines +102 to +103
elif codec.contains("filter"):
capability = Capabilities.Filter
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this elif redundant if capability is already initialized to Capabilities.Filter?

Same in selectRandomCapablePeer

var found = none(RemotePeerInfo)
var okPeers: seq[RemotePeerInfo] = @[]

while found.isNone() and supportivePeers.len > 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't even update found in this proc, it's very similar to selectRandomCapablePeer - not sure if it's better to avoid the code duplication by having all that same logic in a same place

Actually, I think we don't use selectRandomCapablePeer anywhere 😶

Comment on lines +83 to +88
if connOpt.value().isSome():
found = some(randomPeer)
debug "Dialing successful",
peer = constructMultiaddrStr(randomPeer), codec = codec
else:
debug "Dialing failed", peer = constructMultiaddrStr(randomPeer), codec = codec
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we do here

lpt_dialed_peers.inc()

and

lpt_dial_failures.inc()

like in tryCallAllPxPeers?

if conf.bootstrapNode.len > 0:
info "Bootstrapping with PeerExchange to gather random service node"
let futForServiceNode = pxLookupServiceNode(wakuApp.node, conf)
if not (waitFor futForServiceNode.withTimeout(20.minutes)):
Copy link
Contributor

Choose a reason for hiding this comment

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

waitFor with 20 mins timeout? 😱

Comment on lines +113 to +115
# so we will mount PeerExchange to gather possible service peers, if got some
# we will mount the client protocols afterward.
wakuConf.peerExchange = false
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure I understand - according to the comment, shouldn't wakuConf.peerExchange be set to true?

Comment on lines +30 to +41
proc `$`*(cap: Capabilities): string =
case cap
of Capabilities.Relay:
return "Relay"
of Capabilities.Store:
return "Store"
of Capabilities.Filter:
return "Filter"
of Capabilities.Lightpush:
return "Lightpush"
of Capabilities.Sync:
return "Sync"
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be worth having this proc in waku/waku_enr/capabilities.nim so it can be used in other places too :)

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