Spencer's suggestions - #1
Merged
Merged
Conversation
The hub forwards value on each bridge call, but no function could bring ETH in, so every value-bearing dispatch reverts. Payable lets a dispatch carry ETH.
spengrah
force-pushed
the
spengrah/suggestions
branch
from
August 17, 2026 19:45
f6df53b to
36b3b0e
Compare
I believe calldata slices are slightly more efficient here, since they keep everything in calldata without needing to copy to memory. That does require that module implementations store the result as calldata rather than memory to get the efficiency advantage.
The shared decoder errors are really part of the decoder protocol, so it's reasonable for them to be declared by the IDecoder interface. Moving them there, and then moving WormholeError into the modules/wormhole directory, also gives us slightly better operational modularity, since adding a new module no longer involves changing a protocol-level file.
Encoders that address a receiver (Fx, Inbox, Portal2) no longer need to call back into SenderHub. Instead, the hub passes receiverHubs[chainId] as an argument, which lets us avoid the staticcall back to SenderHub and the modules' dependency on ISenderHub. Encoders like Wormhole that don't need that value can ignore it. `encode` now returns an array of `Call`s — the existing type, whose shape already matches what the hub needs — and the hub loops over it. This creates the possibility for a future composite encoder that creates encodings for multiple bridges to the same target chain, enabling multi-bridge sending if we ever decide we need bridge aggregation.
In the spirit of modularity, this moves the module-related selector definitions into the respective src/modules/{module} directories so that adding a new module doesn't involve changing a protocol-level file.
One downside of moving away from a single file with all selectors is that checking for collisions involves looking at multiple files. One way we could mitigate that is with a deploy-time script that checks a module against already-deployed modules, and/or a test that checks against other modules in the repo.
spengrah
force-pushed
the
spengrah/suggestions
branch
from
August 18, 2026 19:40
005c731 to
2cb85be
Compare
spengrah
marked this pull request as ready for review
August 18, 2026 19:55
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.
This PR contains the changes we agreed on in discussion. Each commit is a single change. Commits 1 and 2 apply independently on top of main; 3-5 apply sequentially.
Changes/Commits
sendMultichainActionsallows ETH to enter the sender hub so that it can forward value to bridge calls.IDecoder, and module errors into respective module directories.Call[]fromIEncoder.encode— the existingCalltype, whose shape already matches what the hub needs. The array return is a prerequisite for bridge aggregation if we want it later.Not in this PR
research/per-chain-dispatchfor further exploration.SetEncoder,SetReceiverHub,DecoderRegistered) tospengrah/setter-event-prior-values, pending further discussion.