Repository navigation
Commit 949abfd
fix: skip validator duties while syncing (lambdaclass#418)
## 🗒️ Description / Motivation
- Prevents validators from proposing blocks or producing attestations
while their local view is syncing.
- Signing with a stale local view can place proposals and attestations
on a chain the network has already left.
- Builds on the leanEthereum/leanSpec#708 sync heuristic added in the
preceding PR (lambdaclass#417 ).
## What Changed
- Gate scheduled block proposals using the node’s sync status.
- Report `has_proposal = false` to the store when a proposal is skipped.
- Gate attestation production at interval 1.
- Log skipped proposal and attestation duties.
- Keep block processing, fork choice, aggregation, metrics, and key
advancement active while syncing.
- Add tests covering gating, recovery, and network-wide stalls.
## Correctness / Behavior Guarantees
- Proposals and attestations are disabled only while the local node is
considered syncing.
- Duties resume once the node catches up past the hysteresis recovery
boundary.
- Duties remain enabled during a network-wide stall so validators can
help the chain recover.
- Incoming network data and synchronization processing remain
unaffected.
- A skipped proposal is not reported to fork choice as locally
available.
## Tests Added / Run
- Added tests verifying:
- Proposals and attestations are gated while syncing.
- Duties resume after catching up.
- Duties remain enabled during network-wide stalls.
- Ran `cargo test -p ethlambda-blockchain --lib --offline`.
- 31 passed; 0 failed.
- Ran `cargo clippy -p ethlambda-blockchain --lib --offline -- -D
warnings`.
- Ran `cargo fmt --all -- --check`.
- Ran `git diff --check`.
## Related Issues / PRs
- Closes lambdaclass#236
- Depends on the sync-status heuristic PR.
- Follows leanEthereum/leanSpec#708.
## ✅ Verification Checklist
- [x] Ran `make fmt` — clean
- [x] Ran `make lint` (clippy with `-D warnings`) — clean
- [ ] Ran `cargo test --workspace --release` — all passing
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Pablo Deymonnaz <pdeymon@fi.uba.ar>1 parent 7208707 commit 949abfd
1 file changed
Lines changed: 55 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
99 | 107 | | |
100 | 108 | | |
101 | 109 | | |
| |||
273 | 281 | | |
274 | 282 | | |
275 | 283 | | |
276 | | - | |
| 284 | + | |
277 | 285 | | |
278 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
279 | 294 | | |
280 | 295 | | |
281 | 296 | | |
| |||
334 | 349 | | |
335 | 350 | | |
336 | 351 | | |
337 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
338 | 357 | | |
339 | 358 | | |
340 | 359 | | |
| |||
1068 | 1087 | | |
1069 | 1088 | | |
1070 | 1089 | | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1071 | 1096 | | |
1072 | 1097 | | |
1073 | 1098 | | |
| |||
1112 | 1137 | | |
1113 | 1138 | | |
1114 | 1139 | | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
1115 | 1168 | | |
0 commit comments