Commit 7de0f2a
feat(framework): refactor SolidityNode as Spring component with safe shutdown
- Convert SolidityNode from static utility to @conditional @component so it
only registers when --solidity is passed
- Implement ApplicationListener<ContextClosedEvent> to set flag=false before
any @PreDestroy method fires, stopping worker threads promptly
- Add pushVerifiedBlock() to TronNetDelegate to route solidity sync blocks
through the conditional-shutdown check (<=, not ==, because a single
batch write can advance the DB header past the target number)
- Guard saveLatestSolidifiedBlockNum in loopProcessBlock: skip the write when
hitDown is true, preventing a phantom block-num from persisting when the
block was never actually pushed to BlockStore
- Add unit tests covering lifecycle hooks, all retry paths, interrupt handling,
and the hitDown save-guard; SolidityNode line coverage 28% -> 81%
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 1a97a81 commit 7de0f2a
7 files changed
Lines changed: 884 additions & 338 deletions
File tree
- framework/src
- main/java/org/tron
- core
- db
- net
- program
- test/java/org/tron
- core
- db
- net
- program
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | 1036 | | |
1054 | 1037 | | |
1055 | 1038 | | |
| |||
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
236 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
237 | 253 | | |
238 | | - | |
| 254 | + | |
239 | 255 | | |
240 | 256 | | |
241 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
58 | 68 | | |
59 | 69 | | |
60 | 70 | | |
| |||
0 commit comments