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

Implement complete SubmissionManager with expiry dedupe cache #6646

Merged
merged 3 commits into from May 17, 2023

Conversation

rbair23
Copy link
Member

@rbair23 rbair23 commented May 17, 2023

Closes #6636

SubmissionManager can ignore the RecordCache and have its own expiry cache. This makes it really easy to understand the behavior of the system and nullifies some potential problems with dishonest nodes. Most importantly, the question the SubmissionManager has to answer is "Have I seen this transaction ID submitted to me already?". It needs to answer this question because the node does not want to submit duplicate transactions (since if it does, it has to pay for it). It doesn't need to know anything about what transactions other nodes have seen or what the ultimate resolution of a transaction is. It just needs to say "within the valid transaction ID lifespan, have I seen this transaction submitted by a user before"? This allows us to keep the implementation very simple and decoupled from the RecordCache.

Signed-off-by: Richard Bair <rbair23@users.noreply.github.com>
@rbair23 rbair23 self-assigned this May 17, 2023
@rbair23 rbair23 requested review from a team as code owners May 17, 2023 17:25
@rbair23 rbair23 requested review from nickpoorman and timo0 May 17, 2023 17:25
@rbair23 rbair23 added this to the v0.39 milestone May 17, 2023
@github-actions
Copy link

github-actions bot commented May 17, 2023

Node: Unit Test Results

    1 383 files      1 383 suites   1h 13m 12s ⏱️
  98 454 tests   98 447 ✔️ 7 💤 0
103 619 runs  103 612 ✔️ 7 💤 0

Results for commit b3db569.

♻️ This comment has been updated with latest results.

Copy link
Member

@Neeharika-Sompalli Neeharika-Sompalli left a comment

Choose a reason for hiding this comment

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

LGTM!

@github-actions
Copy link

Node: Integration Test Results

    4 files      4 suites   13m 42s ⏱️
170 tests 170 ✔️ 0 💤 0
172 runs  172 ✔️ 0 💤 0

Results for commit f2108dd.

Signed-off-by: Richard Bair <rbair23@users.noreply.github.com>
Signed-off-by: Richard Bair <rbair23@users.noreply.github.com>
@codecov
Copy link

codecov bot commented May 17, 2023

Codecov Report

Patch coverage: 84.61% and project coverage change: +22.79 🎉

Comparison is base (2c695cc) 67.93% compared to head (b3db569) 90.73%.

Additional details and impacted files
@@              Coverage Diff               @@
##             develop    #6646       +/-   ##
==============================================
+ Coverage      67.93%   90.73%   +22.79%     
+ Complexity     22545    17524     -5021     
==============================================
  Files           2092     1390      -702     
  Lines         137030    50501    -86529     
  Branches        7788     5093     -2695     
==============================================
- Hits           93088    45820    -47268     
+ Misses         42424     3711    -38713     
+ Partials        1518      970      -548     
Impacted Files Coverage Δ
...c/main/java/com/hedera/node/app/spi/HapiUtils.java 9.78% <42.85%> (+9.78%) ⬆️
...a/node/app/workflows/ingest/SubmissionManager.java 100.00% <100.00%> (+3.84%) ⬆️

... and 959 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sonarcloud
Copy link

sonarcloud bot commented May 17, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

87.9% 87.9% Coverage
0.0% 0.0% Duplication

Copy link
Member

@Neeharika-Sompalli Neeharika-Sompalli left a comment

Choose a reason for hiding this comment

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

LGTM !

@rbair23 rbair23 merged commit 0bff209 into develop May 17, 2023
16 of 18 checks passed
@rbair23 rbair23 deleted the 06636-submission-manager-dedupe-detection branch May 17, 2023 18:28
nickpoorman pushed a commit that referenced this pull request May 18, 2023
Signed-off-by: Richard Bair <rbair23@users.noreply.github.com>
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.

Prevent duplicate transaction submission locally in SubmissionManager
2 participants