-
Notifications
You must be signed in to change notification settings - Fork 179
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
1891 Gossipsub RPC validation inspector false positive E2E testing #4371
1891 Gossipsub RPC validation inspector false positive E2E testing #4371
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4371 +/- ##
==========================================
+ Coverage 54.14% 61.66% +7.52%
==========================================
Files 888 170 -718
Lines 83754 18985 -64769
==========================================
- Hits 45348 11708 -33640
+ Misses 34888 6364 -28524
+ Partials 3518 913 -2605
Flags with carried forward coverage won't be shown. Click here to find out more. |
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 like the general approach that the test is taking, though a few concerns need to be addressed. Appreciate your consideration; thanks!
integration/tests/bft/gossipsub/rpc_inspector/false_positive_test.go
Outdated
Show resolved
Hide resolved
integration/tests/bft/gossipsub/rpc_inspector/false_positive_test.go
Outdated
Show resolved
Hide resolved
integration/tests/bft/gossipsub/rpc_inspector/false_positive_test.go
Outdated
Show resolved
Hide resolved
integration/tests/bft/gossipsub/rpc_inspector/false_positive_test.go
Outdated
Show resolved
Hide resolved
integration/tests/bft/gossipsub/rpc_inspector/false_positive_test.go
Outdated
Show resolved
Hide resolved
@@ -102,7 +102,9 @@ func (b *BaseSuite) SetupSuite() { | |||
func (b *BaseSuite) TearDownSuite() { | |||
b.Net.Remove() | |||
b.Cancel() | |||
unittest.RequireCloseBefore(b.T(), b.OrchestratorNetwork.Done(), 1*time.Second, "could not stop orchestrator network on time") | |||
if b.OrchestratorNetwork != nil { |
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.
this is needed because the BaseSuite is now being used by integration BFT tests outside BFTune, so not every BFT integration test will use an Orchestrator? Might be good to add a comment addressing this.
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.
suite.Run(t, new(GossipsubRPCInstpectorFalePostiveNotificationsTestSuite)) | ||
} | ||
|
||
// TestGossipsubRPCInstpectorFalePostiveNotifications this test ensures that any underlying changes or updates to any of the underlying libp2p libraries |
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.
multiple typos in function name at start of comment (TestGossipsubRPCInstpectorFalePostiveNotifications
should be TestGossipsubRPCInspectorFalsePositiveNotifications
) along with actual function name that was already flagged in https://github.com/onflow/flow-go/pull/4371/files#r1210747930
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.
…est.go Co-authored-by: Yahya Hassanzadeh <yhassanzadeh@ieee.org>
…thub.com:onflow/flow-go into khalil/1891-rpc-inspector-false-positive-testing
Co-authored-by: Yahya Hassanzadeh <yhassanzadeh@ieee.org>
Co-authored-by: Yahya Hassanzadeh <yhassanzadeh@ieee.org>
…thub.com:onflow/flow-go into khalil/1891-rpc-inspector-false-positive-testing
Co-authored-by: Yahya Hassanzadeh <yhassanzadeh@ieee.org>
…thub.com:onflow/flow-go into khalil/1891-rpc-inspector-false-positive-testing
…est.go Co-authored-by: Yahya Hassanzadeh <yhassanzadeh@ieee.org>
…est.go Co-authored-by: Yahya Hassanzadeh <yhassanzadeh@ieee.org>
- wait for n number of finalized heights before checking metrics
…thub.com:onflow/flow-go into khalil/1891-rpc-inspector-false-positive-testing
Co-authored-by: Misha <misha.rybalov@dapperlabs.com>
…thub.com:onflow/flow-go into khalil/1891-rpc-inspector-false-positive-testing
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.
🚀 thanks for developing the test. Except for one correction that I pointed out, the rest looks great!
require.Eventually(s.T(), func() bool { | ||
currStateComm := s.getCurrERFinalStateCommitment(ctx) | ||
if startStateComm != currStateComm { | ||
numOfStateCommChanges++ |
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.
numOfStateCommChanges++ | |
numOfStateCommChanges++ | |
startStateComm = currStateComm |
startStateComm
whenever the current state commitment changes. This ensures we accurately evaluate the expected n
times state changes. The existing method is problematic because it constantly compares the current state with the start state. Consequently, even a single state transition would pass this test, which is different from the intended behavior.
Additionally, as a suggestion for improving clarity, renaming startStateComm
to prevStateComm
would be more descriptive and appropriate.
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.
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.
Thanks for addressing all my feedback.
- reduce number of state commits to wait for
Co-authored-by: Yahya Hassanzadeh <yhassanzadeh@ieee.org>
Co-authored-by: Yahya Hassanzadeh <yhassanzadeh@ieee.org>
…thub.com:onflow/flow-go into khalil/1891-rpc-inspector-false-positive-testing
This PR adds an E2E test that covers false positive validation errors in the gossipsub RPC control message validation inspector. This is crucial since the current implementation relies on certain assumptions about GossipSub. These assumptions are based on our analysis of the GossipSub code, but the GossipSub team does not guarantee that it will hold in the long term. This PR leverages the fact that an invalid control message notification is distributed by the rpc inspector notification distributor, under normal operations no invalid control message notifications are expected to be disseminated.