Skip to content

Conversation

@ulbqb
Copy link
Contributor

@ulbqb ulbqb commented Jan 13, 2026

Proposed changes

Issues

  • Wrong Header.TxHash is calculated because transaction RLP contains sidecars.
  • This validation causes bad blocks when CNs give blocks with sidecars to InsertChain() and PNs and ENs accidentally receive blocks with sidecars.
  • Blocks with sidecars are accidentally sent to PNs and ENs.

CN behavior

Proposer behavior:

  • They basically execute wait() -> PostChainEvents().

Non-proposer behavior:

  • PostChainEvents
    • Instead of wait() -> PostChainEvents(), they only execute InsertChain() -> PostChainEvents().
    • PostChainEvents() need to be called to save sidecars.
  • InsertChain
    • Either one of the following paths is executed:
      • They sometimes do InsertChain(blockWithSidecar in proposal) upon commit.
      • They sometimes do InsertChain(blockWithoutSidecar in NewBlockMsg) upon receiving new block from other CNs (i.e., NewBlockMsg was faster than commit).

Changes

This PR contains the following changes:

  • Add DeriveTransactionsRoot for safely calculating transactions root
  • Change name DeriveSha into DeriveReceiptsRoot: DeriveSha is now exclusively for receipts root.
  • Remove sidecar existence validation: Non proposer CNs always execute InsertChain(). CN's blocks often have sidecars. We need to remove this.
  • Controlling sending blocks over NewBlockMsg in lower level and allow sending blocks with sidecars to only CNs: Non proposer CNs sometimes do InsertChain(block from NewBlockMsg). They need sidecars over NewBlockMsg. Moreover this can control p2p message not to send sidecars to PNs and ENs.
  • Update peer selection for BlobSidecarsRequestMsg: Peers are selected in the order of CN, PN, and EN. There's a good chance peers will have a sidecar in that order.

Types of changes

  • 🐛 Bug fix
  • ✨ Non-hardfork changes (node upgrade not required)
  • 💥 Hardfork / consensus-breaking changes
  • 🧪 Test improvements
  • 🧰 CI / build tool
  • ♻️ Chore / Refactor / Non-functional changes

Checklist

  • 📖 I have read the CONTRIBUTING GUIDELINES doc
  • 📝 I have signed in the PR comment I have read the CLA Document and I hereby sign the CLA in first time contribute after having read CLA
  • 🟢 Lint and unit tests pass locally with my changes ($ make test)

Related issues

Further comments

@ulbqb ulbqb force-pushed the fix/sync_sidecar branch 3 times, most recently from 1c05d90 to 78dfbd9 Compare January 14, 2026 16:52
@ulbqb ulbqb marked this pull request as ready for review January 15, 2026 01:28
@ulbqb ulbqb self-assigned this Jan 15, 2026
@ulbqb ulbqb requested review from Mdaiki0730 and tnasu January 15, 2026 01:29
@ulbqb ulbqb changed the title Fix propagation of sidecar fix: solve bad block from wrong transactions root hash and blob sidecar existence validation Jan 15, 2026
@ulbqb ulbqb requested a review from blukat29 January 15, 2026 01:57
@ulbqb ulbqb requested review from blukat29 and ian0371 January 15, 2026 06:55
@ulbqb ulbqb requested a review from Mdaiki0730 January 15, 2026 09:54
@ulbqb ulbqb merged commit 349e5ec into kaiachain:dev Jan 15, 2026
30 of 33 checks passed
@ulbqb ulbqb deleted the fix/sync_sidecar branch January 15, 2026 10:16
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants