Skip to content
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

Conversation

DeividasK
Copy link
Collaborator

No description provided.

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)
Copy link
Collaborator Author

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() {}
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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...

Copy link
Contributor

@bolekk bolekk left a 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
@DeividasK DeividasK changed the title [KS-331] SPIKE: investigate a single contract serving as router and forwarder [KS-331] Single contract serving as router and forwarder Jun 13, 2024
@DeividasK DeividasK marked this pull request as ready for review June 13, 2024 10:24
@DeividasK DeividasK requested review from patrick-dowell and a team as code owners June 13, 2024 10:24
}

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 │
Copy link
Contributor

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)

Copy link
Collaborator Author

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.

@DeividasK DeividasK added this pull request to the merge queue Jun 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 14, 2024
@bolekk bolekk added this pull request to the merge queue Jun 14, 2024
Merged via the queue into develop with commit 95502ad Jun 14, 2024
106 checks passed
@bolekk bolekk deleted the KS-331-spike-investigate-a-single-contract-serving-as-router-and-forwarder branch June 14, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants