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

do not apply transaction optimizations on light-nodes when speculating #5415

Merged
merged 2 commits into from
Aug 28, 2018

Conversation

wanderingbort
Copy link
Contributor

fixed an issue where block status was not taken into account when determining whether or not to skip some expensive checks. As a result light validation nodes would not apply those checks even when speculatively executing new transactions (which are not signed by producers).

Also refactored common logic while maintaining the 2 config/parameters that control different sets of optimizations

resolves #5408

fixed an issue where block status was not taken into account when determining whether or not to skip some expensive checks.  As a result light validation nodes would not apply those checks even when speculatively executing new transactions (which are not signed by producers).

Also refactored common logic while maintaining the 2 config/parameters that control different sets of optimizations

resolves #5408
@wanderingbort wanderingbort requested a review from heifner August 24, 2018 14:00
&& !my->conf.force_all_checks
&& !my->in_trx_requiring_checks;
// in a pending irreversible or previously validated block and we have forcing all checks
bool consider_skipping_on_replay = (pb_status == block_status::irreversible || pb_status == block_status::validated) && !replay_opts_disabled_by_policy;
Copy link
Contributor

Choose a reason for hiding this comment

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

controller has replaying flag. Seems like conf.disable_replay_optsshould be tied to it as block_status::validated could happen on switching forks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

disable replay opts was added around the same time that light validation was and it intentionally covers replays due to forks as those are also validated nodes.

return consider_skipping
&& !my->conf.disable_replay_opts
&& !my->in_trx_requiring_checks;
light_validation_allowed(my->conf.disable_replay_opts);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we should not allow:
force-all-checks = true
and
disable-replay-ops = true
in chain_plugin.cpp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For historical reasons they cover disparate sets of optimizations. When we put the feature in, we decided that we would maintain the difference. We shouldn't change those configuration expectations on a patch release, however, I agree that in a future version we may want to make force-all-checks authoritative over disable-replay-opts



bool controller::skip_auth_check() const {
return light_validation_allowed(my->conf.force_all_checks);
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like force-all-checks should override light validation mode and override disable-replay-opts or better yet don't allow both to be specified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is for historical reasons, "force-all-checks" was something specifically tied to replay just replay. The last feature release did bend this a little bit to include the same set of features for replays-due-to forks.

@heifner heifner added this to the Version 1.2.3 milestone Aug 28, 2018
@heifner heifner merged commit 8399f32 into release/1.2.x Aug 28, 2018
@heifner heifner deleted the feature/5408-fix-light-validation-speculation branch August 28, 2018 20:04
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.

3 participants