Skip to content
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

SHiP: Auto disable-replay-opts instead of exiting with error #1467

Merged
merged 8 commits into from
Jul 31, 2023

Conversation

heifner
Copy link
Member

@heifner heifner commented Jul 28, 2023

  • Modified state_history_plugin to automatically set disable-replay-opts=true instead of indicating an error and exiting.
  • Modified the requirement for disable-replay-opts=true only when chain-state-history=true is enabled as it is not needed if state_history_plugin is running with only trace-history=true enabled.
  • Modified state history serialization to not require chainbase when serializing transaction trace data. This verifies that disable-replay-opts=true is not needed if only logging transaction trace data.
  • Allow disable-replay-opts to be set in config.ini instead of only on the command line.

Resolves #1403

@heifner heifner added the OCI Work exclusive to OCI team label Jul 28, 2023
plugins/chain_plugin/chain_plugin.cpp Show resolved Hide resolved
@@ -35,11 +49,27 @@ struct history_context_wrapper {
};

template <typename P, typename T>
history_context_wrapper<std::decay_t<P>, std::decay_t<T>> make_history_context_wrapper(const chainbase::database& db,
const P& context, const T& obj) {
struct history_context_wrapper_stateless {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I would have made history_context_wrapper_stateless a base of history_context_wrapper.
the advantage is that the functions accepting a history_context_wrapper_stateless& would also take a history_context_wrapper&, although I'm not sure if it would have helped a lot.

Copy link
Member

@linh2931 linh2931 left a comment

Choose a reason for hiding this comment

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

Serialization has undergone significant changes. Do we have sufficient existing tests to cover the changes?

libraries/chain/controller.cpp Outdated Show resolved Hide resolved
plugins/chain_plugin/chain_plugin.cpp Show resolved Hide resolved
@heifner
Copy link
Member Author

heifner commented Jul 31, 2023

Serialization has undergone significant changes. Do we have sufficient existing tests to cover the changes?

We have no unittests and very little integration tests that would test any of the serialization logic. Before 3.2 we had no tests for SHiP. We have separate issues for adding tests for SHiP. I think creating tests for serialization is out of scope for this PR.

@heifner heifner merged commit 72ccfd5 into main Jul 31, 2023
26 checks passed
@heifner heifner deleted the GH-1403-ship-opt branch July 31, 2023 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable Replay Opts by default if statehist plugin enabled
3 participants