-
Notifications
You must be signed in to change notification settings - Fork 360
fix(miner): use unixnano for block time #1494
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe change in the Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- cosmos/runtime/miner/miner.go (1 hunks)
Additional comments: 2
cosmos/runtime/miner/miner.go (2)
- 105-105: The change to use nanosecond precision for block timestamps by calling
UnixNano()
instead ofUnix()
is a direct and effective solution to the problem of blocks having identical Unix timestamps. This adjustment allows for sub-second block times, which should prevent the creation of blocks with identical timestamps and address the chain crash issue. The logic appears correct and aligns with the PR's objectives. However, it's important to ensure that all downstream systems and components that interact with block timestamps can handle the increased precision without issues.- 105-105: Given the significant change in timestamp precision, it's recommended to verify the compatibility of nanosecond precision timestamps with all parts of the system that interact with block timestamps. This includes checking data storage, timestamp processing logic, and any external systems that might rely on the timestamp format. Additionally, consider conducting performance testing to ensure that the increased precision does not introduce any unexpected overhead or issues, especially in high-throughput scenarios.
This PR updates the payload to use nano timestamp to allow sub-second block time. Fixes rollkit/rollkit#1529
Thanks @tzdybal
Summary by CodeRabbit