diff --git a/apps/extension/src/rpc/index.ts b/apps/extension/src/rpc/index.ts index 980b19ef..f80dec51 100644 --- a/apps/extension/src/rpc/index.ts +++ b/apps/extension/src/rpc/index.ts @@ -25,7 +25,6 @@ import { viewImpl } from '@penumbra-zone/services/view-service'; import { createProxyImpl, noContextHandler } from '@penumbra-zone/transport-dom/proxy'; import { onboardGrpcEndpoint } from '../storage/onboard'; import { rethrowImplErrors } from './rethrow-impl-errors'; -import { makeTendermintProxyZeroNanos } from './tendermint-proxy'; type RpcImplTuple = [T, Partial>]; @@ -69,7 +68,6 @@ export const getRpcImpls = async () => { TendermintProxyService, createPromiseClient(TendermintProxyService, webTransport), noContextHandler, - makeTendermintProxyZeroNanos, ), ), ], diff --git a/apps/extension/src/rpc/tendermint-proxy.ts b/apps/extension/src/rpc/tendermint-proxy.ts deleted file mode 100644 index 7de61b24..00000000 --- a/apps/extension/src/rpc/tendermint-proxy.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { PromiseClient, ServiceImpl } from '@connectrpc/connect'; -import { TendermintProxyService } from '@penumbra-zone/protobuf'; - -/** - * This function is used to create a proxy that clobbers the nanos on the block - * header timestamp and removes the list of commit signatures from the block. - * Minifront doesn't use this request for anything related to consensus, so it's - * safe for Minifront, but it may break other consumers. - * - * This is necessary because the CometBFT nanos field does not comply with the - * google.protobuf.Timestamp spec, and may include negative nanos. This causes - * failures when re-serializing the block header: bufbuild deserializes the - * negative nanos, but refuses to re-serialize. - * - * Ideally, - * - cometbft serialization should be compliant with google.protobuf.Timestamp - * - bufbuild should provide JsonSerializationOption to disable the error - * - * We should explore PRing bufbuild or monkey-patching the serialization. - */ -export const makeTendermintProxyZeroNanos = ( - c: PromiseClient, -): Pick, 'getBlockByHeight'> => ({ - getBlockByHeight: async req => { - const r = await c.getBlockByHeight(req); - if (r.block?.header?.time?.nanos) { - r.block.header.time.nanos = 0; - } - if (r.block?.lastCommit?.signatures.length) { - r.block.lastCommit.signatures = []; - } - return r; - }, -});