Commit f4bc2f9
authored
feat: Fast delayed resubmit for Stellar insufficient-fee and TRY_AGAIN_LATER (#822)
* feat: Stellar fast resubmit on fee/TAL rejection
Insufficient-fee and TRY_AGAIN_LATER rejections now schedule their own
delayed resubmission instead of waiting for the status checker.
- submit_core schedules a delayed resubmit (5s × attempt) on
txInsufficientFee (cap raised 2→6) and the first 3 TRY_AGAIN_LATER
rejections; the status-checker ladder remains the fallback rescue
- enqueue failures are logged and swallowed — submission outcome unchanged
- transaction_submission_queue moved to the high-frequency Redis profile:
its 20s enqueue_scheduled sweep quantized the delays and let the status
checker double-fire (this feature is the first user of scheduled_on there)
- e2e harness: chained WireMock rejection mappings + runner with a 5-scenario
timing matrix, channels prod-parity profile (SQS standard/FIFO via
LocalStack), and closed-loop soak with residual-based scoring
Signed-off-by: Dylan Kilkenny <dylankilkenny95@gmail.com>
* test: Slim e2e fast-resubmit harness
Keep the repeatable regression core: the 5-scenario timing matrix with
measured-gap assertions. Drop the one-off prod-parity and soak tooling
used during development (results documented on the PR).
Replace the 9 near-duplicate chained mapping files with dynamic stub
registration against the WireMock admin API at arm time. The chains
decrement into the existing one-shot armed state, so any rejection
count works without a hardcoded ceiling.
Runner: 2146 -> 565 lines. Matrix re-verified 5/5 after the slim.
Signed-off-by: Dylan Kilkenny <dylankilkenny95@gmail.com>
* fix: Address PR review findings
- Recheck the insufficient-fee cap on the post-increment count before
scheduling a fast resubmit. Racing submit jobs for the same transaction
could both pass the pre-check; the recheck closes that window and fails
a doomed transaction one cycle earlier. New unit test covers it.
- Tighten the delay-escalation test to assert the exact 5s-per-attempt
formula instead of a 10-20s window.
- Bootstrap the e2e harness keystore when missing (generate and fund via
friendbot), so the harness runs from a fresh clone. Verified by moving
the local keystore aside and rerunning the matrix.
Signed-off-by: Dylan Kilkenny <dylankilkenny95@gmail.com>
* fix: Skip fast resubmit on post-record cap race
When two submit jobs race, the loser's post-record count exceeds the
cap. Failing there would clobber the winner's already-scheduled retry,
creating a failure mode the passive path does not have. Skip the
enqueue instead: the cap stays airtight and the next rejection's
pre-record check terminates the transaction normally.
Signed-off-by: Dylan Kilkenny <dylankilkenny95@gmail.com>
* fix: Final-state guard; harness scenario check
- If a transaction reached a final state between the RPC rejection and
the atomic retry record (racing job finalized it), the repo returns it
unchanged. Both rejection arms now skip scheduling in that case
instead of enqueueing a pointless resubmit. Unit tests for both arms.
- The e2e runner now fails fast (exit 64) on an invalid scenario name
instead of booting the stack and exiting green with zero scenarios;
scenario validation happens before any infrastructure starts.
Signed-off-by: Dylan Kilkenny <dylankilkenny95@gmail.com>
---------
Signed-off-by: Dylan Kilkenny <dylankilkenny95@gmail.com>1 parent 0b9d236 commit f4bc2f9
7 files changed
Lines changed: 1425 additions & 39 deletions
File tree
- src
- constants
- domain/transaction/stellar
- queues/redis
- testing/wiremock
- e2e
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
| 230 | + | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
245 | 247 | | |
246 | 248 | | |
247 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
87 | 167 | | |
88 | 168 | | |
89 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
0 commit comments