-
Notifications
You must be signed in to change notification settings - Fork 332
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
Remove chain runtime #3341
Remove chain runtime #3341
Conversation
|
||
/// A cached copy of the account information | ||
account: Option<Account>, | ||
account: AsyncRwLock<Option<Account>>, |
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.
Here's the lock for the account
get_or_fetch_account(&self.grpc_addr, &key_account, &mut self.account).await?; | ||
// Take a write lock on the current account, | ||
// excluding anybody from sending txs until we are done. | ||
let mut opt_account = self.account.write().await; |
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.
We take the lock here for the remaining duration of the function, ie. until the tx has been submitted.
|
||
// Take a write lock on the current account, | ||
// excluding anybody from sending txs until we are done. | ||
let mut opt_account = self.account.write().await; |
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.
We take the lock here for the remaining of the function, ie. until the counterparty payee has been registered.
… the chain (#3350) * Limit the maximum number of requests which can issued concurrently to the chain Controlled via the `max_concurrency` setting in the chain configuration. * Swap out `rsevents-extra` for `std-semaphore`
Is this PR just waiting on reviews at this point, or does it need more work? |
Reviews and some testing, ideally in prod ;) |
Closes: #3344
Description
By removing the chain runtime, we can issue queries concurrently rather than serially, which has the potential to speed up relaying in two cases:
a) when relaying on multiple channels between two or more chains
b) when relaying between a chain A and two or more chains B, C, ... with A<->B, A<->C, ...
Note that it won't let us send multiple txs concurrently because of the monotonic constraint on the account sequence number. To speed up this aspect of the relayer, we would need multiple wallets.
PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.