Skip to content

Conversation

@zeusoo001
Copy link
Contributor

What does this PR do?
Optimize event service to obtain transaction information.

Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

Copy link
Contributor

@yanghang8612 yanghang8612 left a comment

Choose a reason for hiding this comment

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

LGTM

endNum = manager.getDynamicPropertiesStore().getLatestSolidifiedBlockNum();
}
initEventService(manager.getChainBaseManager().getBlockIdByNum(endNum));
long startNum = endNum == 0 ? 0 : endNum - 1;

Choose a reason for hiding this comment

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

If now solidifiedBlockNum is 100, but the startSyncBlockNum in config is 1000, it still start writing events from 99?

Copy link
Contributor

@xxo1shine xxo1shine Sep 15, 2025

Choose a reason for hiding this comment

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

Will write from 100, and you need to configure startSyncBlockNum reasonably.

@kuny0707 kuny0707 moved this to In Review in java-tron Sep 15, 2025
@kuny0707 kuny0707 linked an issue Sep 15, 2025 that may be closed by this pull request
for (int i = 0; i < block.getTransactions().size(); i++) {
Protocol.Transaction tx = block.getInstance().getTransactions(i);
Protocol.TransactionInfo txInfo = result.getInstance().getTransactioninfo(i);
Protocol.TransactionInfo txInfo = list.getTransactionInfo(i);
Copy link
Contributor

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?

Copy link
Contributor

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.

@kuny0707 kuny0707 merged commit e0d167f into tronprotocol:release_v4.8.1 Sep 15, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in java-tron Sep 15, 2025
halibobo1205 pushed a commit to halibobo1205/java-tron that referenced this pull request Oct 14, 2025
…ronprotocol#6443)

* feat(event): solve the problem of concurrent access to a single SR
* feat(event): solve the concurrency problem of single SR obtaining solid ID
@zeusoo001 zeusoo001 deleted the event-get3 branch November 5, 2025 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

synchronizing history blocks events failed

7 participants