Skip to content

Conversation

greged93
Copy link
Collaborator

@greged93 greged93 commented Sep 30, 2025

Resolves #328

Comment on lines 366 to 372
attributes.push(WithL1FinalizedBlockNumber::new(
batch.block_number,
WithL2BlockNumber::new(
block.context.number,
WithBatchInfo::new(batch.index, batch.hash, attribute),
),
));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update adds a little work when initializing the structures, but the information attached to the attribute is more explicit.

Comment on lines 193 to 194
// we reset `latest_processed_l2_block_number` to 0.
self.latest_processed_l2_block_number = 0;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resetting to 0 means the next batch that we receive won't be checked for contiguity.

Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments inline.

payload_attributes_with_batch_info.index,
payload_attributes_with_batch_info.hash,
);
let mut payload_attributes = payload_attributes_with_batch_info.inner.inner.inner.clone();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type is getting unwieldy with the requirement of .inner.inner.inner. Should we consider refactoring the base types to include the additional metadata?

}
}
/// Type alias for a wrapper type with the full L2 metadata.
pub type WithFullL2Meta<T> = WithL1FinalizedBlockNumber<WithL2BlockNumber<WithBatchInfo<T>>>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above, this is a complex type. Should we push the additional metadata into the inner type T.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do, I like the idea of having these composable wrappers, so we can just quickly attach some extra information to structures. But I can push this info to the T

@greged93
Copy link
Collaborator Author

greged93 commented Oct 7, 2025

@frisitano what do you think about bumping to rust edition 2024? Reth bumped it recently.

@greged93 greged93 requested a review from frisitano October 7, 2025 14:26
@greged93 greged93 changed the title feat: check continuity of blocks + rework wrappers feat: check continuity of payload attributes Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Derivation Pipeline] Assert batches are processed contiguously
2 participants