-
Notifications
You must be signed in to change notification settings - Fork 88
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 Ethereum Transaction pallet #1460
connectors-gateway: Add Ethereum Transaction pallet #1460
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.
I'm not the best to test this logic but all changes LGTM! 🙌🏻
Everything is quite clean so most of my comments are questions to myself or nitpick things.
Good job!
value: U256, | ||
gas_price: U256, | ||
gas_limit: U256, | ||
) -> DispatchResultWithPostInfo { |
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.
NOTE - this was built with the idea that the caller of this function would be the one that will take of charging the according fees based on the returned weight. This was an ongoing discussion a few weeks back and I think we should get back to it and decide how we want to tackle this.
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.
Agreed. We can add an additional parameter if we want to let the system pay I think!
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.
Again, I had a great reviewing experience and overall looks good! I have a few minor questions before I feel good with hitting the approval. Apart from that, some praise and as always a few nitpicks which can totally be ignored.
|
||
fn map_evm_error(e: ExitError) -> DispatchError { | ||
match e { | ||
ExitError::StackUnderflow => DispatchError::Other("stack underflow"), |
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.
Do we want all of these errors to really be DispatchError::Other
and not pallet::<T>::Error
? Asking because I recently had to find the cause of something that threw DispatchError::Other
and unfortunately, Polkadot Js Apps omits the message so it was like finding the needle in a stack of hay. Not sure if it is completely omitted from the metadata. If so, we should not throw any of these actually.
Here's proof of my statement. I tried to invest without having permissions which throws DispatchError::Other("Account does not have the TrancheInvestor permission.")
:
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.
Hmm, initially I added this DispatchError
because I wasn't able to debug test failures but completely forgot about the "outside". Awesome point, will definitely change this, thank you!
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.
Done. I'm not passing the error message in the case of ExitError::Other(Cov<'static, str>)
though. It seems that might be a bit tricky to do if we really want to, 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.
LGTM! Thanks for addressing 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.
Thanks for putting sweat into my nitpicks! LGTM 🚀
cc @branan |
cb8009e
to
76619bd
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.
Re-approved! Although would be awesome to have @branan eyes on this.
76619bd
to
daaf0b1
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.
Looks good!
value: U256, | ||
gas_price: U256, | ||
gas_limit: U256, | ||
) -> DispatchResultWithPostInfo { |
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.
Agreed. We can add an additional parameter if we want to let the system pay I think!
|
||
let transaction = TransactionV2::Legacy(LegacyTransaction { | ||
nonce, | ||
gas_price, | ||
gas_limit, | ||
action: TransactionAction::Call(to), | ||
value, | ||
input: data.into(), | ||
signature, |
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.
Using this we can never get a Create
call 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.
Yes, that is correct.
Description
Part 2 of - #1376
The pallet added in this PR will be used by the Axelar EVM gateway router which will be added in a following PR.
An example of how this pallet is used can be found here
Changes and Descriptions
Checklist: