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

network: Ignore invalid tags #4517

Merged
merged 24 commits into from
Feb 1, 2023
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0346b11
don't queue messages with unrecognized tags
cce Aug 31, 2022
0b0f37c
Merge remote-tracking branch 'upstream/master' into ignore-invalid-tags
cce Sep 8, 2022
0e2fe4c
update and add debug logging for bad tags
cce Sep 8, 2022
1b5595b
switch to setting telemetry field
cce Sep 8, 2022
9df1d0c
skip dropping message
cce Sep 8, 2022
06f5c56
add allowCustomTags
cce Sep 8, 2022
bfb3ca1
Merge remote-tracking branch 'upstream/master' into ignore-invalid-tags
cce Nov 9, 2022
ce2af33
turn OutOfProtocol into a counter
cce Nov 9, 2022
5e04cb8
Merge remote-tracking branch 'upstream/master' into ignore-invalid-tags
cce Jan 10, 2023
b7719f7
merge count test
cce Jan 10, 2023
0e702e4
update metric name
cce Jan 10, 2023
18ace9d
update OutOfProtocol to Unknown
cce Jan 10, 2023
ccd5f37
remove drop check behind dedupSafeTag
cce Jan 26, 2023
0c6f169
add test for wsPeer.readLoop to make sure the switch statement checks…
cce Jan 26, 2023
936e568
fix lint
cce Jan 26, 2023
5f0cd15
add protocol.TagList completeness check test
cce Jan 27, 2023
c91c1a4
remove UniCatchupReqTag
cce Jan 27, 2023
ceba110
add license to tags_test.go
cce Jan 27, 2023
12dbc02
add partitiontest for linter
cce Jan 27, 2023
a7dd7a7
add strconv.Unquote to TestTagList
cce Jan 27, 2023
0346817
add TestWebsocketNetworkBasicInvalidTags
cce Jan 27, 2023
e390c9a
update TestTagList
cce Jan 27, 2023
4fbc0f6
add TestHashIDPrefix and a few more comments
cce Jan 28, 2023
4a780fd
Update network/wsNetwork_test.go
algorandskiy Feb 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge count test
  • Loading branch information
cce committed Jan 10, 2023
commit b7719f78cbc9b14ce194e55130edcaff0d4fbf39
6 changes: 5 additions & 1 deletion network/wsPeer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ func TestAtomicVariablesAlignment(t *testing.T) {
require.True(t, (unsafe.Offsetof(p.lastPacketTime)%8) == 0)
require.True(t, (unsafe.Offsetof(p.intermittentOutgoingMessageEnqueueTime)%8) == 0)
require.True(t, (unsafe.Offsetof(p.duplicateFilterCount)%8) == 0)
require.True(t, (unsafe.Offsetof(p.outOfProtocolCount)%8) == 0)
require.True(t, (unsafe.Offsetof(p.txMessageCount)%8) == 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is great and why don't we have this for everything we sync/atomic access?

#5001

Copy link
Contributor

Choose a reason for hiding this comment

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

looks like can be done as a custom linter similar to part test, by using fieldalignment as an example

Copy link
Contributor Author

@cce cce Jan 26, 2023

Choose a reason for hiding this comment

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

I tried the fieldalignment linter and it didn't work ... it requires being run on a 32-bit platform to work (!!) and I even tried it using a 32-bit docker image inside qemu and it didn't catch everything. However in Go 1.19 we can switch to the new automatically aligned atomic types and not need to worry about this anymore.

require.True(t, (unsafe.Offsetof(p.miMessageCount)%8) == 0)
require.True(t, (unsafe.Offsetof(p.ppMessageCount)%8) == 0)
require.True(t, (unsafe.Offsetof(p.avMessageCount)%8) == 0)
require.True(t, (unsafe.Offsetof(p.unkMessageCount)%8) == 0)
}

func TestTagCounterFiltering(t *testing.T) {
Expand Down