Skip to content

Commit

Permalink
fix: makes postgres behave just like in memory, bypassing blocks with…
Browse files Browse the repository at this point in the history
…out slots
  • Loading branch information
renancloudwalk committed Feb 23, 2024
1 parent a50238b commit 28d73b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/eth/storage/postgres/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,13 @@ impl PermanentStorage for Postgres {
for (slot_idx, value) in change.slots {
let (original_value, val) = value.clone().take_both();
let idx: [u8; 32] = slot_idx.into();
let val: [u8; 32] = val.ok_or(anyhow::anyhow!("critical: no change for slot"))?.value.into(); // the or condition should never happen
let val: [u8; 32] = match val {
Some(s) => s.value.into(),
None => {
tracing::trace!("slot value not set, skipping");
break;
}
};
let block_number = i64::try_from(block.header.number).context("failed to convert block number")?;
let original_value: [u8; 32] = original_value.unwrap_or_default().value.into();

Expand Down

0 comments on commit 28d73b6

Please sign in to comment.