weixin_39995280 2020-11-30 05:27
浏览 0

Serialize ops in account history objects

We need to serialize ops to get account history plugin to work with the new DB architecture: - There's no way to propagate a custom allocator through static_variant - Thus, static_variant is unusable from the database if any member types have fields that require dynamic memory allocation - As a consequence, we can no longer store operation in any database object

The "fix" is to serialize history objects.

该提问来源于开源项目:steemit/steem

  • 写回答

5条回答 默认 最新

  • weixin_39995280 2020-11-30 05:27
    关注

    A fair amount of refactoring is needed to support this change.

    Cleanup of where things are located: - Move history objects to account_history_plugin - Move impacted.hpp from app to account_history_plugin - Update other plugins that reference impacted.hpp to require account_history_plugin at build time

    Cleanup of notification API: - Some plugins care about deserialized ops - Therefore, object passed to pre/post apply hooks should be deserialized - account_history_plugin serializes objects - Therefore we need a new non-database type for storing unserialized operations. Call this type operation_notification

    Since we're breaking the hook API anyway, I'll also modify it to have operation_notification be passed into both pre- and post-apply, instead of the current behavior (which is returning from pre-apply). This should avoid some unnecessary copying. For further savings, since it's no longer a DB object we can store a reference to the operation in the object.

    评论

报告相同问题?