feat(protocol): modularize the inbox by adding hooks and native eth bond support - #21108
feat(protocol): modularize the inbox by adding hooks and native eth bond support#21108AnshuJalan wants to merge 8 commits into
Conversation
ggonzalez94
left a comment
There was a problem hiding this comment.
I like this. I think the idea is clean and pretty helpful.
I left a couple comments on abstractions I believe we can improve, and will submit a small PR for an idea of how to improve one of them.
If we go this route, I think we should consider what other things make sense to make possible to override safely.
- the whole activation flow. New chains should not have a need for this, and even existing chains will likely want to deal with it differently.
- Event emission? other chains might require a different event structure
Co-authored-by: Gustavo Gonzalez <gustavo@taiko.xyz> Co-authored-by: ggonzalez94 <17907743+ggonzalez94@users.noreply.github.com>
|
Claude finished @AnshuJalan's task in 2m 0s —— View job Code Review CompleteSummaryThis PR successfully modularizes the Inbox contract through hooks and adds native ETH bond support. The implementation is generally solid with good test coverage. I've identified several security considerations and potential improvements below. Positive Aspects
Security Concerns1. Reentrancy Risk with Native ETH (Medium Severity)Location: Native ETH transfers via _feeRecipient.sendEtherAndVerify(totalFees * 1 gwei);If Recommendation:
2.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac21b3a6de
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
ggonzalez94
left a comment
There was a problem hiding this comment.
Looks great! Left a few minor nits, and a suggestion for how to deal with the verifier without needing to make that function virtual
|
Marked this as CC: @ggonzalez94 |
Sounds good. If they are strictly additions of top I would still try to merge this so that the PR does not become too big. Also let's not forget to go back using gwei for the bond, since wei is too small and it would break our shasta deployment |
|
Yeah, so I am reverting to wei and not making any new changes in this PR. Will raise a separate one after a discussion |
b978280 to
495e52f
Compare
|
@ggonzalez94 Need your re-approval |
This PR refactors the inbox to add some hooks that we found useful to make the Inbox modular. Using these hooks, developers of rollup protocols can extend the inbox and add custom features without having to modify the base contract.
Examples of such custom features (from Surge repo) are linked below:
Developers can also "chain" multiple features in a single inbox like this: https://github.com/NethermindEth/surge-taiko-mono/blob/v3.0.0-deployment-scripts/packages/protocol/contracts/layer1/surge/deployments/internal-devnet/SurgeInbox.sol
Additionally, this PR also adds the support for using native eth as bonds, enabled by allowing
_bondTokento be aaddress(0)