-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[KS-331] Single contract serving as router and forwarder #13528
[KS-331] Single contract serving as router and forwarder #13528
Conversation
KeystoneForwarder_ReportTest:test_Report_ConfigVersion() (gas: 1799858) | ||
KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReceiverInterfaceNotSupported() (gas: 123879) | ||
KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReceiverNotContract() (gas: 125372) | ||
KeystoneForwarder_ReportTest:test_Report_SuccessfulDelivery() (gas: 153887) |
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.
8k gas drop
uint256 internal constant MAX_ORACLES = 31; | ||
uint256 internal constant METADATA_LENGTH = 109; | ||
uint256 internal constant FORWARDER_METADATA_LENGTH = 45; | ||
uint256 internal constant SIGNATURE_LENGTH = 65; | ||
|
||
constructor() OwnerIsCreator() {} |
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 this supposed to keep a router address? I assumed we'll deploy two forwarders: one to act as the forwarder, one to act as the router
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.
I was imagining the initial deployment was one contract, and then when we need to update the functionality we transition from using the first contract as a forwarder to using it as a router.
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'd deploy only one contract initially. If/once we need to upgrade, we'd create a new contract with the updates, and that contract would store this contract's address as the router address.
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.
Having said this, we wouldn't be able to stop the current contract from sending. Let me make an update...
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.
Not a huge fan of the extra complexity but I get the 8k gas saving...
…tigate-a-single-contract-serving-as-router-and-forwarder # Conflicts: # core/gethwrappers/keystone/generation/generated-wrapper-dependency-versions-do-not-edit.txt
} | ||
|
||
uint256 internal constant MAX_ORACLES = 31; | ||
uint256 internal constant METADATA_LENGTH = 109; | ||
uint256 internal constant FORWARDER_METADATA_LENGTH = 45; | ||
uint256 internal constant SIGNATURE_LENGTH = 65; | ||
|
||
// ================================================================ | ||
// │ IRouter │ |
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.
IRouter -> Router? (This is the implementation I believe, not the interface)
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.
Will follow-up in rename.
No description provided.