-
Notifications
You must be signed in to change notification settings - Fork 5
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
[1.0.3] Review: Alternative implementation of handling forking #968
[1.0.3] Review: Alternative implementation of handling forking #968
Conversation
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.
Thanks! It does not need an extra look up the block's transaction list. Please go ahead to merge it into my branch. I will remove block_has_trx()
and add additional tests.
} else if (std::holds_alternative<lib_entry_v0>(entry)) { | ||
auto lib = std::get<lib_entry_v0>(entry).lib; | ||
if (trx_entries > 0 && lib >= trx_block_num) { | ||
return trx_block_num; | ||
if (!trx_block_nums.empty() && lib >= *(--trx_block_nums.end())) { |
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.
Add a comment saying *(--trx_block_nums.end()) is the highest block number as trx_block_nums is a set of uint32_t.
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.
Or I can add the comments myself after you merge.
|
||
// initial block forks out | ||
sp.append(forked_block_trace); | ||
sp.append(forked_block_trace); // block 1 | ||
sp.append_trx_ids(forked_block_trxs_entry); // block 1 |
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.
Thanks for this. I missed it.
Note:start |
I was concerned about the performance of
block_has_trx
.Review comments for #966