fix(miner): recompute timestamp after sleep#2052
fix(miner): recompute timestamp after sleep#2052gzliudan wants to merge 1 commit intoXinFinOrg:dev-upgradefrom
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)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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.
Pull request overview
Updates mining work creation to recompute the candidate block timestamp after any sleep, aiming to avoid stale timestamps when the parent block changes.
Changes:
- Recalculates
tstart/tstampafter re-checking the parent block (post-sleep) incommitNewWork.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
191d63a to
3aeab3e
Compare
|
Can we somehow refactor the code? There is duplicated code |
cfd5f81 to
419a0df
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5b4e2b0 to
419a0df
Compare
If we are recalculating because the parent changed, shouldn't sleep time also be checked again? |
144c9bb to
763e3fe
Compare
763e3fe to
09a61f0
Compare
09a61f0 to
61a7e8c
Compare
Proposed changes
recompute timestamp after sleep
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which part of the codebase this PR will touch base on,
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that