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
refactor: index submitted txs in tx client and improve nonce management #3830
refactor: index submitted txs in tx client and improve nonce management #3830
Changes from 13 commits
a2e490c
faa460c
c98a337
3dd6abb
9aa7af6
6d2c828
ee0e7b2
e050bc0
500e5be
6eb72e0
4d6b196
6e02de3
bd3f5e0
4046a59
7832fdc
437e4a7
1c7a7b3
f3c0af3
330c525
1e0353b
1e35d86
9ac1e5c
088aeda
ba4a7cc
0fc939f
046ce94
918089b
30985ae
30c1dc0
c2b72fb
c676a97
1e1de7f
def40f2
54ff169
5b1f1d2
a492e39
4d47ce9
58d6c23
d7ea9b9
ac47d8f
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.
[Question] do we want to have a way of periodically clearing the cache?
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.
@evan-forbes @cmwaters I'd appreciate your input 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.
ideally, it seems like we should never be a scenario where we need this to be cleared. Either a tx is included and we continually try to get it included, or we handle each case when that does not occur and remove the tx at that point
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.
the only time tx doesn't get removed from this local cache is if context gets cancelled while polling for tx status which means that the said tx was never confirmed. If the transaction doesn't get confirmed it can linger in that cache until it ooms
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.
by periodically, do we mean a ttl?
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.
yes!
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.
The scenario that I see as more problematic is if a user decides to use BroadcastTx which creates the map entry and doesn't use ConfirmTx which cleans it up (because maybe they don't care if it lands or not).
I think we should garbage collect, but not as a separate go routine but within BroadcastTx.
I would give at least 10 minutes before we clean up.