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

Herostore message entity nonce #5452

Merged
merged 14 commits into from
Mar 4, 2024
Merged

Conversation

kc1116
Copy link
Contributor

@kc1116 kc1116 commented Feb 23, 2024

This pull request introduces a configurable message entity factory function for herostore, allowing users to incorporate a nonce into the message entity. Previously, certain tests utilizing herostore were failing due to unexpected deduplication of messages. These modifications effectively address the issue by providing users with the flexibility to add a nonce, ensuring more predictable and reliable behavior in scenarios involving message deduplication.

ref: https://github.com/dapperlabs/flow-internal/issues/1910

- reenable silence period registry tests
@kc1116 kc1116 requested a review from peterargue February 23, 2024 19:51
@@ -165,7 +165,8 @@ func NewGossipSubAppSpecificScoreRegistry(config *GossipSubAppSpecificScoreRegis

invalidCtrlMsgNotificationStore := queue.NewHeroStore(config.Parameters.InvalidControlMessageNotificationQueueSize,
lg.With().Str("component", "invalid_control_message_notification_queue").Logger(),
metrics.RpcInspectorNotificationQueueMetricFactory(config.HeroCacheMetricsFactory, config.NetworkingType))
metrics.RpcInspectorNotificationQueueMetricFactory(config.HeroCacheMetricsFactory, config.NetworkingType),
queue.WithMessageEntityFactory(queue.NewMessageEntityWithNonce))
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

network/p2p/scoring/registry_test.go Outdated Show resolved Hide resolved
Nonce string
}{
msg,
time.Now().String(),
Copy link
Contributor

Choose a reason for hiding this comment

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

what do you think about using Nonce int64, and then?

Suggested change
time.Now().String(),
time.Now().UnixNano(),

it would be 8 bytes instead of 51 (2024-02-23 14:54:13.540848 -0800 PST m=+0.000076126)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to convert it to a string for the RLP encoding e8187bc results in a 19 byte string

Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.45%. Comparing base (c0d0bd6) to head (e111317).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5452      +/-   ##
==========================================
+ Coverage   56.01%   57.45%   +1.44%     
==========================================
  Files        1029      850     -179     
  Lines      100484    84915   -15569     
==========================================
- Hits        56287    48791    -7496     
+ Misses      39864    32298    -7566     
+ Partials     4333     3826     -507     
Flag Coverage Δ
unittests 57.45% <100.00%> (+1.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kc1116 kc1116 requested a review from jordanschalm February 29, 2024 00:12
network/p2p/scoring/registry_test.go Outdated Show resolved Hide resolved
module/mempool/queue/messageEntity.go Show resolved Hide resolved
module/mempool/queue/messageEntity.go Outdated Show resolved Hide resolved
@kc1116 kc1116 requested a review from peterargue March 1, 2024 17:53
@kc1116 kc1116 added this pull request to the merge queue Mar 4, 2024
Merged via the queue into master with commit f33348f Mar 4, 2024
51 checks passed
@kc1116 kc1116 deleted the khalil/herostore-message-entity-nonce branch March 4, 2024 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants