|
16 | 16 | //! produced before this runtime shipped (bounded only by whether their events |
17 | 17 | //! still decode). |
18 | 18 | //! |
19 | | -//! - `current_transaction_statuses` / `current_receipts`: real entries first, |
20 | | -//! then synth (whose `transaction_index` continues from the real count). |
21 | | -//! - `current_block`: real tx list untouched; only OR the synth-log blooms into |
| 19 | +//! All three views stay index-aligned (real entries first, synth appended in a |
| 20 | +//! stable order, `transaction_index` continuing from the real count) so a synth |
| 21 | +//! tx's mapping-DB index resolves consistently across them: |
| 22 | +//! - `current_transaction_statuses` / `current_receipts`: real, then synth. |
| 23 | +//! - `current_block`: synth txs appended to `transactions` (so |
| 24 | +//! `eth_getTransactionByHash`/`*_receipt` can index them — fc-rpc does |
| 25 | +//! `block.transactions[index]`), and the synth-log blooms OR'd into |
22 | 26 | //! `header.logs_bloom` so `filter_range_logs`' header-bloom prefilter doesn't |
23 | 27 | //! skip synth-only blocks. |
24 | 28 |
|
@@ -108,10 +112,11 @@ where |
108 | 112 |
|
109 | 113 | fn current_block(&self, at: Hash) -> Option<EthBlock> { |
110 | 114 | let mut block = self.inner.current_block(at)?; |
111 | | - for (_, status, _) in self.synthetic(at) { |
| 115 | + for (tx, status, _) in self.synthetic(at) { |
112 | 116 | for (h, s) in block.header.logs_bloom.0.iter_mut().zip(status.logs_bloom.0.iter()) { |
113 | 117 | *h |= *s; |
114 | 118 | } |
| 119 | + block.transactions.push(tx); |
115 | 120 | } |
116 | 121 | Some(block) |
117 | 122 | } |
|
0 commit comments