Skip to content

feat(spice): add certified light-client header fields (schema)#15963

Draft
darioush wants to merge 1 commit into
darioush/spice-lc-merkle-proof-1from
darioush/spice-lc-header-schema-2
Draft

feat(spice): add certified light-client header fields (schema)#15963
darioush wants to merge 1 commit into
darioush/spice-lc-merkle-proof-1from
darioush/spice-lc-header-schema-2

Conversation

@darioush

Copy link
Copy Markdown
Contributor

Adds the two spice light-client fields to the block header and threads them through, with placeholder (default) production — the real values come from the certified accumulator in a later PR of this stack (marked TODO(spice) in client.rs).

  • BlockHeaderInnerLiteV2 (= classic inner-lite + certified_block_merkle_root + last_certified_block); BlockHeaderV7 switches to it; compute_hash_and_sign generalized over the inner-lite type.
  • Replaces the unified inner_lite() accessor with certified_block_merkle_root() / last_certified_block() Option accessors.
  • BlockHeaderInnerLiteView gains the two fields as #[borsh(skip)] + serde (keeps the persisted EpochLightClientBlocks layout intact); LightClientBlockLiteView::hash() is version-aware.
  • Threads the fields through Block::new, SpiceNewBlockProductionInfo, BlockHeaderView, TestBlockBuilder.

No behavior change: nothing computes or validates the fields yet.

Testing

  • near-primitives unit tests; existing near-chain spice unit tests (placeholder production builds/processes spice blocks).

2/6 of the SPICE light-client stack (#15947). Base: #15962.

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.49%. Comparing base (f0e71b0) to head (3f2b832).

Files with missing lines Patch % Lines
core/primitives/src/views.rs 57.57% 14 Missing ⚠️
core/primitives/src/test_utils.rs 46.66% 8 Missing ⚠️
core/primitives/src/block_header.rs 95.65% 2 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           darioush/spice-lc-merkle-proof-1   #15963      +/-   ##
====================================================================
- Coverage                             72.52%   72.49%   -0.03%     
====================================================================
  Files                                   946      946              
  Lines                                204290   204367      +77     
  Branches                             204290   204367      +77     
====================================================================
+ Hits                                 148154   148159       +5     
- Misses                                51168    51242      +74     
+ Partials                               4968     4966       -2     
Flag Coverage Δ
pytests-nightly 1.10% <0.00%> (-0.01%) ⬇️
unittests 69.45% <53.84%> (-0.04%) ⬇️
unittests-nightly 69.43% <53.84%> (-0.03%) ⬇️
unittests-spice 66.86% <63.46%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

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