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

Reduce the comment interval from 20 seconds to 3 seconds #2483

Merged
merged 5 commits into from
May 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion libraries/chain/steem_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,15 @@ void comment_evaluator::do_apply( const comment_operation& o )
FC_ASSERT( _db.calculate_discussion_payout_time( *parent ) != fc::time_point_sec::maximum(), "Discussion is frozen." );
}

if( _db.has_hardfork( STEEM_HARDFORK_0_12__176 ) )
FC_TODO( "Cleanup this logic after HF 20. Old ops don't need to check pre-hf20 times." )
if( _db.has_hardfork( STEEM_HARDFORK_0_20__2019 ) )
{
if( o.parent_author == STEEM_ROOT_POST_PARENT )
FC_ASSERT( ( now - auth.last_root_post ) > STEEM_MIN_ROOT_COMMENT_INTERVAL, "You may only post once every 5 minutes.", ("now",now)("last_root_post", auth.last_root_post) );
else
FC_ASSERT( (now - auth.last_post) >= STEEM_MIN_REPLY_INTERVAL_HF20, "You may only comment once every 3 seconds.", ("now",now)("auth.last_post",auth.last_post) );
}
else if( _db.has_hardfork( STEEM_HARDFORK_0_12__176 ) )
{
if( o.parent_author == STEEM_ROOT_POST_PARENT )
FC_ASSERT( ( now - auth.last_root_post ) > STEEM_MIN_ROOT_COMMENT_INTERVAL, "You may only post once every 5 minutes.", ("now",now)("last_root_post", auth.last_root_post) );
Expand Down
1 change: 1 addition & 0 deletions libraries/protocol/get_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ fc::variant_object get_config()
result["STEEM_MIN_CURATE_REWARD"] = STEEM_MIN_CURATE_REWARD;
result["STEEM_MIN_PERMLINK_LENGTH"] = STEEM_MIN_PERMLINK_LENGTH;
result["STEEM_MIN_REPLY_INTERVAL"] = STEEM_MIN_REPLY_INTERVAL;
result["STEEM_MIN_REPLY_INTERVAL_HF20"] = STEEM_MIN_REPLY_INTERVAL_HF20;
result["STEEM_MIN_ROOT_COMMENT_INTERVAL"] = STEEM_MIN_ROOT_COMMENT_INTERVAL;
result["STEEM_MIN_VOTE_INTERVAL_SEC"] = STEEM_MIN_VOTE_INTERVAL_SEC;
result["STEEM_MINER_ACCOUNT"] = STEEM_MINER_ACCOUNT;
Expand Down
1 change: 1 addition & 0 deletions libraries/protocol/hardfork.d/0_20.hf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define STEEM_HARDFORK_0_20__1782 (STEEM_HARDFORK_0_20)
#define STEEM_HARDFORK_0_20__1811 (STEEM_HARDFORK_0_20)
#define STEEM_HARDFORK_0_20__1815 (STEEM_HARDFORK_0_20)
#define STEEM_HARDFORK_0_20__2019 (STEEM_HARDFORK_0_20)

#define STEEM_HARDFORK_0_20_VERSION hardfork_version( 0, 20 )

Expand Down
1 change: 1 addition & 0 deletions libraries/protocol/include/steem/protocol/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@

#define STEEM_MIN_ROOT_COMMENT_INTERVAL (fc::seconds(60*5)) // 5 minutes
#define STEEM_MIN_REPLY_INTERVAL (fc::seconds(20)) // 20 seconds
#define STEEM_MIN_REPLY_INTERVAL_HF20 (fc::seconds(3)) // 3 seconds
#define STEEM_POST_AVERAGE_WINDOW (60*60*24u) // 1 day
#define STEEM_POST_WEIGHT_CONSTANT (uint64_t(4*STEEM_100_PERCENT) * (4*STEEM_100_PERCENT))// (4*STEEM_100_PERCENT) -> 2 posts per 1 days, average 1 every 12 hours

Expand Down