Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

feat(driver): Don't panic by default on disputed payload derivation failure#506

Closed
hashcashier wants to merge 2 commits intoop-rs:mainfrom
hashcashier:kailua-1
Closed

feat(driver): Don't panic by default on disputed payload derivation failure#506
hashcashier wants to merge 2 commits intoop-rs:mainfrom
hashcashier:kailua-1

Conversation

@hashcashier
Copy link
Contributor

This PR enables the client to customize how it handles a failure by DerivationDriver::produce_disputed_payload due to StageError::NotEnoughData. This would enable a no_std client to handle that an output cannot be derived from the available L1 data without panic handling.

Copy link
Contributor

@refcell refcell left a comment

Choose a reason for hiding this comment

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

Small change

/// Produces the disputed [L2AttributesWithParent] payload, directly after the starting L2
/// output root passed through the [BootInfo].
pub async fn produce_disputed_payload(&mut self) -> Result<L2AttributesWithParent> {
pub async fn produce_disputed_payload(&mut self) -> Result<Option<L2AttributesWithParent>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to flatten this error type then.

e.g.

	pub async fn produce_disputed_payload(&mut self) -> Result<L2AttributesWithParent> {
		...

		attributes.ok_or("Failed to derive payload attributes")
	}

Comment on lines +61 to +62
let L2AttributesWithParent { attributes, .. } =
driver.produce_disputed_payload().await?.expect("Failed to derive payload attributes");
Copy link
Contributor

Choose a reason for hiding this comment

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

If we keep the signature fn() -> Result<L2AttributesWithParent> as I suggest, we shouldn't need to change this since the error will bubble up :)

@refcell
Copy link
Contributor

refcell commented Sep 23, 2024

This is fixed by #545 - closing for now. Please open an issue if you dislike the solution from #545. Thanks!

@refcell refcell closed this Sep 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants