Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Concurrent transactions #2

Closed
frol opened this issue Aug 4, 2024 · 2 comments
Closed

Concurrent transactions #2

frol opened this issue Aug 4, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@frol
Copy link

frol commented Aug 4, 2024

Let's also ensure we test the API usability when app developers need to make concurrent transactions (function calls).

There are several challenges there:

As part of this issue, I want us to doublecheck that it is possible to use near-api-rs in such situation and if not having a nice solution, at least have the option to have a helper wrapper with a pool of access keys.

@akorchyn
Copy link
Owner

akorchyn commented Sep 6, 2024

The nonce caching and key pooling are implemented on the Signer level.

As long as the user keeps using the same Signer instance (that is wrapped into Arc). It should be fine.

The nonce issue could happen if the number of keys is less than the amount of TXs per sending period.
Also, there is a potential issue that several instances of the same key are running concurrently. They may mess with each other, but it's up to the developer to provide unique keys.

@akorchyn akorchyn self-assigned this Sep 6, 2024
@akorchyn akorchyn added the enhancement New feature or request label Sep 6, 2024
@akorchyn
Copy link
Owner

akorchyn commented Sep 9, 2024

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants