Repository navigation
Commit 0554671
authored
Resolve latest to the safe watermark in tracer block lookups (#4552)
`debug_traceCall`, `debug_traceBlockByNumber` and the other tracer paths
that go through `Backend.BlockByNumber` resolved `latest`, `safe` and
`finalized` with `ConvertBlockNumber`, which returns the app's latest
height. The watermarks can trail that height by a block (for example,
while the receipt store catches up). The concrete height then failed the
watermark check with `requested height N is not yet available; safe
latest is N-1`, even though the caller never asked for a specific
height. This is the failure the nightly `TestNightlyGigaMixedRelease`
run hit on 10-07. Part of SEI-10413.
`BlockByNumber` now resolves the tag with `getBlockNumber`, the helper
the other block lookups already use. It returns a nil height for
`latest`, `safe`, `finalized` and `pending`, which
`blockByNumberRespectingWatermarks` resolves to the safe latest, and it
returns an error when the genesis lookup for `earliest` fails.
`ConvertBlockNumber` had no other callers and is removed along with its
test. It also panicked on `pending` and on a failed genesis lookup, so
`debug_traceBlockByNumber` at `pending` now traces the latest block, as
the other endpoints already do for `pending`. The new test puts the
block store and app state one block ahead of the receipt store and
checks that all four tags resolve to the safe latest. Without the fix it
fails with the same error as the nightly run.1 parent 1e58601 commit 0554671
2 files changed
Lines changed: 67 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | 421 | | |
439 | | - | |
440 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
441 | 427 | | |
442 | 428 | | |
443 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | 384 | | |
406 | 385 | | |
407 | 386 | | |
| |||
980 | 959 | | |
981 | 960 | | |
982 | 961 | | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
983 | 1024 | | |
984 | 1025 | | |
985 | 1026 | | |
| |||
0 commit comments