Merged
Conversation
zeroXbrock
approved these changes
Apr 16, 2026
Member
zeroXbrock
left a comment
There was a problem hiding this comment.
thanks @0xl3on, this is great!
I just added a lil trait (IntoCombinedCallback) + generic impl to add a with_callback method to all impls of SpamCallback so any callback could easily chain more callbacks, making use of CombinedCallback in the background. Now lib users can just do something like mycallback.with_callback(another_callback), and as long as they implement SpamCallback it'll work 😎
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Closes #326
Solution
Hey, here's a proposed solution to the issue:
Added a CombinedCallback<A, B> that pairs two callbacks and merges their handles, plus a with_callback builder on LogCallback:
Both sides run on every on_tx_sent / on_batch_sent, so custom callbacks get the DB caching for free. No trait changes, NilCallback and --ignore-receipts still behave the same
PR Checklist
cargo +nightly clippy --workspace --lib --examples --tests --benches --all-features --locked --fixcargo fmt --allCHANGELOG.mdin each affected crate