Skip to content

refactor(types): derive MultiMessageAggregateError with thiserror#428

Merged
MegaRedHand merged 1 commit into
mainfrom
refactor/multi-message-aggregate-thiserror
Jun 10, 2026
Merged

refactor(types): derive MultiMessageAggregateError with thiserror#428
MegaRedHand merged 1 commit into
mainfrom
refactor/multi-message-aggregate-thiserror

Conversation

@MegaRedHand

Copy link
Copy Markdown
Collaborator

Addresses review feedback on #426 left after merge: use thiserror instead of manual Display / std::error::Error impls for MultiMessageAggregateError.

No behavior change; the error message is identical.

@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Refactors MultiMessageAggregateError to use thiserror::Error derive instead of hand-written Display and std::error::Error impls. thiserror is already a workspace dependency, so no new dependency is introduced.

  • The #[error(\"proof {0} bytes exceeds 512 KiB cap\")] attribute produces exactly the same formatted string as the previous write!(f, \"proof {n} bytes exceeds 512 KiB cap\") — no observable behavior change.
  • Nine lines of boilerplate are removed with no loss of functionality or test coverage.

Confidence Score: 5/5

Safe to merge — the change is mechanical boilerplate removal with no effect on runtime behavior.

The only changed file swaps nine lines of manual trait impls for a single derive attribute. The generated Display output is character-for-character identical to the original, thiserror is already a declared workspace dependency, and no callers or tests need updating.

No files require special attention.

Important Files Changed

Filename Overview
crates/common/types/src/block.rs Replaces manual Display/Error impls for MultiMessageAggregateError with thiserror::Error derive; error message is byte-for-byte identical and the dependency is already declared in Cargo.toml.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["MultiMessageAggregate::from_bytes(bytes)"] --> B{ByteList512KiB fits?}
    B -- yes --> C["Ok(MultiMessageAggregate)"]
    B -- no --> D["Err(ProofTooLarge(len))"]
    D --> E["Display via thiserror\n'proof N bytes exceeds 512 KiB cap'"]
    E --> F["std::error::Error impl\n(generated by thiserror derive)"]
Loading

Reviews (1): Last reviewed commit: "refactor(types): derive MultiMessageAggr..." | Re-trigger Greptile

@MegaRedHand MegaRedHand merged commit 0062339 into main Jun 10, 2026
4 of 7 checks passed
@MegaRedHand MegaRedHand deleted the refactor/multi-message-aggregate-thiserror branch June 10, 2026 16:33
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.

2 participants