Skip to content

node, cmd: stop wiring Polygon services and drop the bor CLI flags - #23491

Closed
awskii wants to merge 6 commits into
mainfrom
awskii/polygon-removal-node-wiring
Closed

node, cmd: stop wiring Polygon services and drop the bor CLI flags#23491
awskii wants to merge 6 commits into
mainfrom
awskii/polygon-removal-node-wiring

Conversation

@awskii

@awskii awskii commented Aug 22, 2026

Copy link
Copy Markdown
Member

Nothing constructs a Bor consensus engine, a Heimdall service or a Polygon bridge any more. This removes that wiring from the embedded node and the flags that fed it, so the only Polygon code still reachable is the tree under polygon/ itself. Third in the Polygon removal series, branched off #23489 — review the last commit only.

Changes

  • node/rulesconfig: drop the *borcfg.BorConfig engine case; CreateRulesEngine loses its withoutHeimdall, polygonBridge and heimdallService parameters
  • node/eth: remove the Heimdall/bridge client and service construction, the polygonsync.Service startup and its snapshot range extractors, the polygonBridge / heimdallService / polygonSyncService fields, and the Bor arm of the sync-mode select
  • SetUpBlockReader no longer builds or returns Bor snapshots and the bridge/Heimdall stores
  • the Engine API HTTP server and the snapshot-download-on-start path are no longer gated on Bor
  • node/privateapi: drop the BorTxnLookup and BorEvents handlers and the BridgeBackend / HeimdallBackend gRPC registrations
  • node/components/storage, node/paths: drop the Bor snapshot/store fields and the Bor legacy datadir names
  • remove --bor.heimdall, --bor.withoutheimdall, --bor.period, --bor.minblocksize, --polygon.pos.ssf and --polygon.pos.ssf.block, along with setBorConfig and the Bor devp2p peer-count override
  • rename --polygon.wit-protocol to --wit-protocol, keeping the old name as an alias
  • node/ethconfig: drop HeimdallURL and WithoutHeimdall, regenerate gen_config.go
  • drop the Bor startup log lines and the Bor cases in cmd/integration's initRulesEngine

Notes

--bor.period and --bor.minblocksize were registered in the default flag set but never read, so they did nothing.

The WIT protocol in p2p/protocols/wit has no Polygon references — it is a generic stateless-witness side-protocol that only ever carried a Polygon-prefixed flag name. Hence the rename rather than a removal; --polygon.wit-protocol still works as an alias.

ethconfig.PolygonPosSingleSlotFinality and its block field stay for now: polygon/sync is their only reader, and both go when that tree is deleted at the end of the series. The flags that set them are removed here, so they are inert.

cmd/rpcdaemon/cli still builds a read-only Bor engine and the bridge/Heimdall readers for the standalone rpcdaemon, and cmd/utils/app still runs Bor snapshot integrity checks. Those are the next PR, together with the remaining cmd/ tooling.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

# Conflicts:
#	cmd/downloader/main.go
#	cmd/integration/commands/stages.go
#	node/eth/backend.go
# Conflicts:
#	cmd/integration/commands/stages.go
@awskii

awskii commented Aug 22, 2026

Copy link
Copy Markdown
Member Author

Superseded by #23492, which landed this work squashed together with the standalone-tools cleanup. This branch is now byte-identical to main (0 changed files), so there is nothing left to review here. The remaining series continues in #23494 -> #23495 -> #23497.

@awskii awskii closed this Aug 22, 2026
@awskii awskii mentioned this pull request Aug 22, 2026
pull Bot pushed a commit to Dustin4444/erigon that referenced this pull request Aug 22, 2026
…gontech#23492)

The standalone binaries were still building Bor readers, a read-only Bor
engine and Bor snapshot stores that nothing consumes now that the `bor`
RPC namespace and the node-side services are gone. This removes that,
which leaves `cmd/` and `node/` free of any `polygon/` import. Fourth in
the Polygon removal series, branched off erigontech#23491 — review the last commit
only.

## Changes
- `cmd/rpcdaemon/cli`: drop the `BridgeReader` and `HeimdallReader`
interfaces, the Bor snapshot and bridge/Heimdall store setup, the
`bor.NewRo` arms in both the local and remote engine paths, and the two
Bor version-compatibility checks; `RemoteServices` returns 9 values
instead of 11
- `cmd/utils/app`: drop the Bor snapshot open/close in `snapshots` and
`seg`, the Bor stores in `openSnaps`, the `FrozenBorBlocks` retire clamp
and `CheckBorChain`
- `cmd/integration`: drop the Bor snapshot and store singletons, the
`--bor.heimdall` flag, the Heimdall/polygon-bridge DB migration paths
and their migratable labels, and the bor line in `print_stages`
- `db/integrity`: remove the `BorEvents`, `BorSpans` and
`BorCheckpoints` checks
- drop the remaining `_ "polygon/heimdall"` blank imports from
`cmd/downloader`, `cmd/integration` and `cmd/rpcdaemon`
- `erigon init` now rejects a genesis carrying a `bor` config instead of
decoding it

## Notes
`erigon init` used to rehydrate `Genesis.Config.Bor` from the `bor` JSON
key. Simply dropping that would have let a Polygon genesis initialise
with `Bor == nil` and run under the wrong consensus rules, so it fails
with a pointer to `0xPolygon/erigon` instead. The two remaining
rehydration sites, in `db/rawdb` and `txnprovider/txpool`, get the same
treatment when `chain.Config.Bor` itself is removed.

`cmd/rpcdaemon/rpcservices` still implements `BorSnapshots()` and
`FrozenBorBlocks()` because they are still on the `FullBlockReader`
interface. That interface, the Bor snapshot machinery in
`db/snapshotsync` and the 15 `kv.Bor*` tables are the next PR.
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.

3 participants