Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set first block at the beginning of batch execution #10302

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

joshieDo
Copy link
Collaborator

save_receipts requires the first_block to be set, otherwise it won't ever prune the receipts from the first block

/// Save receipts to the executor.
pub fn save_receipts(&mut self, receipts: Vec<Receipt>) -> Result<(), BlockExecutionError> {
let mut receipts = receipts.into_iter().map(Some).collect();
// Prune receipts if necessary.
self.prune_receipts(&mut receipts).map_err(InternalBlockExecutionError::from)?;

fn prune_receipts(
&mut self,
receipts: &mut Vec<Option<Receipt>>,
) -> Result<(), PruneSegmentError> {
let (Some(first_block), Some(tip)) = (self.first_block, self.tip) else { return Ok(()) };
let block_number = first_block + self.receipts.len() as u64;

@joshieDo joshieDo added A-staged-sync Related to staged sync (pipelines and stages) A-execution Related to the Execution and EVM A-pruning Related to pruning or full node labels Aug 14, 2024
@joshieDo joshieDo added C-bug An unexpected or incorrect behavior and removed A-staged-sync Related to staged sync (pipelines and stages) labels Aug 14, 2024
@mattsse mattsse added this pull request to the merge queue Aug 14, 2024
Merged via the queue into main with commit 418e223 Aug 14, 2024
35 checks passed
@mattsse mattsse deleted the joshie/prune-exec branch August 14, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-execution Related to the Execution and EVM A-pruning Related to pruning or full node C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants