-
Notifications
You must be signed in to change notification settings - Fork 33
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
System router: flexible optimistic period, multicall #182
Conversation
Codecov Report
@@ Coverage Diff @@
## master #182 +/- ##
===================================================
+ Coverage 50.72043% 51.13886% +0.41843%
===================================================
Files 190 191 +1
Lines 8606 8649 +43
Branches 82 87 +5
===================================================
+ Hits 4365 4423 +58
+ Misses 3818 3803 -15
Partials 423 423
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Finished a first pass review. Going to finish up a few other things then go through this again
LGTM |
Description
SystemRouter
contract is revisited to introduce the chain agnostic system calls. This also includes the ability to batch such calls in a package, where either all calls succeed or none do (multicall). Multicalls are currently only possible to a single destination chain, otherwise the execution invariant doesn't hold.System call: sending
Any system contract is able to call another system contract on any chain without knowing its address. All that's needed for a call is:
This is possible by
SystemRouter
storing all system addresses for the chain where it's deployed and sending system messages to the system routers on remote chains (which will handle the routing on destination chain).System call: receiving
Regardless on what chain the recipient is located, when the call is routed to them, they will receive the data payload with following appended information:
sanguine/packages/contracts-core/contracts/system/SystemRouter.sol
Lines 230 to 245 in 3d61027
sanguine/packages/contracts-core/contracts/system/SystemRouter.sol
Lines 175 to 186 in 3d61027
Using these three parameters, a system contract can enforce any types of checks for external functions, e.g.
sanguine/packages/contracts-core/contracts/system/SystemContract.sol
Lines 55 to 64 in 3d61027
TODO
Metadata: