-
Notifications
You must be signed in to change notification settings - Fork 2
imp: remove transient storage for payload hash and pass payload bytes instead #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: add-hyperlane-adapter
Are you sure you want to change the base?
Conversation
…other method that passes the payload bytes directly instead of the hash that's retrieved from the transient storage
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
# Conflicts: # contracts/script/DeployOrbiterGateway.s.sol # contracts/test/TestOrbiterHypERC20.t.sol
|
E2E tests will be fixed on the base branch, has nothing to do with the contracts implementation here. |
0xstepit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job here @MalteHerrmann! Added a couple of comments but the code looks great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should remember to add to codespell for doc the entire doc folder!
|
|
||
| # ------------------------------ | ||
| # Testing | ||
| # Linting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we align the section heading with the main Makefile 🙏
| /// bridging mechanisms (e.g. IBC, CCTP). | ||
| /// | ||
| /// TODO: make upgradeable | ||
| /// TODO: make upgradeable? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should move it to a linear ticket
| /// @notice Creates a new instance of the OrbiterGateway contract. | ||
| /// @param _domain The Hyperlane domain of the Noble network, which is the destination domain for Orbiter transfers. | ||
| constructor(uint32 _domain) { | ||
| destinationDomain = _domain; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we passing it instead of setting it as a const? For mainnet and testnet?
| /// @param _amount The amount of tokens to transfer. | ||
| /// @param _payload The payload passed along with the asset transfer. | ||
| /// @return messageID The ID of the dispatched Hyperlane message. | ||
| function sendForwardedTransfer( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In CCTP we call it WithOrbiterPayload. It would be nice to have parity
| // We only want to handle transfers with a non-zero payload. | ||
| if (_payload.length == 0) { | ||
| revert EmptyPayload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't better to have this check in the public method? This way we'd avoid a bunch of useless computation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mailbox, Messange, and ITransparentUpgradableProxy are not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are variables in the constant section: DECIMALS, SCALE, ...
|
I would also add the formatting config for contracts, in the CCTP ones I have this: [fmt]
multiline_func_header = "attributes_first"
line_length = 100
number_underscore = "thousands"
bracket_spacing = true
wrap_comments = true |
This PR adjusts the contract implementation to avoid storing a payload hash in transient storage and then retrieving it within
_transferRemotebut instead is adding a new external methodtransferRemoteWithPayloadthat is enabling to pass the full payload (or a compressed version) as a function argument.