-
Notifications
You must be signed in to change notification settings - Fork 90
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
connectors-gateway: Add gateway pallet #1456
Conversation
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.
First of all, thanks for splitting the PR!
The review was quite easy thanks that everything is very well organized & clean @cdamian! 🎉 Left some comments
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 love how well structured and clean your work is! Thanks a lot for splitting the PR which made this review much easier! 🫶
Apart from a few praising comments, I only have a few nits which could also be ignored.
|
||
parameter_types! { | ||
// TODO(cdamian): Double-check these. | ||
pub const MaxIncomingMessageSize: u32 = 1024; |
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.
How can this value be verified? Max PoV size is 5 * 1024 * 1024.
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 thinking that we can have something similar to MaxEncodedLen
for this purpose. Then, whatever implements the (Connectors) Codec
trait, would have a known max size when encoded. WDYT?
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.
Implicitly, we already have a MaxEncodedLen
for Connectors messages since we have our custom Codec
implementation. Of course, we are missing the trait implementation at this point.
AFAICS, the max encoded messages would be ExecutedCollectRedeem
and ExecutedCollectInvest
with 8+16+32+16+16+16+16 = 120
bytes. However, these should only be outgoing. For incoming, the largest should be TransferTrancheTokens
with 88 bytes.
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.
As agreed, let's stick to the hard-coded value for the time being. Should I create a follow-up issue for this so we can investigate at a later 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.
I think we should have a MaxEncodedLen
impl for the types implementing connectors::Codec
f4872c8
to
f1ed2f3
Compare
@cdamian, I've seen you have answered all comments except two that are just hidden because Github hides some in large conversations. Only double-check that you know about them. |
I always forget about those hidden comments... should all be addressed by now. |
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! Really like it!
5acba49
to
1fd8c5c
Compare
1fd8c5c
to
2d6056c
Compare
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! Thanks for applying all the changes 🚀
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
) -> DispatchResult { | ||
T::AdminOrigin::ensure_origin(origin)?; | ||
|
||
ensure!(domain != Domain::Centrifuge, Error::<T>::DomainNotSupported); |
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 guess we will remove this check as soon as we wrap up subsequent PRs right?
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.
This will stay, we can only remove this if we do some refactoring that gives us an associated type that we know is not a Centrifuge domain.
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 could have
type Domain: Member + Parameter;
type LocalDomain: Get<Domain>;
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.
Nothing relevant.
) -> DispatchResult { | ||
T::AdminOrigin::ensure_origin(origin)?; | ||
|
||
ensure!(domain != Domain::Centrifuge, Error::<T>::DomainNotSupported); |
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 could have
type Domain: Member + Parameter;
type LocalDomain: Get<Domain>;
|
||
parameter_types! { | ||
// TODO(cdamian): Double-check these. | ||
pub const MaxIncomingMessageSize: u32 = 1024; |
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 think we should have a MaxEncodedLen
impl for the types implementing connectors::Codec
Description
Part 1 of #1376
NOTE - given the dependencies in the original PR, the integration tests will be added in a following PR once all the other parts like the Ethereum Transaction pallet or the Connectors Gateway routers are added.
Changes and Descriptions
Connectors Gateway
pallet.Checklist: