mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
fix(era): SlotIndex offset support negative value (#18047)
This commit is contained in:
@@ -153,8 +153,8 @@ where
|
||||
let mut writer = Era1Writer::new(file);
|
||||
writer.write_version()?;
|
||||
|
||||
let mut offsets = Vec::<u64>::with_capacity(block_count);
|
||||
let mut position = VERSION_ENTRY_SIZE as u64;
|
||||
let mut offsets = Vec::<i64>::with_capacity(block_count);
|
||||
let mut position = VERSION_ENTRY_SIZE as i64;
|
||||
let mut blocks_written = 0;
|
||||
let mut final_header_data = Vec::new();
|
||||
|
||||
@@ -179,7 +179,7 @@ where
|
||||
let body_size = compressed_body.data.len() + ENTRY_HEADER_SIZE;
|
||||
let receipts_size = compressed_receipts.data.len() + ENTRY_HEADER_SIZE;
|
||||
let difficulty_size = 32 + ENTRY_HEADER_SIZE; // U256 is 32 + 8 bytes header overhead
|
||||
let total_size = (header_size + body_size + receipts_size + difficulty_size) as u64;
|
||||
let total_size = (header_size + body_size + receipts_size + difficulty_size) as i64;
|
||||
|
||||
let block_tuple = BlockTuple::new(
|
||||
compressed_header,
|
||||
|
||||
Reference in New Issue
Block a user