-
Notifications
You must be signed in to change notification settings - Fork 180
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
[Access] Pending status returns immediately from send and subscribe transaction statuses #6737
base: master
Are you sure you want to change the base?
[Access] Pending status returns immediately from send and subscribe transaction statuses #6737
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6737 +/- ##
=======================================
Coverage 40.98% 40.99%
=======================================
Files 2103 2103
Lines 184900 184988 +88
=======================================
+ Hits 75783 75832 +49
- Misses 102750 102780 +30
- Partials 6367 6376 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
added a few small comments, but otherwise looks good
Co-authored-by: Peter Argue <[email protected]>
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.
added a couple more comments, but otherwise looks good.
ctx context.Context, | ||
tx *flow.TransactionBody, | ||
requiredEventEncodingVersion entities.EventEncodingVersion, | ||
) subscription.Subscription { | ||
nextHeight, err := b.blockTracker.GetStartHeightFromBlockID(tx.ReferenceBlockID) | ||
if err := b.sendTransaction(ctx, tx); err != nil { | ||
b.log.Error().Err(err).Str("tx_id", tx.ID().String()).Msg("failed to send transaction") |
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.
avoid logging errors for api client issues since this can cause extremely noisy error level logging for larger operators.
b.log.Error().Err(err).Str("tx_id", tx.ID().String()).Msg("failed to send transaction") | |
b.log.Debug().Err(err).Str("tx_id", tx.ID().String()).Msg("failed to send transaction") |
if err != nil { | ||
return subscription.NewFailedSubscription(err, "could not get start height") | ||
b.log.Error().Err(err).Msg("failed to retrieve latest block") |
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.
This should actually throw an exception since the node must have the current sealed block in storage.
e.g.
irrecoverable.Throw(ctx, err)
Closes #6573, part of #6767
This PR implements functionality to return a Pending status immediately upon the start of a subscription.