Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

yield_function for abi_serializer - #8820

Merged
heifner merged 5 commits into
developfrom
trace-yield-dev
Mar 16, 2020
Merged

heifner merged 5 commits into
developfrom
trace-yield-dev

Conversation

@heifner

@heifner heifner commented Mar 14, 2020

Copy link
Copy Markdown
Contributor

Change Description

  • Modify abi_serializer to use a yield function instead of a deadline and recursion depth check.
  • This PR strives to provide the same functionality while providing a mechanism for future abi_serializer interruption based on other criteria.

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

Comment thread libraries/chain/abi_serializer.cpp Outdated
auto pack_unpack() {
return std::make_pair<abi_serializer::unpack_function, abi_serializer::pack_function>(
[]( fc::datastream<const char*>& stream, bool is_array, bool is_optional, const fc::time_point& deadline) -> fc::variant {
[]( fc::datastream<const char*>& stream, bool is_array, bool is_optional, const abi_serializer::yield_function_t& yield) -> fc::variant {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

better to define a function type in the header file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't follow. pack_function & unpack_function are both defined in abi_serializer.hpp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I mean no need to add "-> fc::variant" in parameter

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed.

Comment thread plugins/chain_plugin/chain_plugin.cpp Resolved
Comment thread plugins/chain_plugin/chain_plugin.cpp Resolved
Comment thread plugins/chain_plugin/chain_plugin.cpp Resolved
abis.add_specialized_unpack_pack( "abi_def",
std::make_pair<abi_serializer::unpack_function, abi_serializer::pack_function>(
[]( fc::datastream<const char*>& stream, bool is_array, bool is_optional, const fc::time_point& deadline ) -> fc::variant {
[]( fc::datastream<const char*>& stream, bool is_array, bool is_optional, const abi_serializer::yield_function_t& yield ) -> fc::variant {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above, better not to define return type in function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed

@heifner
heifner requested a review from allenhan2 March 16, 2020 17:06
@heifner
heifner merged commit abfda36 into develop Mar 16, 2020
@heifner
heifner deleted the trace-yield-dev branch March 16, 2020 20:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants