-
Notifications
You must be signed in to change notification settings - Fork 38
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 notary request handling #2715
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
roman-khimov
requested review from
carpawell and
cthulhu-rider
as code owners
January 11, 2024 18:49
roman-khimov
force-pushed
the
fix-notary-request-handling
branch
2 times, most recently
from
January 11, 2024 19:05
6f1f116
to
3ad7460
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2715 +/- ##
==========================================
+ Coverage 28.78% 28.81% +0.02%
==========================================
Files 415 415
Lines 32378 32386 +8
==========================================
+ Hits 9321 9332 +11
+ Misses 22223 22220 -3
Partials 834 834 ☔ View full report in Codecov by Sentry. |
cthulhu-rider
approved these changes
Jan 12, 2024
carpawell
reviewed
Jan 17, 2024
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.
- Conflicts
- TBH, I would wait for Add Copy() to transaction.Transaction and payload.P2PNotaryRequest neo-go#3288
Otherwise, I am OK.
It's not compliant with the WSClient documentation and can lead to the following scenario: * SN sends a container creation request * IR node with integrated CN receives it, adds to pool and announces to neighbors in a regular Neo P2P way * IR logic then receives a notification and executes Prepare * it adds a signature and changes the shared notary request * a neighbor then requests this notary requests and receives a broken one (signature mismatch) * so it may end up not receiving this original request at all and thus not replying to it ever * with enough of such nodes you can't create a container Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
In some cases we may not receive the original (sent by SN) request or receive it with a huge delay, so we shouldn't be relying on this magic. Instead, we can prevent recursion by checking the FB signer and then main tx cache is sufficient to not try handling the transaction again. Even if we do that, it's not a huge problem, the fallback will be the same and a single main tx will be constructed anyway. Notice that while we could be checking for main/fallbacks in the notary pool, they can legitimatelly be evicted from it as well, so it's not a 100% proof of handling status, therefore we're not doing it, relying on tx hash cache and fallback stability. Signed-off-by: Roman Khimov <roman@nspcc.ru>
roman-khimov
force-pushed
the
fix-notary-request-handling
branch
from
January 18, 2024 14:31
3ad7460
to
38a5bb1
Compare
cthulhu-rider
approved these changes
Jan 18, 2024
carpawell
approved these changes
Jan 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.