-
Notifications
You must be signed in to change notification settings - Fork 104
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
SNO-565: Make parachain relayers use Gateway contract #888
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## proxy-contracts #888 +/- ##
===================================================
+ Coverage 66.33% 67.02% +0.68%
===================================================
Files 43 42 -1
Lines 1732 1592 -140
Branches 70 70
===================================================
- Hits 1149 1067 -82
+ Misses 564 506 -58
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
relayer/contracts/generate.go
Outdated
@@ -1,6 +1,5 @@ | |||
//go:generate bash -c "jq .abi ../../core/packages/contracts/out/OpaqueProof.sol/OpaqueProof.json | abigen --abi - --type OpaqueProof --pkg contracts --out opaque_proof.go" | |||
//go:generate bash -c "jq .abi ../../core/packages/contracts/out/BeefyClient.sol/BeefyClient.json | abigen --abi - --type BeefyClient --pkg contracts --out beefy_client.go" | |||
//go:generate bash -c "jq .abi ../../core/packages/contracts/out/InboundQueue.sol/InboundQueue.json | abigen --abi - --type InboundQueue --pkg contracts --out inbound_queue.go" | |||
//go:generate bash -c "jq .abi ../../core/packages/contracts/out/OutboundQueue.sol/OutboundQueue.json | abigen --abi - --type OutboundQueue --pkg contracts --out outbound_queue.go" | |||
//go:generate bash -c "jq .abi ../../core/packages/contracts/out/Gateway.sol/Gateway.json | abigen --abi - --type Gateway --pkg contracts --out gateway.go" |
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.
Actually, we should be generating bindings for contracts/src/interfaces/IGateway.sol
.
This is how GatewayProxy.sol
, Gateway.sol
, and IGateway.sol
all relate to each other:
GatewayProxy.sol
: The contract at the "front of the house" that users interact with. This is the proxy contract.Gateway.sol
:GatewayProxy.sol
forwards messages to this implementation or "logic" contract.IGateway.sol
: The public API exposed by the proxy & implementation contract.
When configuring the relayer, make sure to use the address of GatewayProxy.sol
as the gateway's 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.
Right, will use the interface. We're using the proxy address 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.
I've kept the name Gateway
for the Go bindings, even though they're generated from the IGateway interface. Seems sensible as the interface is the only thing we'll use from the relayers.
@@ -9,17 +9,18 @@ type Config struct { | |||
Sink SinkConfig `mapstructure:"sink"` | |||
} | |||
|
|||
// TODO: check whether ChannelID should be uint32 (as in the parachain) or big.Int (uint256, as in the Gateway contract) |
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.
@vgeddes How big are the channelIDs?
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.
Guess uint32 as ParaId should be enough. But remember Aidan mentioned last time we'll probably allow multiple channels for each Parachain?
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.
Ah right, we can expand the channel id on Polkadot to get multiple channels per parachain
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.
LGTM!
Opening as a PR into Vincent's branch as I need those changes as a base.
Fixed the parachain build failures on the base branch in #889.
We don't have an extrinsic that sends messages yet, so can't fully test this yet. I've made sure that the relayer compiles and launches without crashing. The execution relayer still crashes on startup for comparison.
SNO-565