-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fet(event): optimize event service to obtain transaction information #6443
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,7 +54,10 @@ private void syncEvent() { | |
| try { | ||
| long tmp = instance.getStartSyncBlockNum(); | ||
| long endNum = manager.getDynamicPropertiesStore().getLatestSolidifiedBlockNum(); | ||
| while (tmp <= endNum) { | ||
| while (tmp < endNum) { | ||
| if (thread.isInterrupted()) { | ||
| throw new InterruptedException(); | ||
| } | ||
| if (instance.isUseNativeQueue()) { | ||
| Thread.sleep(20); | ||
| } else if (instance.isBusy()) { | ||
|
|
@@ -67,7 +70,8 @@ private void syncEvent() { | |
| tmp++; | ||
| endNum = manager.getDynamicPropertiesStore().getLatestSolidifiedBlockNum(); | ||
| } | ||
| initEventService(manager.getChainBaseManager().getBlockIdByNum(endNum)); | ||
| long startNum = endNum == 0 ? 0 : endNum - 1; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If now solidifiedBlockNum is 100, but the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will write from 100, and you need to configure |
||
| initEventService(manager.getChainBaseManager().getBlockIdByNum(startNum)); | ||
| } catch (InterruptedException e1) { | ||
| logger.warn("History event service interrupted."); | ||
| Thread.currentThread().interrupt(); | ||
|
|
||
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.
if list get from getTransactionInfoByBlockNum is empty, or list.getTransactionInfoCount() != block.getTransactions().size(), is there any problem?
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.
No problem, this situation does not exist, otherwise the data is inconsistent.