Skip to content

feat: add TimeNano field for nanosecond block timestamps#2253

Draft
minhd-vu wants to merge 5 commits into
developfrom
feature/timenano-placeholder-fork
Draft

feat: add TimeNano field for nanosecond block timestamps#2253
minhd-vu wants to merge 5 commits into
developfrom
feature/timenano-placeholder-fork

Conversation

@minhd-vu

@minhd-vu minhd-vu commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Add nanosecond-precision block timestamp capture via new TimeNano field in BlockExtraData. This enables tracking precise block propagation timing beyond the second-precision header.Time field.

Changes:

  • Add TimeNano field to BlockExtraData (RLP optional)
  • Add GetTimeNano() helper on Header
  • Add Placeholder hardfork to gate TimeNano validation
  • Validate TimeNano presence in verifyHeader for Placeholder+ blocks
  • Restructure Prepare to calculate timestamps before BlockExtraData encoding

The Placeholder hardfork name is temporary and will be renamed.

Executed tests

Rollout notes

minhd-vu added 3 commits June 3, 2026 10:38
…stamps

Add nanosecond-precision block timestamp capture via new TimeNano field
in BlockExtraData. This enables tracking precise block propagation timing
beyond the second-precision header.Time field.

Changes:
- Add TimeNano field to BlockExtraData (RLP optional)
- Add GetTimeNano() helper on Header
- Add Placeholder hardfork to gate TimeNano validation
- Validate TimeNano presence in verifyHeader for Placeholder+ blocks
- Restructure Prepare to calculate timestamps before BlockExtraData encoding

The Placeholder hardfork name is temporary and will be renamed.
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.44444% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.45%. Comparing base (89eada7) to head (f1286ea).

Files with missing lines Patch % Lines
core/types/block.go 0.00% 12 Missing ⚠️
consensus/bor/bor.go 88.67% 5 Missing and 1 partial ⚠️
params/config.go 42.85% 4 Missing ⚠️

❌ Your patch check has failed because the patch coverage (69.44%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2253      +/-   ##
===========================================
+ Coverage    53.41%   53.45%   +0.04%     
===========================================
  Files          896      896              
  Lines       159745   159770      +25     
===========================================
+ Hits         85322    85413      +91     
+ Misses       69095    69048      -47     
+ Partials      5328     5309      -19     
Files with missing lines Coverage Δ
params/config.go 37.06% <42.85%> (+0.12%) ⬆️
consensus/bor/bor.go 85.60% <88.67%> (+0.07%) ⬆️
core/types/block.go 41.25% <0.00%> (-1.40%) ⬇️

... and 24 files with indirect coverage changes

Files with missing lines Coverage Δ
params/config.go 37.06% <42.85%> (+0.12%) ⬆️
consensus/bor/bor.go 85.60% <88.67%> (+0.07%) ⬆️
core/types/block.go 41.25% <0.00%> (-1.40%) ⬇️

... and 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
12.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@minhd-vu

Copy link
Copy Markdown
Contributor Author

This should be reviewed alongside: #2277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant