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

Add application option to disable notify_remove_create parameter in set_subscribe_callback API #725

Merged
merged 7 commits into from
Mar 18, 2018

Conversation

abitmore
Copy link
Member

@abitmore abitmore commented Mar 15, 2018

Temporarily commented out for future improvement.

Update:
Added an "enable-subscribe-to-all" option in application.cpp, default value is false. Force-pushed.

@pmconrad
Copy link
Contributor

I suppose this breaks things for some API users. What's the reason for the change?

@abitmore
Copy link
Member Author

abitmore commented Mar 15, 2018

I guess nobody is using this flag except probably the block chain explorers and arbitrage bots. When it's set to true, witness node (API server) will push every new object and ID of every removed object to the client, no matter whether they're subscribed to, which IMHO can be used to DDoS public API servers.

@abitmore
Copy link
Member Author

Perhaps better if have a startup option for it, disabled by default?

@pmconrad
Copy link
Contributor

If it's not being used then there will no performance gain. If it is in use this change will break things.

Making it configurable would be ok IMO.

@abitmore abitmore changed the title Ignore notify_remove_create parameter in set_subscribe_callback API Add application option to disable notify_remove_create parameter in set_subscribe_callback API Mar 17, 2018
@@ -404,6 +405,9 @@ namespace detail {
_force_validate = true;
}

if( _options->count("enable-subscribe-to-all") )
_app_options.enable_subscribe_to_all = _options->at("enable-subscribe-to-all").as<bool>();
Copy link
Member Author

Choose a reason for hiding this comment

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

@pmconrad perhaps this as call need to be revised along with other changes in #714?

Copy link
Contributor

Choose a reason for hiding this comment

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

This as() is not a variant::as(), it's from boost::program_options. I don't think we need to sanitize that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants