Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
1 issue found across 6 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="framework/src/main/java/org/tron/program/SolidityNode.java">
<violation number="1" location="framework/src/main/java/org/tron/program/SolidityNode.java:69">
P1: Shutdown can hang because stop flag is not honored inside the inner retry loops (`getBlockByNum` / `getLastSolidityBlockNum`).</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| TronError.ErrCode.SOLID_NODE_INIT); | ||
| @PreDestroy | ||
| private void shutdown() { | ||
| flag = false; |
There was a problem hiding this comment.
P1: Shutdown can hang because stop flag is not honored inside the inner retry loops (getBlockByNum / getLastSolidityBlockNum).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At framework/src/main/java/org/tron/program/SolidityNode.java, line 69:
<comment>Shutdown can hang because stop flag is not honored inside the inner retry loops (`getBlockByNum` / `getLastSolidityBlockNum`).</comment>
<file context>
@@ -2,83 +2,82 @@
- TronError.ErrCode.SOLID_NODE_INIT);
+ @PreDestroy
+ private void shutdown() {
+ flag = false;
+ ExecutorServiceManager.shutdownAndAwaitTermination(getBlockExecutor, getBlockName);
+ ExecutorServiceManager.shutdownAndAwaitTermination(processBlockExecutor, processBlockName);
</file context>
What does this PR do?
Why are these changes required?
This PR has been tested by:
Follow up
Extra details
Summary by cubic
Adds graceful startup and shutdown for Solidity nodes and integrates them into the
FullNodelifecycle, with P2P auto-disabled and trust-node validation. Moves block push logic fromManagertoTronNetDelegateand uses single-thread executors for block fetch/process.New Features
SolidityNodeis now a Spring component with clean startup/shutdown (@PostConstruct/@PreDestroy), including gRPC client shutdown.FullNoderuns theSolidityNodebean in solidity mode, validatestrustNodeAddr, and disables P2P automatically.Refactors
Manager.pushVerifiedBlock; addedTronNetDelegate.pushVerifiedBlockto route viaprocessBlock.ExecutorServiceManagersingle-thread executors for get/process loops.SolidityNodeinstantiation is conditional on solidity mode; processing usesTronNetDelegateand updates the latest solidified block number on success.Written for commit bc68c90. Summary will update on new commits.