-
Notifications
You must be signed in to change notification settings - Fork 14
Feat: Layerzero oracle #136
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: main
Are you sure you want to change the base?
Feat: Layerzero oracle #136
Conversation
5269150 to
2043642
Compare
|
|
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Fixed CI, code not yet reviewed @haythemsellami |
reednaa
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.
Code looks fine. One thing to consider regarding LayerZero (and similar oracles in the future) is what to do about the required nature of configured oracle security?
Should we allow the owner to choose validators or how do we best let the intent configure them?
LayerZero is particularly hard since (I may be wrong) we can't embed configuration at flight time.
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.
@haythemsellami After discussing this with OZ, we have decided that it is required that oracle configuration needs to be possible at deploy time. That means the constructor needs to be able to call setConfig (I believe, it is some time since I last interacted with LayerZero so specific function names may be off).
One thing that is notable regarding this is that "equal" configs does not result in equal oracle addresses and LayerZero DVNs have different addresses on different chains.
This means there should also be a way to expose the config used on construction. I believe a transparent function to LZ's getConfig is fine (if possible).
- Config should be setable for both DVNs and executors though I believe it may be possible to do with a single call. (If I recall correctly, Executor config is not possible through options at flight time since correct executor is checked on receive)
- A sane default (LZ's default) should be possible to set if not config is provided.
- No way to modify the config post deployment should be possible.
LZ docs: https://docs.layerzero.network/v2/developers/evm/configuration/dvn-executor-config
79d1f7b to
97877ee
Compare
Implemented the above. Re a default config, I think if no custom config is set, by default a fallback one is used https://docs.layerzero.network/v2/concepts/modular-security/security-stack-dvns#default-configuration. |
Description
This PR implements a LayerZero V2-based oracle for cross-chain message attestation.
Oracle Implementation:
Public Interface:
Design Decisions:
Related Issues
Fix #42.
Third-Party Integration Checklist
foundry.tomlsrc/oracles/[oracle-type]/external/[protocol-name]/Additional Notes
MinimalOAppcontract is a minimal/succinct version of Layerzero-v2 OApp contracts, it remove the ownership of the contract as well as keeping track of peers.