-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[GatewayAPI] - Moving SuiJson to core and use it in the GatewayAPI #1652
Conversation
doc/src/build/json-rpc.md
Outdated
"params": [ | ||
"{{owner_address}}", | ||
"0000000000000000000000000000000000000002", | ||
"ObjectBasics", |
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 like GAS
is no longer valid, is ObjectBasics
the correct move module to use?
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 sure. But whats the error that you get?
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.
If we are trying to transfer a coin object, then the module needs to be Coin.
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 Coin::transfer is not an entry function.
So maybe this is just not a good example (transfer coin object).
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 have changed the example to use Coin::transfer_ instead, looks like we have a second transfer(_) in Coin move 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.
Everything here looks good to me! Just curious about that "GAS"~>"ObjectBasics" change. Maybe @lxfind will have more context here
Markdown LGTM. |
Ok so SuiJson doesn't support type arg yet..... I will fix that and start the review again, converting this PR back to draft |
1965a10
to
34e718a
Compare
Latest changes:
|
I have also started working on inferring function type args using the argument objects, I will finish that in another PR as it's not critical for DevNet release |
bac4855
to
5bb1480
Compare
This PR need more tech review 🙏 |
@patrickkuo this is great, thank you. LGTM but will wait for Xun to give feedback on the adapter concern. Is there a potential perf cost to using SuiJSON over raw bytes though? |
5bb1480
to
4550f1b
Compare
* fixed a bug in adapter.rs which prevent fn<T>(T) move function working. * Changed JSON-RPC server to accept TypeTagString instead of TypeTag struct
4550f1b
to
c3c186f
Compare
I think the perf impact is not huge (although I don't have perf data to back this up :) ), also the perf impact will be on the gateway, which doesn't affect the overall network perf, the SuiJsonValue -> move pure value conversion uses object data and package data, which is located on the gateway already, so we don't need to retrieve data over the network, unlike when this is done in the client side before this PR, which pulls packages and objects from gateway every time, I believe there will be a perf gain (between client and gateway) after the changes because of this. Also I think perf of gateway can be more relax as we can always load balance. |
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 like only concern was the adapter change, which has been addressed. So, ship it!
…1652) * moving SuiJson to core and use it in the GatewayAPI * * SuiJson now work with type arg * fixed a bug in adapter.rs which prevent fn<T>(T) move function working. * Changed JSON-RPC server to accept TypeTagString instead of TypeTag struct * update rpc spec * address PR comments * fixup after rebase
…1652) * moving SuiJson to core and use it in the GatewayAPI * * SuiJson now work with type arg * fixed a bug in adapter.rs which prevent fn<T>(T) move function working. * Changed JSON-RPC server to accept TypeTagString instead of TypeTag struct * update rpc spec * address PR comments * fixup after rebase
Summary
Move SuiJson to
sui_core
package and useSuiJsonValue
in GatewayAPImove_call
to simplify the input arg.Using SuiJsonValue instead of raw bytes inputs for move call args, making it more JSON-RPC friendly and remove needs of multiple rpc calls from client side to resolving the SuiJsonValue into pure args.