fix(doc): optimze README.md and reference.conf comment#6804
Open
317787106 wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
TronNetDelegate— wrapLockSupport.park()in awhile (!hitDown && !Thread.currentThread().isInterrupted())loop so that spurious unparks (e.g. fromThread.interrupt()inclose()) cannot trigger theSystem.exit(0)path prematurely, and so the hit-thread exits cleanly when the Spring context is destroyed.SolidityNode— fix a shutdown race ingetBlockByNum(): when a gRPC exception is thrown while the node is shutting down (!flag || isHitDown()), break out immediately instead of sleepingexceptionSleepTime(1 s) and retrying.ShieldedReceiveTest.pushSameSkAndScanAndSpend— fix a test isolation bug and a performance regression:validBlock()(latestBlockHeaderNumber == 0 → return true) to skip DPoS schedule validation. When prior tests cause the consensus background task to produce blocks, this bypass no longer applies and the block push fails withValidateScheduleException.System.currentTimeMillis()timestamps withnextScheduledTime(), which looks up the nearest slot where the witness is actually scheduled according toDposSlot.ConsensusServicebefore manual block pushes:DposTaskshares the samelocalwitnesskey and would race to produce blocks at the same slot, triggeringswitchForkand making the test slow.reference.conf— remove the stale "Keys that cannot auto-bind" comment block; those implementation details belong in the source classes, not in the config template.README.md— surfacereference.confalongsideconfig.confin the configuration-file list so users know a built-in defaults template exists (added in v4.8.2).Why are these changes required?
LockSupport.park()call could be woken byThread.interrupt()fromclose(), causing the process to reachSystem.exit(0)beforehitDownwas ever set. With the while-loop fix,close()callinginterrupt()caused a busy-spin becausepark()returns immediately when interrupted but the loop never exited — adding theisInterrupted()guard lets the thread exit cleanly.getBlockByNum()triggered a 1-second sleep and an unnecessary retry loop, delaying clean exit and producing noisy error logs.pushSameSkAndScanAndSpendpassed in isolation because the chain started at genesis (block 0), bypassing DPoS validation. In a full test run, the consensus background task produces blocks before this test runs, advancing the head past 0 and exposing the missing schedule-aware timestamp logic.reference.confcomment described internal normalisation details that have since been refactored into the Java classes.reference.confwas introduced in v4.8.2 but not mentioned in the README.This PR has been tested by:
testGetBlockByNumNoErrorOnExceptionDuringShutdown: verifies the shutdown race fix — method breaks in < 500 ms; without the fix a 1-second sleep fires first.pushSameSkAndScanAndSpend: now stable in both single-test and full-suite runs.Follow up
Extra details