-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
src: dynamic block sync size #9494
base: master
Are you sure you want to change the base?
src: dynamic block sync size #9494
Conversation
5b05971
to
ce38fde
Compare
Same content. Only removed white-space changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! It was helpful for me to start reviewing out from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on stressnet and mainnet
ce38fde
to
2ce35d9
Compare
2ce35d9
to
03d0dce
Compare
All comments have been addressed. Once discussion finished, I will update |
03d0dce
to
2195b6a
Compare
Updated to most latest |
Co-authored-by: nahuhh
2195b6a
to
5459934
Compare
Rebased to updated master. Now CI should run without any issue. |
MINFO("Last " << number_of_blocks | ||
<< " blocks median size is " << median_weight | ||
<< " bytes and the max average blocksize in the queue is " << average_blocksize_of_biggest_batch << " bytes"); | ||
uint64_t projected_blocksize = (average_blocksize_of_biggest_batch > median_weight) ? average_blocksize_of_biggest_batch : median_weight; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint64_t projected_blocksize = (average_blocksize_of_biggest_batch > median_weight) ? average_blocksize_of_biggest_batch : median_weight; | |
uint64_t projected_blocksize = (average_blocksize_of_biggest_batch > median_weight) ? average_blocksize_of_biggest_batch : median_weight; | |
uint64_t blocks_huge_threshold = (batch_max_weight / 2); |
else if (projected_blocksize >= batch_max_weight) { | ||
res = 1; | ||
MINFO("blocks are projected to surpass " << batch_max_weight << " bytes, syncing just a single block in next batch"); | ||
} | ||
else if (projected_blocksize > BLOCKS_HUGE_THRESHOLD_SIZE) { | ||
res = 1; | ||
MINFO("blocks are huge, sync just a single block in next batch"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else if (projected_blocksize >= batch_max_weight) { | |
res = 1; | |
MINFO("blocks are projected to surpass " << batch_max_weight << " bytes, syncing just a single block in next batch"); | |
} | |
else if (projected_blocksize > BLOCKS_HUGE_THRESHOLD_SIZE) { | |
res = 1; | |
MINFO("blocks are huge, sync just a single block in next batch"); | |
else if (projected_blocksize >= blocks_huge_threshold) { | |
res = 1; | |
MINFO("blocks are projected to surpass 50% of " << batch_max_weight << " bytes, syncing just a single block in next batch"); | |
} |
condense
src/cryptonote_config.h
Outdated
#define BLOCKS_MEDIAN_WINDOW 100 //by default, compute median weights of last 100 blocks | ||
#define BATCH_MAX_WEIGHT 20 //by default, maximum size of batch in [mB] | ||
#define BATCH_MAX_ALLOWED_WEIGHT 50 //maximum allowed size of batch in [mB] | ||
#define BLOCKS_HUGE_THRESHOLD_SIZE ((BATCH_MAX_WEIGHT * 1000000) / 2) //blocks that we consider huge [B] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define BLOCKS_HUGE_THRESHOLD_SIZE ((BATCH_MAX_WEIGHT * 1000000) / 2) //blocks that we consider huge [B] |
swapped here
#9494 (comment)
src/cryptonote_config.h
Outdated
@@ -98,6 +98,10 @@ | |||
#define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT_PRE_V4 100 //by default, blocks count in blocks downloading | |||
#define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT 20 //by default, blocks count in blocks downloading | |||
#define BLOCKS_SYNCHRONIZING_MAX_COUNT 2048 //must be a power of 2, greater than 128, equal to SEEDHASH_EPOCH_BLOCKS | |||
#define BLOCKS_MEDIAN_WINDOW 100 //by default, compute median weights of last 100 blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define BLOCKS_MEDIAN_WINDOW 100 //by default, compute median weights of last 100 blocks | |
#define BLOCKS_MEDIAN_WINDOW CRYPTONOTE_REWARD_BLOCKS_WINDOW //by default, compute median weights of last 100 blocks (CRYPTONOTE_REWARD_BLOCKS_WINDOW) |
@@ -112,6 +113,15 @@ namespace cryptonote | |||
void log_connections(); | |||
std::list<connection_info> get_connections(); | |||
const block_queue &get_block_queue() const { return m_block_queue; } | |||
const std::uint64_t max_average_of_blocksize_in_queue() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const std::uint64_t max_average_of_blocksize_in_queue() { | |
std::uint64_t max_average_of_blocksize_in_queue() { |
Warning in build log
6315667
to
03bcd6f
Compare
Co-authored-by: nahuhh
03bcd6f
to
fd06f00
Compare
No description provided.