txmgr: Restructure internals and add TxNotInMempoolTimeout#5286
txmgr: Restructure internals and add TxNotInMempoolTimeout#5286trianglesphere merged 4 commits intodevelopfrom
Conversation
|
✅ Deploy Preview for opstack-docs canceled.
|
cf37742 to
da9fe76
Compare
|
Semgrep found 1
Unchecked type assertion. Created by unchecked-type-assertion. |
cf59022 to
5e7a716
Compare
5e2d5d0 to
2c546e3
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #5286 +/- ##
===========================================
- Coverage 39.93% 36.15% -3.79%
===========================================
Files 382 227 -155
Lines 24376 19883 -4493
Branches 838 0 -838
===========================================
- Hits 9734 7188 -2546
+ Misses 13911 12000 -1911
+ Partials 731 695 -36
Flags with carried forward coverage won't be shown. Click here to find out more.
|
ajsutton
left a comment
There was a problem hiding this comment.
Generally looks good - left a few clarifying comments. Main concern for me is having to sleep in tests - that's a very common source of intermittency and leads to slower tests.
sebastianst
left a comment
There was a problem hiding this comment.
I'm wondering, do we even need the async tx sending in send with sendTxAsync via a goroutine and then waiting for the receipt on a channel?
It looks to me like the whole transaction sending loop could also just be a normal synchronous call to publishAndWaitForTx, which would simply return *types.Receipt, error. But maybe I'm just oversimplifying the algorithm here.
2c546e3 to
1d50cc9
Compare
It's because when we update the gas price, we are waiting for multiple different transaction hashes. Say a tx gets included in L1, but we then published another transaction with a higher gas price before we realize. If we only waited for the second TX we would miss that the first TX we sent got included on L1. We could make it synchronous by polling every transaction that has been sent |
|
Actually I'm going to dismiss my review and just leave approval to Seb since he has better context. I really just meant to remove my request changes. |
I'm happy with it, but leaving final approval to Seb.
Ah thanks, that makes sense. If we're running into problems with the current async architecture, I'd vote for this refactor. But fine for now since it works. |
sebastianst
left a comment
There was a problem hiding this comment.
Looks great, just two open questions regarding error strings checking
|
#5286 (comment)
|
90c5955 to
18524db
Compare
|
This PR has been added to the merge queue, and will be merged soon. |
|
This PR is next in line to be merged, and will be merged as soon as checks pass. |
1 similar comment
|
This PR is next in line to be merged, and will be merged as soon as checks pass. |
|
@Mergifyio refresh |
✅ Pull request refreshed |
|
This PR has been added to the merge queue, and will be merged soon. |
Description
This restructures a lot of the internal of transaction sending. It adds a new flag and features where it aborts sending the transaction if the transaction is never seen on the network after a default of 2 minutes (configurable via txmgr flag).
The transaction manager's
sendStatehas been modified to track successful publishes and the time of its creation. If it goes forTxNotInMempoolTimeouttime without seeing a successful transaction publish (i.e. it believes the tx is not in the mempool) then it will abort.The goal of this change is to ensure that the transaction manager does not get stuck in state where the transaction will not get confirmed while not accidentally recording transactions as failed when they in fact succeeded.
TODOs