Skip to content

SC: Implement new sync call host functions #346

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

Merged
merged 13 commits into from
Jun 12, 2025
Merged

Conversation

linh2931
Copy link
Member

Change Description

This is the first PR of sync call support in CDT. Its purpose is to build the basic infrastructure and get things moving. More changes are in future PRs.

The PR implements the new host functions call(), get_call_return_value(), get_call_data(), and set_call_return_value(). A simple test shows call() and get_call_return_value() can get into nodeos host side and return back results. get_call_data() and set_call_return_value() cannot be tested at the moment.

Resolves #342

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

@linh2931 linh2931 requested review from spoonincode and heifner April 30, 2025 19:49
@linh2931 linh2931 linked an issue Apr 30, 2025 that may be closed by this pull request
*
* @tparam T - Type of call data, must be serializable by `pack(...)`
* @param receiver - The name of the account this call is intended for
* @param flags - The flags
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 *  @param flags - flags (bits) representing blockchain level requirements about
 *                 the call. Currently LSB bit indicates read-only. All other bits
 *                 are reserved to be 0

Although, since this is suppose to be an easy to use wrapper. I think this should just be a bool read_only. And call can create the correct flags.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call class is low level. I chose to keep it closer to the host function parameters, while make the to-be-implemented wrapper to take read_only argument.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think about it more and agree with you. I have changed to take in read_only and another flag no_op_if_receiver_not_support_sync_call as parameters. Thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the comment please.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed the bools to enums in #351. I have updated the comment there.

@linh2931 linh2931 merged commit 07c2fec into sync_call Jun 12, 2025
7 checks passed
@linh2931 linh2931 deleted the sync_call_host_funcs branch June 12, 2025 11:35
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.

SC: Support new host functions
4 participants