db, execution: drop Bor snapshots and the Bor block-reader interface methods - #23494
Conversation
…ocs and QA workflow
…e from the Polygon cleanup
…emoval-db-storage
# Conflicts: # cmd/downloader/main.go # cmd/integration/commands/stages.go # node/eth/backend.go
# Conflicts: # cmd/integration/commands/stages.go
|
Review of the current head. The main issue: the new Bugs1. Write side still produces what the read side rejects —
2. It decodes the same 3. Stale caller guard swallows the new error — storedCfg, storedErr := rawdb.ReadChainConfig(tx, storedHash)
if storedErr != nil && newCfg.Bor == nil {
return newCfg, nil, storedErr
}With a Bor genesis the condition is false, the error is dropped, and 4. The kept heimdall/polygon-bridge cleanup in
5. Bor genesis silently falls through to ethash — Dropping the Leftovers
TestThe new rejection has no test. |
…ng' into HEAD # Conflicts: # cmd/integration/commands/stages.go # cmd/rpcdaemon/cli/config.go # cmd/utils/app/init_cmd.go # cmd/utils/app/snapshots_cmd.go
…eftover Polygon stubs
…e' into awskii/polygon-removal-db-storage
|
Ran a 4-agent review over this PR (
On the review above, point by point: Bugs 1, 2, 3 — confirmed. The qualifier: all three are gone by the end of the series. At #23497 the Bug 4 — confirmed, and this one is durable. Bug 5 — confirmed here, evaporates later. Dropping the Test gap — already closed. |
…nsensus paths (erigontech#23495) Polygon's fork tiers reached into the EVM's precompile and opcode tables, the signer, the base-fee formula, the ForkID and the block executor. Every one of those sites was gated on `chainConfig.Bor != nil`, which no chain can satisfy since erigontech#23487 de-registered the Bor chainspecs, so removing them changes nothing for any supported chain. After this, **nothing outside `polygon/` imports it** — production or test. Sixth in the Polygon removal series, branched off erigontech#23494 — review the last commit only. ## Changes - `execution/vm`: drop the `Napoli` and `Bhilai` precompile sets and instruction sets, and their arms in `Precompiles`, `ActivePrecompiles` and the interpreter's jump-table select - `execution/chain`: drop `Config.IsAgra` / `IsNapoli` / `IsAhmedabad` / `IsBhilai` and the matching `Rules` fields - `execution/protocol`: drop the Bor "Rio" coinbase override in `NewEVMBlockContext`, the synthetic `StateSyncReceipt`, and the Bor author/error special-casing in `SysCallContract` - `execution/protocol/misc`: `CalcBaseFee` uses the single EIP-1559 denominator again; the Delhi and Bhilai variants are gone - `execution/types`: drop the Bhilai signer tier and the Bhilai `setCode` gate - `p2p/forkid`: drop the Agra, Napoli and Bhilai fork boundaries - `txnprovider/txpool`: drop the Agra and Bhilai fork tracking, the Bor min-fee-cap constant, and `initBor` - drop the Bor arms in the simulated backend and the kurtosis-devnet genesis header override - remove the Polygon cases from the dump, forkid, enum-registry and signer tests ## Notes `newCancunInstructionSet` was built **on top of** `newNapoliInstructionSet`, so EIP-1153, EIP-5656 and EIP-6780 reached Cancun through the Polygon tier. Deleting Napoli without care would have silently changed the Cancun opcode set on Ethereum mainnet. Those three enables are now spelled out in `newCancunInstructionSet` directly, leaving it byte-identical. Prague derives from Cancun, not Bhilai, so it is unaffected. Collapsing Napoli's `validateAndFillMaxStack` into Cancun's single call is safe: it only recomputes `maxStack` from each op's pop/push counts. `Rules.IsShanghai` no longer ORs in `IsAgra` and `Rules.IsPrague` no longer ORs in `IsBhilai`. Both extra terms could only be true with a Bor config present. `txnprovider/txpool` was the last of the three `BorJSON` rehydration sites; the pool now keeps the stored chain config as-is. The other two, in `erigon init` and `db/rawdb`, reject a `bor` section outright. `chain.Config.Bor`, the `BorConfig` interface, `chain.BorRules`, `MimetypeBor`, the 15 `kv.Bor*` tables, `snaptype.MinBorEnum`, the `WitnessProcessing` stage and the `remote/bor.proto` surface all remain: `polygon/` still implements or reads them. They go in the final PR, which is now a straight deletion. --------- Co-authored-by: Alexey Sharov <askalexsharov@gmail.com>
The Bor snapshot type, its retire/merge path and the two Bor-named methods on the generic block-reader interfaces existed only to carry Heimdall data. With nothing constructing them any more, this removes them, which takes
db/off the list of packages importingpolygon/. Fifth in the Polygon removal series, branched off #23492 — review the last commit only.Changes
db/snapshotsync/freezeblocks/bor_snapshots.goBlockRetireloses its Heimdall and bridge stores,BorStore(),borSnapshots(), the Bor prune metric and the Bor-data-not-ready backoff;NewBlockRetiredrops two parametersBlockReaderloses itsborSnfield,BorSnapshots()andFrozenBorBlocks();NewBlockReadertakes one snapshot set instead of twoFrozenBorBlocksandBorSnapshotsfromdbservices.FullBlockReader,FrozenBorBlocksfrom the engine-facingrules.ChainHeaderReader, andBorSnapshotsfromsnapshotsync's reader interface, along with all seven implementationsremotedbserver.NewKvServerdrops its Bor snapshot parameterdb/rawdb:ReadChainConfignow rejects a storedborsection instead of decoding itexecution/stagedsync: drop the Bor branches from the snapshots stage, including the synchronous-indexing exceptiondb/datadir: keep removing the legacyheimdallandpolygon-bridgedirectories, by literal name now that the DB labels are on their way outNotes
ReadChainConfigused to rehydrateConfig.Borfrom the storedborJSON. Dropping that silently would let an existing Polygon chaindata load withBor == niland execute under the wrong consensus rules, so it now fails with a pointer to0xPolygon/erigon. This is the second of the three rehydration sites;txnprovider/txpoolis the last and goes withchain.Config.Bor.The
heimdallandpolygon-bridgedatadir cleanup is deliberately kept: anyone upgrading from a Polygon datadir still wants those directories removed.The 15
kv.Bor*tables, theHeimdallDB/PolygonBridgeDBlabels andsnaptype.MinBorEnumare not touched here.polygon/heimdallandpolygon/bridgeare their only readers andpolygon/heimdallpins the snapshot enum range, so they can only go in the same PR that deletes the tree. Removing them earlier would just mean editing code that is about to disappear.The
WitnessProcessingstage stays for the same reason: it readskv.BorWitnesses.