Skip to content

Commit

Permalink
Decrease DB load by not storing full payload with anchor leaf
Browse files Browse the repository at this point in the history
  • Loading branch information
jbearer committed Nov 16, 2024
1 parent 31c5f9d commit 916646a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sequencer/src/persistence/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,15 @@ impl SequencerPersistence for Persistence {
let values = leaf_chain
.into_iter()
.map(|(info, qc)| {
// The leaf may come with a large payload attached. We don't care about this payload
// because we already store it separately, as part of the DA proposal. Storing it
// here contributes to load on the DB for no reason, so we remove it before
// serializing the leaf.
let mut leaf = info.leaf.clone();
leaf.unfill_block_payload();

let view = qc.view_number.u64() as i64;
let leaf_bytes = bincode::serialize(&info.leaf)?;
let leaf_bytes = bincode::serialize(&leaf)?;
let qc_bytes = bincode::serialize(&qc)?;
Ok((view, leaf_bytes, qc_bytes))
})
Expand Down

0 comments on commit 916646a

Please sign in to comment.