Skip to content

refactor(juno): stop support for pending block#3498

Merged
rodrodros merged 13 commits intomainfrom
maksym/deprecate-pending-v2
Apr 2, 2026
Merged

refactor(juno): stop support for pending block#3498
rodrodros merged 13 commits intomainfrom
maksym/deprecate-pending-v2

Conversation

@MaksymMalicki
Copy link
Copy Markdown
Contributor

@MaksymMalicki MaksymMalicki commented Mar 23, 2026

Summary

StarkNet 0.14.0 introduced a new pending block format. The legacy Pending block has been replaced by a two-phase PreConfirmed and PreLatest. This PR removes support for Pending block in the synchroniser and the RPC. Since the network has been running 0.14.0+ for a long time, nodes no longer receive or produce the old-style pending blocks, meaning the code that handled them was dead weight — untriggered branches, split test cases, and a pending polling phase that never ran.

What changed

Sync

The sync layer's polling pipeline previously had two phases: one for the legacy pending format and one for the new pre-confirmed format. The legacy phase, along with all helpers and state logic it relied on, has been removed. Nodes now follow a single polling path (which is runPreConfirmedPhase()) for pending data.

RPC handlers (v9, v10)

The handlers no longer need to detect which pending format they received and adapt accordingly. Every code path that previously forked on "old format vs new format" has been collapsed into one - the support for pending Variant has been dropped and only the PreConfirmed is supported. Tests that covered the old-format path have been removed; existing tests have been updated to use PreConfirmed + PreLatest only.

RPC v8

The v8 spec still exposes a "pending" block ID that maps to the old format. The legacy type is therefore kept alive — but marked as deprecated — solely to serve v8 responses. It will be deleted when v8 is retired. Removed onPendingData field, pending data subscription, and the pending event loop case, as it always returns nil for 0.14.0+ versions.

Notes

  • Due to the Deprecated tag being added to the Pending type and NewPending constructor, the linter issues will be present in the CI.
  • Reviewers should not spend much time reviewing rpc/v6 package, as its flagged for deprecation
  • Removal of the PendingData interface was moved to a separate PR to reduce the noise and make reviews easier: refactor(juno): obsolete the PendingData interface #3512

@MaksymMalicki MaksymMalicki marked this pull request as draft March 23, 2026 11:02
@MaksymMalicki MaksymMalicki force-pushed the maksym/deprecate-pending-v2 branch from 7dd0ec5 to 3091489 Compare March 23, 2026 17:40
@MaksymMalicki MaksymMalicki marked this pull request as ready for review March 23, 2026 23:16
Comment thread cmd/juno/juno.go Outdated
Comment thread core/pending_state.go
Comment thread rpc/v10/helpers.go
Comment thread rpc/v10/helpers.go
Comment thread rpc/v6/pending_data_wrapper.go Outdated
Comment thread rpc/v6/block_test.go
Comment thread rpc/v10/pending_data_wrapper.go
Comment thread rpc/v8/subscriptions.go
Comment thread sequencer/sequencer.go Outdated
Comment thread sequencer/sequencer.go Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 69.79167% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.20%. Comparing base (9206c9a) to head (3bffac0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sync/pendingdata/helpers.go 25.00% 2 Missing and 4 partials ⚠️
rpc/v9/trace.go 57.14% 0 Missing and 3 partials ⚠️
sync/data_source.go 25.00% 2 Missing and 1 partial ⚠️
consensus/datasource/consensus_data_source.go 0.00% 2 Missing ⚠️
rpc/v10/pending_data_wrapper.go 33.33% 1 Missing and 1 partial ⚠️
rpc/v10/trace.go 84.61% 0 Missing and 2 partials ⚠️
rpc/v9/pending_data_wrapper.go 33.33% 1 Missing and 1 partial ⚠️
sync/sync.go 60.00% 1 Missing and 1 partial ⚠️
core/pending_state.go 0.00% 1 Missing ⚠️
rpc/v10/helpers.go 80.00% 1 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3498      +/-   ##
==========================================
- Coverage   75.51%   73.20%   -2.32%     
==========================================
  Files         384      384              
  Lines       34973    35173     +200     
==========================================
- Hits        26411    25749     -662     
- Misses       6700     7139     +439     
- Partials     1862     2285     +423     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

@thiagodeev thiagodeev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey. We are on the right track.
This is a partial review, I haven't finished yet.
Requesting changes since we still have mentions to pending in the starkinetdata/feeder pkg

Comment thread rpc/v10/trace.go Outdated
Comment thread starknetdata/feeder/feeder.go
Comment thread rpc/v10/trace.go Outdated
Copy link
Copy Markdown
Contributor

@EgeCaner EgeCaner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First round

Comment thread sync/sync.go Outdated
Comment thread sync/pendingdata/helpers.go Outdated
Comment thread sync/pendingdata/helpers.go Outdated
Comment thread sync/pending_polling.go Outdated
Comment thread rpc/v9/transaction.go Outdated
Comment thread rpc/v9/subscriptions_test.go Outdated
Comment thread rpc/v9/trace.go
Comment thread rpc/v10/trace.go Outdated
Copy link
Copy Markdown
Contributor

@thiagodeev thiagodeev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread rpc/v6/transaction_test.go Outdated
Comment thread rpc/v10/adapt_transaction.go Outdated
Comment thread rpc/v9/transaction.go Outdated
Comment thread rpc/v8/trace_test.go Outdated
Comment thread rpc/v6/transaction_test.go Outdated
Comment thread rpc/v6/transaction_test.go Outdated
Comment thread rpc/v6/transaction_test.go Outdated
Comment thread rpc/v8/trace_test.go Outdated
Comment thread rpc/v8/trace_test.go Outdated
Copy link
Copy Markdown
Contributor

@EgeCaner EgeCaner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! I love this PR

@MaksymMalicki MaksymMalicki force-pushed the maksym/deprecate-pending-v2 branch from 06916cd to 3bffac0 Compare April 1, 2026 15:04
@rodrodros rodrodros merged commit 992b487 into main Apr 2, 2026
69 of 79 checks passed
@rodrodros rodrodros deleted the maksym/deprecate-pending-v2 branch April 2, 2026 12:36
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.

4 participants