-
Notifications
You must be signed in to change notification settings - Fork 297
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
Conversation
3e4e1d1
to
faa460c
Compare
📝 Walkthrough📝 WalkthroughWalkthroughThe changes introduce a new struct, Changes
Assessment against linked issues
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
square size test started failing, investigating that.
pkg/user/tx_client.go
Outdated
@@ -137,6 +148,9 @@ type TxClient struct { | |||
defaultGasPrice float64 | |||
defaultAccount string | |||
defaultAddress sdktypes.AccAddress | |||
txPool map[string]poolTxInfo |
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.
Created a new issue that this pr directly resolves #3899 i decided to keep the old one for context. Me and Callum can groom it/close it/delete it when we pm best txs stuff. |
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.
LGTM!
pkg/user/pruning_test.go
Outdated
txClient.pruneTxTracker() | ||
// Prunes the transactions that are 10 minutes old | ||
// 5 transactions will be pruned | ||
require.Equal(t, txTrackerBeforePruning-txsToBePruned, txsToBePruned) |
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.
[nit] Would be nice to apply this comment of coderabbit.
}) | ||
} | ||
|
||
func TestEvictions(t *testing.T) { |
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 we just need to add this test to the exceptions list to get past the race detector issue with testnode/sdk
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.
resolved now. can I please get another approval? 🙏🏻
d7ea9b9
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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
- Makefile (1 hunks)
🔇 Additional comments not posted (1)
Makefile (1)
Line range hint
1-265
: Overall Makefile structure is comprehensiveWhile not directly related to the change, it's worth noting that this Makefile is well-structured and includes a wide range of targets for building, testing, linting, and managing the celestia-app project. This comprehensive setup facilitates easier development, testing, and maintenance of the project.
Overview
Fixes #3899