Skip to content

chore(consensus): Add trait object error variant to ConsensusError#20875

Merged
emhane merged 3 commits intomainfrom
emhane/upstream-trait-obj-consensus-err
Jan 9, 2026
Merged

chore(consensus): Add trait object error variant to ConsensusError#20875
emhane merged 3 commits intomainfrom
emhane/upstream-trait-obj-consensus-err

Conversation

@emhane
Copy link
Collaborator

@emhane emhane commented Jan 9, 2026

Upstreams op-rs#492

Removes redundant PartialEq and Eq impls for ConsensusError, which were only used in tests, and adds ConsensusError::Custom variant wrapping a trait object error.

Follow up to #20843

)

Close #481

Adds a `Custom` variant to `ConsensusError` that wraps an error trait
object, following the same pattern as `DatabaseError` in #388. This
enables type-safe error handling between `ConsensusError` and custom L2
error types without matching on error strings.

Also removes `PartialEq` and `Eq` derives since `Arc<dyn Error>` can't
implement them, and fixes affected tests in downloaders.

cc @emhane

---------

Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
@emhane emhane added C-debt A clean up/refactor of existing code A-consensus Related to the consensus engine A-sdk Related to reth's use as a library labels Jan 9, 2026
@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Jan 9, 2026
@emhane emhane enabled auto-merge January 9, 2026 09:36
@emhane emhane added this pull request to the merge queue Jan 9, 2026
@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Jan 9, 2026
Merged via the queue into main with commit bf272c9 Jan 9, 2026
45 checks passed
@emhane emhane deleted the emhane/upstream-trait-obj-consensus-err branch January 9, 2026 13:11
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Jan 9, 2026
yongkangc pushed a commit that referenced this pull request Jan 12, 2026
yongkangc pushed a commit that referenced this pull request Jan 13, 2026
yongkangc pushed a commit that referenced this pull request Jan 13, 2026
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 22, 2026
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-consensus Related to the consensus engine A-sdk Related to reth's use as a library C-debt A clean up/refactor of existing code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants