-
Notifications
You must be signed in to change notification settings - Fork 7
add an app test for discovery #423
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #423 +/- ##
============================================
+ Coverage 83.26% 83.48% +0.21%
- Complexity 1111 1126 +15
============================================
Files 226 228 +2
Lines 8003 8072 +69
Branches 624 628 +4
============================================
+ Hits 6664 6739 +75
+ Misses 1000 996 -4
+ Partials 339 337 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
jonesho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: [email protected] <[email protected]>
Signed-off-by: [email protected] <[email protected]>
Signed-off-by: [email protected] <[email protected]>
Signed-off-by: [email protected] <[email protected]>
Signed-off-by: [email protected] <[email protected]>
Signed-off-by: [email protected] <[email protected]>
416283d to
c9c65a7
Compare
Signed-off-by: [email protected] <[email protected]>
Signed-off-by: [email protected] <[email protected]>
jvm-libs/test-utils/src/main/kotlin/testutils/besu/BesuTransactionsHelper.kt
Outdated
Show resolved
Hide resolved
Signed-off-by: [email protected] <[email protected]>
Signed-off-by: [email protected] <[email protected]>
Signed-off-by: [email protected] <[email protected]>
Signed-off-by: [email protected] <[email protected]>
| assertThat( | ||
| followerEthApiClient.getBlockByNumberWithoutTransactionsData(BlockParameter.Tag.LATEST).get().number, | ||
| ).isGreaterThanOrEqualTo(0UL) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Unsynced Peers Break Network Connection Tests
The removal of awaitTillMaruHasPeers(1u) calls for both validator and follower nodes means the tests proceed without ensuring the Maru nodes have established P2P connections. The peer scoring tests explicitly check peer counts and disconnection behavior, which requires nodes to be connected first. Without this synchronization, tests may check peer counts before connections are established, causing flaky failures or incorrect test behavior.
|
|
||
| // Create and start the bootnode (validator) | ||
| val bootnodeStack = networkStacks[0] | ||
| val bootnodeUdpPort = findFreePort() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will oppose every new usage of findPorts by default, because this pattern feels wrong. In real world, ports are either set to 0 and assigned by the OS or a specific port number reserved for a certain instance ahead of time. And findPorts is trying to do the work that is supposed to be done by the OS.
What happened to your very strong opposition stated here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing. Thanks for keeping my integrity in check!
| .putDiscoverySequenceNumber(newRecord.seq.toBigInteger().toULong()) | ||
| .commit() | ||
| ) { | ||
| log.info("Node record updated. $newRecord") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please favour logfmt and string template
| log.info("Node record updated. $newRecord") | |
| log.info("updated enr={}", newRecord) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not ENR, but yes, we should stick with logfmt. Let me change that
This PR adds an app test for discovery. The test allows the number of nodes to be created an the number of expected connections to be changed. The checked in version creates 10 nodes and expects every node to have 9 connections.
The test checks that each node has the expected connections and also checks that the EL nodes start syncing.
Note
Adds a 10-node discovery integration test and refactors peer scoring tests for stability; also logs ENR updates in discovery service.
MaruDiscoveryTestspins up N Besu/Maru nodes, uses node 0 as bootnode, verifies peer discovery via ENR and EL block sync (defaults: 10 nodes, expect 9 peers each).MaruPeerScoringTestrefactored for robustness:p2pPort=0u/discoveryPort=0u; removes coroutine tx loop and unused mocks.MaruDiscoveryService: add info log on local node record updates includingenr.Written by Cursor Bugbot for commit 3b16325. This will update automatically on new commits. Configure here.