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: filter v2 tests push invalid payload #916

Merged
merged 12 commits into from
Nov 23, 2023

Conversation

romanzac
Copy link
Collaborator

Description
Batch of tests for Waku Filter v2 - PUSH with invalid payloads

Changes
Tests available to run:
cd go-waku/waku/v2/protocol/filter
go test

- TestEmptyPayload
- TestEmptyContentTopic
- TestEmptyContentTopicEmptyPayload
- TestTimestampInFuture
- TestZeroTimestamp
- TestNegativeTimestamp
@status-im-auto
Copy link

status-im-auto commented Nov 21, 2023

Jenkins Builds

Click to see older builds (55)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 89344b4 #1 2023-11-21 08:46:43 ~2 min nix-flake 📄log
✔️ 89344b4 #1 2023-11-21 08:47:10 ~2 min linux 📦deb
✔️ 89344b4 #1 2023-11-21 08:48:34 ~4 min ios 📦tgz
✔️ 89344b4 #1 2023-11-21 08:48:44 ~4 min tests 📄log
✔️ 89344b4 #1 2023-11-21 08:48:53 ~4 min android 📦tgz
✔️ 89344b4 #1 2023-11-21 08:49:08 ~4 min tests 📄log
✔️ 35f417b #2 2023-11-21 14:11:04 ~2 min nix-flake 📄log
✔️ 35f417b #2 2023-11-21 14:11:14 ~2 min linux 📦deb
✔️ 35f417b #2 2023-11-21 14:11:29 ~2 min tests 📄log
✔️ 35f417b #2 2023-11-21 14:12:44 ~3 min ios 📦tgz
✔️ 35f417b #2 2023-11-21 14:12:55 ~4 min android 📦tgz
✔️ 35f417b #2 2023-11-21 14:13:16 ~4 min tests 📄log
✔️ 70cb705 #3 2023-11-21 14:36:37 ~1 min linux 📦deb
✖️ 70cb705 #3 2023-11-21 14:37:23 ~1 min tests 📄log
✔️ 70cb705 #3 2023-11-21 14:38:08 ~2 min nix-flake 📄log
✔️ 70cb705 #3 2023-11-21 14:38:51 ~3 min android 📦tgz
✖️ 70cb705 #3 2023-11-21 14:39:48 ~4 min tests 📄log
✔️ 70cb705 #3 2023-11-21 14:47:34 ~12 min ios 📦tgz
✔️ 5326302 #4 2023-11-21 14:37:48 ~1 min linux 📦deb
✔️ 5326302 #4 2023-11-21 14:40:33 ~3 min ios 📦tgz
✔️ 5326302 #4 2023-11-21 14:41:56 ~3 min nix-flake 📄log
✖️ 5326302 #4 2023-11-21 14:45:32 ~8 min tests 📄log
✔️ 5326302 #4 2023-11-21 14:48:01 ~9 min android 📦tgz
✔️ 5326302 #4 2023-11-21 14:49:18 ~9 min tests 📄log
✔️ 81ed053 #5 2023-11-22 06:58:54 ~1 min linux 📦deb
✔️ 81ed053 #5 2023-11-22 06:59:33 ~1 min nix-flake 📄log
✔️ 81ed053 #5 2023-11-22 07:00:10 ~2 min tests 📄log
✔️ 81ed053 #5 2023-11-22 07:00:31 ~2 min tests 📄log
✔️ 81ed053 #5 2023-11-22 07:01:28 ~3 min android 📦tgz
✔️ 81ed053 #5 2023-11-22 07:01:49 ~4 min ios 📦tgz
✔️ d908cc1 #6 2023-11-22 07:05:02 ~1 min linux 📦deb
✔️ d908cc1 #6 2023-11-22 07:05:42 ~1 min nix-flake 📄log
✔️ d908cc1 #6 2023-11-22 07:06:27 ~2 min tests 📄log
✔️ d908cc1 #6 2023-11-22 07:06:39 ~2 min tests 📄log
✔️ d908cc1 #6 2023-11-22 07:07:03 ~3 min ios 📦tgz
✔️ d908cc1 #6 2023-11-22 07:07:21 ~3 min android 📦tgz
✔️ 8c755ff #7 2023-11-22 07:47:42 ~1 min linux 📦deb
✔️ 8c755ff #7 2023-11-22 07:48:33 ~1 min nix-flake 📄log
✔️ 8c755ff #7 2023-11-22 07:49:22 ~2 min tests 📄log
✔️ 8c755ff #7 2023-11-22 07:49:34 ~2 min tests 📄log
✔️ 8c755ff #7 2023-11-22 07:49:56 ~3 min ios 📦tgz
✔️ 8c755ff #7 2023-11-22 07:50:19 ~3 min android 📦tgz
✔️ 55607ef #8 2023-11-22 10:10:33 ~1 min linux 📦deb
✔️ 55607ef #8 2023-11-22 10:11:21 ~1 min nix-flake 📄log
✔️ 55607ef #8 2023-11-22 10:11:59 ~2 min tests 📄log
✔️ 55607ef #8 2023-11-22 10:12:16 ~2 min tests 📄log
✔️ 55607ef #8 2023-11-22 10:13:01 ~3 min android 📦tgz
✔️ 55607ef #8 2023-11-22 10:13:33 ~4 min ios 📦tgz
✔️ 0ee16b6 #9 2023-11-23 01:08:31 ~1 min linux 📦deb
✔️ 0ee16b6 #9 2023-11-23 01:09:16 ~1 min nix-flake 📄log
✔️ 0ee16b6 #9 2023-11-23 01:10:58 ~3 min tests 📄log
✔️ 0ee16b6 #9 2023-11-23 01:11:24 ~4 min android 📦tgz
✔️ 0ee16b6 #9 2023-11-23 01:11:46 ~4 min ios 📦tgz
✖️ 0ee16b6 #9 2023-11-23 01:13:03 ~5 min tests 📄log
✔️ 0a9217a #10 2023-11-23 01:15:11 ~1 min nix-flake 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ c076e36 #11 2023-11-23 06:55:10 ~1 min nix-flake 📄log
✔️ 8ce48fc #12 2023-11-23 06:59:33 ~1 min nix-flake 📄log

@romanzac
Copy link
Collaborator Author

I wonder about timestamp field in Waku messages. There is no protection against insider attack. When someone wants to send messages in the past and alter order of messages, we let him do it. Is it difficult to verify common time flow (to have consensus on time) ? What are the trade offs here ?

I imagine what would happen, if postal offices and government offices unite to collect fine fees with penalty stating something happened in the past. And I imagine they don't do it, because such attack is complex and slow. Not with Waku, though. Order can be altered quickly and wrong decisions or claims could be made at the same speed.

Interested in your thoughts.

@romanzac romanzac marked this pull request as ready for review November 22, 2023 07:09
@chaitanyaprem
Copy link
Collaborator

I wonder about timestamp field in Waku messages. There is no protection against insider attack. When someone wants to send messages in the past and alter order of messages, we let him do it. Is it difficult to verify common time flow (to have consensus on time) ? What are the trade offs here ?

I imagine what would happen, if postal offices and government offices unite to collect fine fees with penalty stating something happened in the past. And I imagine they don't do it, because such attack is complex and slow. Not with Waku, though. Order can be altered quickly and wrong decisions or claims could be made at the same speed.

Interested in your thoughts.

This should get sorted out once RLN gets applied to light protocols as well. Since RLN is timestamp dependent that should take care of issues with timestamps (if someone tries to push older message, they get penalized). You can refer to discussion here waku-org/research#45

Copy link
Collaborator

@chaitanyaprem chaitanyaprem left a comment

Choose a reason for hiding this comment

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

All the tests documented, none of them actually test anything wrt filter Push, rather only relay publish.

I would expect these to be part of testing relay API than filter.

What is the objective of the tests though if at all we are thinking of for filter protocol?

waku/v2/protocol/filter/filter_proto_ident_test.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/filter_push_test.go Outdated Show resolved Hide resolved
@romanzac
Copy link
Collaborator Author

All the tests documented, none of them actually test anything wrt filter Push, rather only relay publish.

I would expect these to be part of testing relay API than filter.

What is the objective of the tests though if at all we are thinking of for filter protocol?

Changed according to your suggestions. Please have a look. Thanks.

waku/v2/protocol/relay/waku_relay_test.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/filter_test.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/filter_push_test.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/filter_push_test.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@chaitanyaprem chaitanyaprem left a comment

Choose a reason for hiding this comment

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

LGTM

@romanzac romanzac merged commit fb49752 into master Nov 23, 2023
12 checks passed
@romanzac romanzac deleted the chore-filter-v2-tests-push-invalid-payload branch November 23, 2023 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants