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

Fix: duplicate events #4076

Merged
merged 5 commits into from
Nov 28, 2023

Conversation

tippenein
Copy link
Contributor

fix: #2810

This simply uses a HashSet for event_observers which means it might not be exactly what the issue asked for but I'm putting it here for discussion. It wouldn't be particularly hard to WARN in the case of inserting an event observer which is already specified, but maybe it's sufficient to just disallow it?

(didn't add any tests because it ends up just testing HashSet's insert..)

Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

This change will just silently ignore a duplicate, but the issue requests that it errors and exits. This should be an easy addition. Can you add that @tippenein?

@CharlieC3
Copy link
Member

@obycode Re-thinking my original issue request, this may actually be a better solution since it still guards against user error while preserving flexibility to run the binary.
Unless you think otherwise, I'd be happy with this as-is!

@obycode
Copy link
Contributor

obycode commented Nov 22, 2023

@obycode Re-thinking my original issue request, this may actually be a better solution since it still guards against user error while preserving flexibility to run the binary. Unless you think otherwise, I'd be happy with this as-is!

Works for me!

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Attention: 84 lines in your changes are missing coverage. Please review.

Comparison is base (b0f637f) 0.04% compared to head (fc61021) 0.04%.
Report is 2 commits behind head on develop.

Files Patch % Lines
testnet/stacks-node/src/tests/neon_integrations.rs 0.00% 40 Missing ⚠️
testnet/stacks-node/src/config.rs 0.00% 13 Missing ⚠️
testnet/stacks-node/src/tests/epoch_21.rs 0.00% 7 Missing ⚠️
testnet/stacks-node/src/tests/epoch_205.rs 0.00% 5 Missing ⚠️
stackslib/src/chainstate/stacks/db/transactions.rs 0.00% 2 Missing ⚠️
stackslib/src/net/api/tests/mod.rs 0.00% 2 Missing ⚠️
stackslib/src/util_lib/strings.rs 0.00% 2 Missing ⚠️
testnet/stacks-node/src/tests/epoch_22.rs 0.00% 2 Missing ⚠️
testnet/stacks-node/src/tests/epoch_24.rs 0.00% 2 Missing ⚠️
testnet/stacks-node/src/tests/stackerdb.rs 0.00% 2 Missing ⚠️
... and 7 more
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4076   +/-   ##
========================================
  Coverage     0.04%    0.04%           
========================================
  Files          401      401           
  Lines       286816   286818    +2     
========================================
  Hits           136      136           
- Misses      286680   286682    +2     

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

@saralab saralab merged commit 33c64f6 into stacks-network:develop Nov 28, 2023
2 checks passed
@tippenein tippenein deleted the fix-duplicate-events-2810 branch November 28, 2023 20:31
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.

None yet

5 participants