mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
docs: add warning regarding increment_block necessity on write_to_storage (#7816)
This commit is contained in:
@ -316,7 +316,12 @@ impl BundleStateWithReceipts {
|
|||||||
let mut bodies_cursor = tx.cursor_read::<tables::BlockBodyIndices>()?;
|
let mut bodies_cursor = tx.cursor_read::<tables::BlockBodyIndices>()?;
|
||||||
let mut receipts_cursor = tx.cursor_write::<tables::Receipts>()?;
|
let mut receipts_cursor = tx.cursor_write::<tables::Receipts>()?;
|
||||||
|
|
||||||
for (idx, receipts) in self.receipts.into_iter().enumerate() {
|
// ATTENTION: Any potential future refactor or change to how this loop works should keep in
|
||||||
|
// mind that the static file producer must always call `increment_block` even if the block
|
||||||
|
// has no receipts. Keeping track of the exact block range of the segment is needed for
|
||||||
|
// consistency, querying and file range segmentation.
|
||||||
|
let blocks = self.receipts.into_iter().enumerate();
|
||||||
|
for (idx, receipts) in blocks {
|
||||||
let block_number = self.first_block + idx as u64;
|
let block_number = self.first_block + idx as u64;
|
||||||
let first_tx_index = bodies_cursor
|
let first_tx_index = bodies_cursor
|
||||||
.seek_exact(block_number)?
|
.seek_exact(block_number)?
|
||||||
|
|||||||
Reference in New Issue
Block a user