Repository navigation
Commit 83ce8a8
committed
refactor(committor): unify transaction execution
Combined commits no longer need separate executor implementations for
single-stage execution, the first transaction of a split execution, and
the subsequent actions or undelegations. Replace their duplicated retry
loops and timeout adapters with one transaction executor.
- Track the current strategy, an optional pending strategy, the confirmed
commit signature, and the current attempt count in one concrete runner.
Remove SingleStageExecutor, TwoStageExecutor, Initialized, Committed,
the sealed trait, StageExecutor, and its three adapters.
- Route selected strategies through execute_strategy. Borrow the existing
authority, clients, preparator, callback scheduler, and committed-account
list instead of cloning services or rebuilding the account list.
- Preserve nonce, action, and undelegation recovery according to whether
the commit has already landed. Keep execution-limit fallback splitting
after the last combined commit and propagate recovered uniqueness nonces
to the pending transaction.
- Keep the ten-attempt recovery limit per transaction. Preserve attempts
consumed before a timeout, resetting the count only when advancing to
another transaction or switching to split execution.
- Apply the existing intent-wide callback deadline to the shared loop,
including callbacks in the pending transaction. Report each successful
transaction's callbacks before preparing the next transaction and retain
the existing callback behavior for preparation and recovery failures.
- Reuse the confirmed commit signature when removing failed follow-up
actions leaves no work. Preserve the failure when undelegation recovery
empties the transaction, and prevent whole-intent retries after a known
successful commit.
- Surrender current, pending, and replaced strategies for cleanup on
terminal paths. Record recovery cleanup before awaiting blockhash-cache
invalidation so cancellation cannot lose that cleanup information.
- Move integration tests to the shared entry point and check callback
timing at the next transaction's preparation boundary. Add six focused
unit tests covering timeout, retry counts, preparation and nonce-fetch
failures, cleanup, and recovery after a confirmed commit.
Keep transaction packing thresholds, result and error types, metric labels,
persisted status/signature mappings, public intents, and buffer-close policy
unchanged. Larger naming and persistence cleanup remains separate work.
Validation:
- All six transaction-executor unit tests passed.
- Clippy with warnings denied passed for all committor-service targets and
the test_intent_executor integration target.
- Integration test targets compiled successfully.
- Nightly formatting checks passed in both workspaces; git diff --check
passed.
- The devnet test_commit_id_actions_cpi_limit_errors_recovery test compiled
but failed during fixture funding, before exercising the executor. Local
RPC connectivity and the initial airdrop were unavailable in this session.
- No performance benchmark was run. The refactor adds no production RPC
calls or transactions; broader runtime coverage remains for CI.1 parent 48f4f1d commit 83ce8a8
7 files changed
Lines changed: 965 additions & 1165 deletions
File tree
- magicblock-committor-service/src/intent_executor
- transaction_executor
- test-integration/test-committor-service/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | | - | |
| 5 | + | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| |||
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | | - | |
39 | 36 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 37 | + | |
45 | 38 | | |
46 | 39 | | |
47 | 40 | | |
| |||
60 | 53 | | |
61 | 54 | | |
62 | 55 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 56 | + | |
66 | 57 | | |
67 | 58 | | |
68 | | - | |
| 59 | + | |
69 | 60 | | |
70 | | - | |
| 61 | + | |
71 | 62 | | |
72 | 63 | | |
73 | 64 | | |
| |||
238 | 229 | | |
239 | 230 | | |
240 | 231 | | |
241 | | - | |
242 | | - | |
243 | | - | |
| 232 | + | |
244 | 233 | | |
245 | 234 | | |
246 | 235 | | |
| |||
256 | 245 | | |
257 | 246 | | |
258 | 247 | | |
259 | | - | |
260 | | - | |
261 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
262 | 252 | | |
263 | 253 | | |
264 | 254 | | |
| |||
285 | 275 | | |
286 | 276 | | |
287 | 277 | | |
288 | | - | |
289 | | - | |
| 278 | + | |
290 | 279 | | |
291 | 280 | | |
292 | 281 | | |
293 | 282 | | |
294 | 283 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
344 | 289 | | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | 290 | | |
355 | 291 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | 292 | | |
402 | 293 | | |
403 | 294 | | |
404 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
405 | 301 | | |
| 302 | + | |
406 | 303 | | |
407 | | - | |
408 | | - | |
| 304 | + | |
409 | 305 | | |
410 | 306 | | |
411 | | - | |
412 | 307 | | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
| 308 | + | |
| 309 | + | |
419 | 310 | | |
420 | 311 | | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
| 312 | + | |
| 313 | + | |
443 | 314 | | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
| 315 | + | |
| 316 | + | |
450 | 317 | | |
451 | 318 | | |
452 | 319 | | |
| |||
0 commit comments