Commit b394328
authored
ethereum: Handle mixed block formats in recent_blocks_cache (#6312)
The recent_blocks_cache can contain blocks in two formats:
- Full format: {"block": {...}, "transaction_receipts": [...]}
- Light format: just block fields (no wrapper)
This happens because different code paths populate the cache with
different formats (upsert_block uses full, blocks_from_store uses light).
Changes:
- load_blocks/parent_ptr: Extract block data from full format if needed
using `value.get("block").unwrap_or(&value)`
- ancestor_block: Explicit check for light format with clear logging,
falls back to Firehose/RPC since receipts are needed for triggers
- Improved log messages to show block number and hash on failures1 parent 6f9fa54 commit b394328
2 files changed
Lines changed: 46 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1075 | 1075 | | |
1076 | 1076 | | |
1077 | 1077 | | |
1078 | | - | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
1079 | 1082 | | |
1080 | 1083 | | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1104 | 1114 | | |
1105 | 1115 | | |
1106 | 1116 | | |
| |||
1161 | 1171 | | |
1162 | 1172 | | |
1163 | 1173 | | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
1167 | 1180 | | |
1168 | 1181 | | |
1169 | 1182 | | |
1170 | 1183 | | |
1171 | 1184 | | |
1172 | | - | |
1173 | 1185 | | |
1174 | 1186 | | |
1175 | 1187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1614 | 1614 | | |
1615 | 1615 | | |
1616 | 1616 | | |
1617 | | - | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
1618 | 1621 | | |
1619 | | - | |
1620 | | - | |
| 1622 | + | |
| 1623 | + | |
1621 | 1624 | | |
1622 | 1625 | | |
1623 | 1626 | | |
1624 | | - | |
1625 | 1627 | | |
1626 | 1628 | | |
1627 | 1629 | | |
| |||
0 commit comments