Commit d1d5446
committed
perf(runtime-service): use short retry when no peers available
The runtime service tries to download the finalized block runtime
immediately at startup, before peer connections are established.
This always fails with StorageQueryError { errors: [] } (no peers
to query). Previously, this triggered the full 4s retry_after_failed
cooldown, making warm start consistently ~5-7s.
Now, "no peers" errors use a 200ms retry instead of 4s. Peers
typically connect within a few hundred milliseconds, so the retry
succeeds quickly. Other errors (peer misbehavior, decode failures)
still use the full 4s cooldown.
Benchmark on Polkadot: warm start drops from ~5.5s to ~600ms.1 parent 2cf734a commit d1d5446
3 files changed
Lines changed: 39 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
509 | 511 | | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
510 | 515 | | |
511 | 516 | | |
512 | 517 | | |
| |||
523 | 528 | | |
524 | 529 | | |
525 | 530 | | |
526 | | - | |
| 531 | + | |
527 | 532 | | |
528 | 533 | | |
529 | 534 | | |
530 | | - | |
| 535 | + | |
531 | 536 | | |
532 | 537 | | |
533 | 538 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2810 | 2810 | | |
2811 | 2811 | | |
2812 | 2812 | | |
2813 | | - | |
2814 | | - | |
2815 | | - | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
2816 | 2824 | | |
2817 | | - | |
2818 | | - | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
2819 | 2833 | | |
2820 | 2834 | | |
2821 | 2835 | | |
| |||
2832 | 2846 | | |
2833 | 2847 | | |
2834 | 2848 | | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
2835 | 2856 | | |
2836 | 2857 | | |
2837 | 2858 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1040 | 1040 | | |
1041 | 1041 | | |
1042 | 1042 | | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1043 | 1048 | | |
1044 | 1049 | | |
1045 | 1050 | | |
| |||
0 commit comments