refactor: remove alloy-format path from block-and-receipts importer - #2723
Draft
gventino-cw wants to merge 10 commits into
Draft
gventino-cw wants to merge 10 commits into
gventino-cw wants to merge 10 commits into
Conversation
…ipts (#2709) Leader: - `stratus_getBlockAndReceipts` gains an opt-in stratus-native response format via the optional pagination parameter `format` ("alloy" default, "stratus" new): serializes `BlockRocksdb` directly from the stratus `Block` type (receipts embedded) instead of converting through the alloy types, matching the `stratus_get_block_with_changes` precedent. Follower: - New importer config `importer.response_format` (default "alloy"). With "stratus", the follower requests the native format on every importer request (including pagination chunks) and re-executes blocks through the new native path (`Executor::execute_imported_block`, `Miner::mine_imported`, `Block::apply_imported`), mirroring the alloy path behavior exactly (same signer re-derivation, receipt comparison, failed-transaction handling and state changes). - Clear startup/sync error when a stratus-format follower hits an old leader that keeps answering in the legacy alloy format. Old leaders ignore the unknown `format` field; old followers never send it, so mixed fleets keep syncing during rollout (upgrade leaders first, then flip followers via config).
…cess and failure helpers Reduces cyclomatic complexity by extracting reexecute_imported_transaction and recreate_failed_imported_transaction. No behavior change.
…helper - hoist duplicated gas-left event hashes to module-level GAS_LEFT_EVENT_HASHES - extract TransactionExecution::transaction_input() and use it in the executor and fake leader - surface the parse error as reason in the legacy-format tracing - drop redundant required = false from the importer response_format arg
Contributor
|
Failed to generate code suggestions for PR |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2719.
Summary
The follower importer no longer understands or requests the legacy alloy response format.
stratus_getBlockAndReceiptshas exactly one response shape: the stratus block DTO (BlockRocksdb) with receipts embedded in each mined transaction.Removed:
follower/importer): theFetchedBlockWithReceiptsenum, theresponse_formatconfig knob (importer.response_format), and theExternalBlockWithReceiptsroute; the fetcher now always deserializesBlockRocksdbintoBlock.eth/rpc): theResponseFormatenum and thePaginationParams.formatfield; the handler unconditionally serializes the storage DTO. Old leaders that ignored the unknownformatfield no longer receive it — the wire format of pagination params is back to{ "offset": N }only.eth/executor): the whole external-transaction reexecution machinery —execute_external_block/execute_external_transaction(_inner), theTransactionTaskKind::Externalworker arm, the alloy receipt-based validation methods (from_failed_external_transaction,compare_with_receipt,apply_receipt,fix_logs_gas_left) and their tests, plus theexecutor_external_block/executor_external_transactionmetrics.eth/types): theexternalmodule (ExternalBlock,ExternalBlockWithReceipts,ExternalReceipt,ExternalReceipts,ExternalTransaction),TryFrom<ExternalTransaction> for TransactionInput,apply_external/PartialEqbridging,TryFrom<&ExternalBlock> for BlockHeader,set_pending_from_external, and theAlloyBlockExternalTransactionalias. Also dropped dead RPC-client methods (fetch_block,fetch_transaction,fetch_receipt);subscribe_new_headsnow consumesalloy_rpc_types_eth::Headerdirectly.-stratusrecipe and the followerextra-argspassthrough are gone;stratus_getBlockAndReceiptsassertions in the JSON-RPC suite match the DTO shape.Kept intentionally (still used by
eth_getBlockByNumber/eth_getBlockByHash):From<TransactionInput> for AlloyTransaction,to_tx_envelope, andFrom<Block> for AlloyBlockAlloyTransaction.Commits
refactor(importer): collapse block-and-receipts importer to stratus-native formatrefactor(rpc): remove response format negotiation from stratus_getBlockAndReceiptsrefactor(executor): remove external transaction reexecution machineryrefactor(e2e): merge pagination tests into stratus-native formatTesting
cargo check/cargo clippy/ fullcargo test --lib --features devon the worktree (nightly-2026-05-08rustfmtclean).just e2e-leader-follower-pagination(merged stratus-native pagination test),just e2e-leader-follower-pagination-changes,just e2e-leader-follower-up, and the external JSON-RPC suite against the DTO shape.Rollout
This PR is the final step of the plan tracked in #2719 — see the disclaimer above for the required order.