Skip to content

refactor(runtime)!: remove v2 processor service + fix latent eth numeric coercion#70

Merged
philz3906 merged 2 commits into
mainfrom
dev/philz3906/cleanup
Jun 11, 2026
Merged

refactor(runtime)!: remove v2 processor service + fix latent eth numeric coercion#70
philz3906 merged 2 commits into
mainfrom
dev/philz3906/cleanup

Conversation

@philz3906

Copy link
Copy Markdown
Contributor

Summary

Removes the V2 processor runtime (v4 only serves ProcessorV3) and migrates the SDK test framework onto ProcessorServiceImplV3. Doing so exposed a latent eth data bug that the V2 path had been masking, which is fixed here as well.

1. Remove V2 processor service (refactor(runtime)!)

  • Delete ProcessorServiceImpl (service.ts) and its V2 tests (service.test.ts, seq-mode.test.ts).
  • Drop FullProcessorServiceImpl and the V2 route registration in processor-runner.ts.
  • Move recordRuntimeInfo + the BigInt.toJSON patch into utils.ts so service-v3 no longer imports from the deleted service.ts; re-point runtime index to service-v3.
  • Migrate TestProcessorServer/MemoryDatabase onto ProcessorServiceImplV3, preserving the public processBindings/processBinding API by driving the V3 stream internally. Two behavior gaps vs. the old unary path are restored:
    • Direct store reads (service.store.get(...)): TestStoreContext.result now also calls super.result, so a request issued from the context itself is resolved instead of hanging.
    • Handler failures: reject when the result carries states.error (V3 reports errors as a result rather than erroring the stream).

2. Coerce numeric eth fields (fix(eth))

The lazy-getter refactor in #1411 dropped getNumber coercion on number-typed getters of FormattedLog/FormattedTransactionReceipt/FormattedTransactionResponse, so raw RPC hex strings (e.g. "0xf3") were returned for fields declared number. protobuf-es create() doesn't validate scalars, so it stayed latent — but ProcessorV3 clones/serializes the ProcessResult, and clone() throws FieldValueInvalidError on the int32 RecordMetaData fields these feed.

  • Restore getNumber / allowNull(getNumber[, default]) on transactionIndex, logIndex, blockNumber, index, type, status, nonce (matching the pre-#1411 spec). tx.index is null-safe since pending/partial txs omit transactionIndex.
  • Coerce trace.transactionPosition at the RecordMetaData boundary in context.ts, since traces are used as a raw cast with no Formatted wrapper.

Testing

  • Full SDK test suite: passing (0 failures, 0 hangs).
  • Runtime tests: 16/16.
  • tsc (sdk + runtime) and ESLint clean.

🤖 Generated with Claude Code

philz3906 and others added 2 commits June 11, 2026 00:06
…to v3

Remove the V2 processor runtime now that v4 only serves ProcessorV3:
- delete ProcessorServiceImpl (service.ts) and its V2 tests
- drop FullProcessorServiceImpl and the V2 route registration in
  processor-runner.ts
- move recordRuntimeInfo and the BigInt.toJSON patch into utils.ts so
  service-v3 no longer imports from the deleted service.ts
- re-point runtime index to export service-v3

Migrate TestProcessorServer/MemoryDatabase onto ProcessorServiceImplV3,
keeping the public processBindings/processBinding API by driving the V3
stream internally. Two behavior gaps from the streaming model are
restored to match the old unary path:
- resolve direct store reads: TestStoreContext.result now also calls
  super.result so a request issued from the context itself (e.g.
  service.store.get in a test) is resolved instead of hanging
- surface handler failures: reject when the result carries states.error
  (V3 reports errors as a result rather than erroring the stream)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The lazy-getter refactor in #1411 dropped the getNumber coercion on
number-typed fields of FormattedLog/FormattedTransactionReceipt/
FormattedTransactionResponse, so raw RPC hex strings (e.g. "0xf3") were
returned for fields declared as `number`. protobuf-es create() does not
validate scalars, so this stayed latent — but cloning/serializing the
resulting ProcessResult (e.g. ProcessorV3's clone) throws
FieldValueInvalidError on the int32 RecordMetaData fields these feed.

Restore getNumber / allowNull(getNumber[, default]) on transactionIndex,
logIndex, blockNumber, index, type, status and nonce, matching the
pre-#1411 formatter spec. transactionIndex on a tx is null-safe
(allowNull(..., 0)) since pending/partial txs omit it. Also coerce
trace.transactionPosition at the RecordMetaData boundary, since traces
are used as a raw cast with no Formatted wrapper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@philz3906 philz3906 merged commit 91ceaa4 into main Jun 11, 2026
1 check passed
@philz3906 philz3906 deleted the dev/philz3906/cleanup branch June 11, 2026 06:48
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.

1 participant