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.
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
grant_installation #50
grant_installation #50
Changes from all commits
199eab9
1b27f34
7286f1a
fff0803
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Made into an issue, #51
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.
Check warning on line 46 in registry/src/lib.rs
Codecov / codecov/patch
registry/src/lib.rs#L45-L46
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.
Remember that this string will always be created, even if this log is suppressed. This may be slightly too verbose logging.
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.
I'm perfectly fine eliminating that. it was used during my debugging, but I don't feel strongly here.
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.
so far, we've been doing this strategy with
.await?.await?
which first sends the transaction, gets back aPendingTransaction
, and then waits for it to be included + a specified amount of confirmations (default of 1). I like what you did below, though, but unsure what the better path would be:Do we make the gateway wait until tx is confirmed or do we just return the tx_hash and have libxmtp/client wait?
We can instead just return the txHash from the RPC, and not wait on transaction inclusion, leaving tx confirmations up to the client. We do give up some control if something goes wrong.
Not a super important detail, but maybe worth a quick discussion WDYT @tsachiherman @jac18281828 @37ng
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.
I think that it's a very important observation, as this is a blocking operation that consumes servers memory for the entire duration of the operation.
Another point is that regardless if we make it "non-blocking" or not, we need to be able to detect a fail cases so that we can log these.
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.
That's true, IMO I think we should hand off control of the transaction to the client and just return txHash. A
PendingTransaction
can be easily rebuilt fromlibxmtp
side by just providing the hash and a provider, so if anything fails they could re-submit the transactionWe could also provide an endpoint to do this for them, i.e
subscribeTransaction
or something along those linesThere 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.
We should avoid waiting whenever possible in the service. We haven't spent much time optimizing the number of threads, etc., these threads will be precious.
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.
made an issue for this: #52
the return of revoke_installation will have to change as well