-
Notifications
You must be signed in to change notification settings - Fork 86
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
lp-gateway-queue: Ensure messages are processed in order #1992
lp-gateway-queue: Ensure messages are processed in order #1992
Conversation
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.
Seems to be an appropriate solution to the comment
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix/gateway-message-processing #1992 +/- ##
===============================================================
Coverage 48.36% 48.37%
===============================================================
Files 183 183
Lines 13398 13412 +14
===============================================================
+ Hits 6480 6488 +8
- Misses 6918 6924 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
d173b9c
to
571bd9e
Compare
.last() | ||
.expect("Queue triggered evm tx.") | ||
.clone(); | ||
|
||
// The sender is the sender account on the gateway | ||
assert_eq!(T::Sender::get().h160(), status.from); | ||
assert_eq!(status.to.unwrap().0, to.0); | ||
assert!(!receipt_ok(receipt)); |
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.
Note - given that the message processor implementation of the LP gateway is transactional, this check is no longer required.
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.
Thanks Cosmin, I think now it works fine in all scenarios!
LastProcessedNonce::<T>::set(last_processed_nonce); | ||
|
||
// 1 write for setting the last processed nonce | ||
weight_used.saturating_accrue(T::DbWeight::get().writes(1)); | ||
|
||
continue; |
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.
Nice! I think this fixes the issue of having "holes" in the queue.
a437056
into
fix/gateway-message-processing
* lp-gateway: Update message recovery comment * lp-gateway: Use transactional in MessageProcessor implementation * lp-gateway: Iterate over inbound sub-messages only during execution * lp-gateway: Add session ID check for message entries * lp-gateway: Use defensive weight during message recovery * lp-gateway: Make MessageProcessor implementation transactional * lp-gateway-queue: Use when checking servicing weight * lp-gateway: Move import * lp-gateway-queue: Remove extra weight check * lp-gateway-queue: Get ordered MessageQueue keys and iterate over them * lp-gateway: Add session ID change tests * lp-gateway: Drop support for inbound batch messages * lp-gateway-queue: Ensure messages are processed in order (#1992) * lp-gateway-queue: Ensure messages are processed in order * lp-gateway-queue: Ensure processed messages are skipped * integration-tests: Remove receipt check * pallet: Rename event
Addressing the comment regarding LP gateway queue message processing:
#1991 (comment)