-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat: adding onValidated observer #1128
Conversation
Are you using the latest master? It seems there are some formatting changes that should be addressed in the latest master. |
I branched out from dc83a1e so we do have the formatting changes. We actually use currently We also use There may be many compilation issues now, I wanted to run the CI first and see what pops up, but will fix them promptly |
I see. It's cause a new param was added exactly when the param list stopped being in one line and it was difficult to see the change https://github.com/vacp2p/nim-libp2p/pull/1128/files#diff-abbf987f19a24c9940cd01bde79a1b1e0819f1c3b6d7ba2efa04ad680d022c78R385 |
Thinking about how we could potentially integrate this in master:
|
Thanks so much! I think I can do exactly the same I'm doing in this PR but adding a generic construct to add app specific logic. I think it can be hard to accurately understand what we exactly need without actually coding it and finding constraints we might hadn't think about. If it sounds good to you, I can implement the same thing by doing this generic extension, get feedback, iterate and go from there. lmk what you think :)) @kaiserd @Ivansete-status |
I believe you can experiment here until you find what you need, but eventually it's better to find a way to add the changes to master for two reasons:
|
I agree 100%, the idea is to now change this PR with a more generic approach with the target to actually get merged to master |
It does seem that we can actually get the information that we want without changing anything in We will merge waku-org/nwaku#2851 for it. If after using it for simulations we conclude that this approach logs all the necessary information, then I will close this PR. Otherwise, will implement over here a solution for it that could be merged to |
Thanks for the update. |
c56a846
to
10a1ef8
Compare
We started having the original issue and were in need of info only available at the Currently having it over an old I think this new approach is simpler and pretty neat, please let me know if a solution like this is something that could be eventually merged into master :) |
10a1ef8
to
1e5e5bc
Compare
@diegomrsantos @kaiserd WDYT about this new approach? is it something that could be merged? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1128 +/- ##
========================================
Coverage 84.53% 84.53%
========================================
Files 91 92 +1
Lines 15517 16423 +906
========================================
+ Hits 13118 13884 +766
- Misses 2399 2539 +140
|
Please update the PR's title and description to reflect its current state. |
5c307da
to
00fb971
Compare
Yup, ready 🫡 |
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.
Amazing job, thanks a lot!
Thanks to you for the time and all the help! 🫶 |
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. Thank you very much.
Feel free to merge. The interop test is inactive for now.
It seems the test failed here https://github.com/vacp2p/nim-libp2p/actions/runs/10679844554/job/29599995590 |
Description
Adding an
onValidated
observer which will run every time a message is received and validated. This comes from the necessity of precisely track message deliveries and network activity.onRecv
observers run before any check is performed on the received message, which means that it runs every time a duplicate or invalid message arrives, which is inefficient and inaccurate for our purpose of tracking only received, unique and valid messages. Therefore, adding this extra option of running an observer for every message after all validation checks pass.