Commit 4995cf1
committed
Fix network stall during macroblock consensus
- Increased timeout to 15s during consensus period (blocks 61-90) to prevent false emergency detection
- Added active emergency recovery check in main loop (every 1 second)
- Recovery now triggers after 10 seconds OR 10 blocks (whichever comes first)
- Invalidate producer cache on emergency change and recovery
- Added LAST_BLOCK_PRODUCED_TIME and LAST_BLOCK_PRODUCED_HEIGHT for global stall detection
- Lowered FAST_SYNC_THRESHOLD from 50 to 10 blocks for faster sync
- Improved fork detection to allow immediate sync when own blocks are rejected
This prevents network deadlocks where:
1. Producer experiences delays during consensus overhead
2. Other nodes incorrectly trigger emergency failover
3. Failed producer gets stuck in emergency stop state
4. Network stalls because no blocks are produced
The fix ensures microblocks continue at 1 block/second while macroblock consensus runs in parallel.1 parent 583b484 commit 4995cf1
2 files changed
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2865 | 2865 | | |
2866 | 2866 | | |
2867 | 2867 | | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
2868 | 2898 | | |
2869 | 2899 | | |
2870 | 2900 | | |
| |||
4447 | 4477 | | |
4448 | 4478 | | |
4449 | 4479 | | |
| 4480 | + | |
| 4481 | + | |
| 4482 | + | |
| 4483 | + | |
| 4484 | + | |
| 4485 | + | |
4450 | 4486 | | |
4451 | 4487 | | |
4452 | 4488 | | |
4453 | 4489 | | |
| 4490 | + | |
| 4491 | + | |
4454 | 4492 | | |
4455 | | - | |
| 4493 | + | |
4456 | 4494 | | |
4457 | 4495 | | |
4458 | 4496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7885 | 7885 | | |
7886 | 7886 | | |
7887 | 7887 | | |
| 7888 | + | |
| 7889 | + | |
7888 | 7890 | | |
7889 | 7891 | | |
7890 | 7892 | | |
| |||
0 commit comments