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
Closed
feat(driver): Don't panic by default on disputed payload derivation failure#506hashcashier wants to merge 2 commits intoop-rs:mainfrom
hashcashier wants to merge 2 commits intoop-rs:mainfrom
Conversation
refcell
suggested changes
Sep 6, 2024
| /// 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>> { |
Contributor
There was a problem hiding this comment.
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"); |
Contributor
There was a problem hiding this comment.
If we keep the signature fn() -> Result<L2AttributesWithParent> as I suggest, we shouldn't need to change this since the error will bubble up :)
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enables the client to customize how it handles a failure by
DerivationDriver::produce_disputed_payloaddue toStageError::NotEnoughData. This would enable ano_stdclient to handle that an output cannot be derived from the available L1 data without panic handling.