Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IND-387] add script to parse block and print json #692

Merged
merged 10 commits into from
Oct 26, 2023
Merged

Conversation

dydxwill
Copy link
Contributor

Changelist

add script to parse block and return json

Test Plan

ran on devbox

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

@linear
Copy link

linear bot commented Oct 24, 2023

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 24, 2023

Walkthrough

The changes introduce a Kafka consumer for processing messages in a blockchain indexer service. The updates include new environment variables, configuration schemas, and helper functions for handling Kafka messages. The code also introduces new types for annotated Tendermint events and blocks, and a function to decode these events based on their subtype.

Changes

File Summary
.../scripts/.env Adds a new environment variable KAFKA_ENABLE_UNIQUE_CONSUMER_GROUP_IDS for Kafka setup.
.../scripts/src/config.ts Imports and merges baseConfigSchema, kafkaConfigSchema, and postgresConfigSchema into a new configSchema object.
.../scripts/src/helpers/block-helpers.ts Adds annotateIndexerTendermintEvent function to decode IndexerTendermintEvent based on its subtype and convert it to a JSON string.
.../scripts/src/helpers/types.ts Introduces new interfaces AnnotatedIndexerTendermintEvent and AnnotatedIndexerTendermintBlock that extend existing interfaces with new properties.
.../scripts/src/print-block.ts Implements a Kafka consumer for processing messages. Includes functions for connecting to Kafka, seeking to a specific offset, printing messages at a target height, and starting the Kafka consumer.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.json

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a612627 and 1ba769d.
Files ignored due to filter (2)
  • indexer/pnpm-lock.yaml
  • indexer/services/scripts/package.json
Files selected for processing (5)
  • indexer/services/scripts/.env (1 hunks)
  • indexer/services/scripts/src/config.ts (1 hunks)
  • indexer/services/scripts/src/helpers/block-helpers.ts (1 hunks)
  • indexer/services/scripts/src/helpers/types.ts (1 hunks)
  • indexer/services/scripts/src/print-block.ts (1 hunks)
Files skipped from review due to trivial changes (2)
  • indexer/services/scripts/.env
  • indexer/services/scripts/src/config.ts
Additional comments: 1
indexer/services/scripts/src/helpers/types.ts (1)
  • 1-9: The new interfaces AnnotatedIndexerTendermintEvent and AnnotatedIndexerTendermintBlock extend the existing IndexerTendermintEvent and IndexerTendermintBlock interfaces respectively. The AnnotatedIndexerTendermintEvent interface adds a data property of type string to store the decoded event data. The AnnotatedIndexerTendermintBlock interface adds an annotatedEvents property, which is an array of AnnotatedIndexerTendermintEvent objects. This seems to be a good approach to add annotated data to the existing event and block structures without modifying them directly. However, ensure that the data property in AnnotatedIndexerTendermintEvent and annotatedEvents property in AnnotatedIndexerTendermintBlock are being properly populated in the code where these interfaces are used.

Comment on lines +26 to +36
if (!message || !message.value || !message.timestamp) {
throw Error('Empty message');
}
const messageValueBinary: Uint8Array = new Uint8Array(message.value);

const block: IndexerTendermintBlock = IndexerTendermintBlock.decode(
messageValueBinary,
);

return block;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The function getIndexerTendermintBlock throws an error if the message, its value, or its timestamp is not present. However, it does not handle the case where the IndexerTendermintBlock.decode function fails to decode the message value. This could lead to unhandled exceptions if the message value is not a valid IndexerTendermintBlock. Consider adding error handling for this case.

  const block: IndexerTendermintBlock = IndexerTendermintBlock.decode(
    messageValueBinary,
  );
Committable suggestion (Beta)
Suggested change
if (!message || !message.value || !message.timestamp) {
throw Error('Empty message');
}
const messageValueBinary: Uint8Array = new Uint8Array(message.value);
const block: IndexerTendermintBlock = IndexerTendermintBlock.decode(
messageValueBinary,
);
return block;
}
try {
const block: IndexerTendermintBlock = IndexerTendermintBlock.decode(
messageValueBinary,
);
return block;
} catch (error) {
logger.error({
at: 'getIndexerTendermintBlock',
message: 'Failed to decode message value',
error,
});
return undefined;
}

Comment on lines +98 to +112
_.forEach(indexerTendermintBlock.events, (event: IndexerTendermintEvent) => {
const annotatedEvent:
AnnotatedIndexerTendermintEvent | undefined = annotateIndexerTendermintEvent(
event,
);
if (annotatedEvent === undefined) {
logger.error({
at: 'printMessageAtHeight',
message: 'Failed to parse event',
event,
});
throw Error('Failed to parse event');
}
annotatedEvents.push(annotatedEvent);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

The function printMessageAtHeight throws an error if it fails to annotate an event. However, it does not handle the case where the annotateIndexerTendermintEvent function returns undefined. This could lead to unhandled exceptions if the function fails to annotate an event. Consider adding error handling for this case.

      if (annotatedEvent === undefined) {
        logger.error({
          at: 'printMessageAtHeight',
          message: 'Failed to parse event',
          event,
        });
        throw Error('Failed to parse event');
      }
Committable suggestion (Beta)
Suggested change
_.forEach(indexerTendermintBlock.events, (event: IndexerTendermintEvent) => {
const annotatedEvent:
AnnotatedIndexerTendermintEvent | undefined = annotateIndexerTendermintEvent(
event,
);
if (annotatedEvent === undefined) {
logger.error({
at: 'printMessageAtHeight',
message: 'Failed to parse event',
event,
});
throw Error('Failed to parse event');
}
annotatedEvents.push(annotatedEvent);
});
if (annotatedEvent === undefined) {
logger.error({
at: 'printMessageAtHeight',
message: 'Failed to annotate event',
event,
});
return;
}

Comment on lines +33 to +124
export function annotateIndexerTendermintEvent(
event: IndexerTendermintEvent,
): AnnotatedIndexerTendermintEvent | undefined {
const eventDataBinary: Uint8Array = event.dataBytes;
switch (event.subtype) {
case (DydxIndexerSubtypes.ORDER_FILL.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(OrderFillEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.SUBACCOUNT_UPDATE.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(SubaccountUpdateEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.TRANSFER.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(TransferEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.MARKET.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(MarketEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.STATEFUL_ORDER.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(StatefulOrderEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.FUNDING.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(FundingEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.ASSET.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(AssetCreateEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.PERPETUAL_MARKET.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(PerpetualMarketCreateEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.LIQUIDITY_TIER.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(LiquidityTierUpsertEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.UPDATE_PERPETUAL.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(UpdatePerpetualEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.UPDATE_CLOB_PAIR.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(UpdateClobPairEventV1.decode(eventDataBinary)),
};
}
default: {
const message: string = `Unable to parse event subtype: ${event.subtype}`;
logger.error({
at: 'block-helpers#annotateIndexerTendermintEvent',
message,
});
return undefined;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The annotateIndexerTendermintEvent function is decoding the dataBytes of the event based on its subtype and converting it to a JSON string. This is a good approach for handling different types of events. However, there is a potential performance issue here. Each time a new event comes in, a new Uint8Array is created and assigned to dataBytes, even though the original dataBytes is not used anymore. This could lead to unnecessary memory allocation and garbage collection. Consider setting dataBytes to null instead to free up memory.

-        dataBytes: new Uint8Array(),
+        dataBytes: null,
Committable suggestion (Beta)
Suggested change
export function annotateIndexerTendermintEvent(
event: IndexerTendermintEvent,
): AnnotatedIndexerTendermintEvent | undefined {
const eventDataBinary: Uint8Array = event.dataBytes;
switch (event.subtype) {
case (DydxIndexerSubtypes.ORDER_FILL.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(OrderFillEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.SUBACCOUNT_UPDATE.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(SubaccountUpdateEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.TRANSFER.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(TransferEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.MARKET.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(MarketEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.STATEFUL_ORDER.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(StatefulOrderEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.FUNDING.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(FundingEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.ASSET.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(AssetCreateEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.PERPETUAL_MARKET.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(PerpetualMarketCreateEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.LIQUIDITY_TIER.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(LiquidityTierUpsertEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.UPDATE_PERPETUAL.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(UpdatePerpetualEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.UPDATE_CLOB_PAIR.toString()): {
return {
...event,
dataBytes: new Uint8Array(),
data: JSON.stringify(UpdateClobPairEventV1.decode(eventDataBinary)),
};
}
default: {
const message: string = `Unable to parse event subtype: ${event.subtype}`;
logger.error({
at: 'block-helpers#annotateIndexerTendermintEvent',
message,
});
return undefined;
}
}
}
export function annotateIndexerTendermintEvent(
event: IndexerTendermintEvent,
): AnnotatedIndexerTendermintEvent | undefined {
const eventDataBinary: Uint8Array = event.dataBytes;
switch (event.subtype) {
case (DydxIndexerSubtypes.ORDER_FILL.toString()): {
return {
...event,
dataBytes: null,
data: JSON.stringify(OrderFillEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.SUBACCOUNT_UPDATE.toString()): {
return {
...event,
dataBytes: null,
data: JSON.stringify(SubaccountUpdateEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.TRANSFER.toString()): {
return {
...event,
dataBytes: null,
data: JSON.stringify(TransferEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.MARKET.toString()): {
return {
...event,
dataBytes: null,
data: JSON.stringify(MarketEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.STATEFUL_ORDER.toString()): {
return {
...event,
dataBytes: null,
data: JSON.stringify(StatefulOrderEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.FUNDING.toString()): {
return {
...event,
dataBytes: null,
data: JSON.stringify(FundingEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.ASSET.toString()): {
return {
...event,
dataBytes: null,
data: JSON.stringify(AssetCreateEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.PERPETUAL_MARKET.toString()): {
return {
...event,
dataBytes: null,
data: JSON.stringify(PerpetualMarketCreateEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.LIQUIDITY_TIER.toString()): {
return {
...event,
dataBytes: null,
data: JSON.stringify(LiquidityTierUpsertEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.UPDATE_PERPETUAL.toString()): {
return {
...event,
dataBytes: null,
data: JSON.stringify(UpdatePerpetualEventV1.decode(eventDataBinary)),
};
}
case (DydxIndexerSubtypes.UPDATE_CLOB_PAIR.toString()): {
return {
...event,
dataBytes: null,
data: JSON.stringify(UpdateClobPairEventV1.decode(eventDataBinary)),
};
}
default: {
const message: string = `Unable to parse event subtype: ${event.subtype}`;
logger.error({
at: 'block-helpers#annotateIndexerTendermintEvent',
message,
});
return undefined;
}
}
}

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 1ba769d and 75e8f17.
Files ignored due to filter (1)
  • indexer/services/scripts/package.json
Files selected for processing (1)
  • indexer/services/scripts/src/print-block.ts (1 hunks)
Additional comments: 2
indexer/services/scripts/src/print-block.ts (2)
  • 26-36: The function getIndexerTendermintBlock now handles the case where the IndexerTendermintBlock.decode function fails to decode the message value. This is a good improvement as it prevents unhandled exceptions if the message value is not a valid IndexerTendermintBlock.

  • 96-110: The function printMessageAtHeight now handles the case where the annotateIndexerTendermintEvent function returns undefined. This is a good improvement as it prevents unhandled exceptions if the function fails to annotate an event.

Comment on lines +83 to +122
const indexerTendermintBlock: IndexerTendermintBlock | undefined = getIndexerTendermintBlock(
currentMessage,
);
if (indexerTendermintBlock === undefined) {
return;
}

const currentBlockHeight: number = parseInt(indexerTendermintBlock.height.toString(), 10);
if (currentBlockHeight < targetHeight) {
const offsetToSeek: number = targetHeight - currentBlockHeight + Number(currentMessage.offset);
await seek(BigInt(offsetToSeek));
} else if (currentBlockHeight === targetHeight) {
const annotatedEvents: AnnotatedIndexerTendermintEvent[] = [];
_.forEach(indexerTendermintBlock.events, (event: IndexerTendermintEvent) => {
const annotatedEvent:
AnnotatedIndexerTendermintEvent | undefined = annotateIndexerTendermintEvent(
event,
);
if (annotatedEvent === undefined) {
logger.error({
at: 'printMessageAtHeight',
message: 'Failed to parse event',
event,
});
throw Error('Failed to parse event');
}
annotatedEvents.push(annotatedEvent);
});
const annotatedBlock: AnnotatedIndexerTendermintBlock = {
...indexerTendermintBlock,
events: [],
annotatedEvents,
};
logger.info({
at: 'printMessageAtHeight',
message: 'Printing block',
block: annotatedBlock,
});
await stopConsumer();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The function printMessageAtHeight still does not handle the case where the current block height is greater than the target height. This could lead to unexpected behavior if the target height is less than the current block height. Consider adding a condition to handle this case.

  if (currentBlockHeight < targetHeight) {
    const offsetToSeek: number = targetHeight - currentBlockHeight + Number(currentMessage.offset);
    await seek(BigInt(offsetToSeek));
  } else if (currentBlockHeight === targetHeight) {
Committable suggestion (Beta)
Suggested change
const indexerTendermintBlock: IndexerTendermintBlock | undefined = getIndexerTendermintBlock(
currentMessage,
);
if (indexerTendermintBlock === undefined) {
return;
}
const currentBlockHeight: number = parseInt(indexerTendermintBlock.height.toString(), 10);
if (currentBlockHeight < targetHeight) {
const offsetToSeek: number = targetHeight - currentBlockHeight + Number(currentMessage.offset);
await seek(BigInt(offsetToSeek));
} else if (currentBlockHeight === targetHeight) {
const annotatedEvents: AnnotatedIndexerTendermintEvent[] = [];
_.forEach(indexerTendermintBlock.events, (event: IndexerTendermintEvent) => {
const annotatedEvent:
AnnotatedIndexerTendermintEvent | undefined = annotateIndexerTendermintEvent(
event,
);
if (annotatedEvent === undefined) {
logger.error({
at: 'printMessageAtHeight',
message: 'Failed to parse event',
event,
});
throw Error('Failed to parse event');
}
annotatedEvents.push(annotatedEvent);
});
const annotatedBlock: AnnotatedIndexerTendermintBlock = {
...indexerTendermintBlock,
events: [],
annotatedEvents,
};
logger.info({
at: 'printMessageAtHeight',
message: 'Printing block',
block: annotatedBlock,
});
await stopConsumer();
}
if (currentBlockHeight < targetHeight) {
const offsetToSeek: number = targetHeight - currentBlockHeight + Number(currentMessage.offset);
await seek(BigInt(offsetToSeek));
} else if (currentBlockHeight > targetHeight) {
logger.info({
at: 'printMessageAtHeight',
message: 'Current block height is greater than target height',
currentBlockHeight,
targetHeight,
});
await stopConsumer();
} else if (currentBlockHeight === targetHeight) {

Comment on lines +148 to +158
async function start(height: number): Promise<void> {
logger.info({
at: 'index#start',
message: `Connecting to kafka brokers: ${config.KAFKA_BROKER_URLS}`,
});
await startKafka(height);
logger.info({
at: 'index#start',
message: `Successfully connected to kafka brokers: ${config.KAFKA_BROKER_URLS}`,
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The start function logs the Kafka broker URLs before and after starting Kafka. This could potentially expose sensitive information in the logs. Consider removing or obfuscating these logs.

  logger.info({
    at: 'index#start',
    message: `Connecting to kafka brokers: ${config.KAFKA_BROKER_URLS}`,
  });
  await startKafka(height);
  logger.info({
    at: 'index#start',
    message: `Successfully connected to kafka brokers: ${config.KAFKA_BROKER_URLS}`,
  });
Committable suggestion (Beta)
Suggested change
async function start(height: number): Promise<void> {
logger.info({
at: 'index#start',
message: `Connecting to kafka brokers: ${config.KAFKA_BROKER_URLS}`,
});
await startKafka(height);
logger.info({
at: 'index#start',
message: `Successfully connected to kafka brokers: ${config.KAFKA_BROKER_URLS}`,
});
}
logger.info({
at: 'index#start',
message: `Connecting to kafka brokers`,
});
await startKafka(height);
logger.info({
at: 'index#start',
message: `Successfully connected to kafka brokers`,
});

@dydxwill dydxwill changed the title [IND-387] add script to parse block and return json [IND-387] add script to parse block and print json Oct 25, 2023

import { AnnotatedIndexerTendermintEvent } from './types';

export enum DydxIndexerSubtypes {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: move to types

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

});
}

const args = yargs.options({
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: only if it's easy to do, can we also add support to just parse a block at a particular offset

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this is needed, since all Ender logs printing out offset should also print out block height

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 75e8f17 and be8ed43.
Files selected for processing (2)
  • indexer/services/scripts/src/helpers/block-helpers.ts (1} hunks)
  • indexer/services/scripts/src/helpers/types.ts (1} hunks)
Files skipped from review due to trivial changes (1)
  • indexer/services/scripts/src/helpers/block-helpers.ts
Additional comments: 1
indexer/services/scripts/src/helpers/types.ts (1)
  • 1-23: The new interfaces AnnotatedIndexerTendermintEvent and AnnotatedIndexerTendermintBlock extend the existing IndexerTendermintEvent and IndexerTendermintBlock interfaces respectively. The AnnotatedIndexerTendermintEvent interface includes a new data property of type string. The AnnotatedIndexerTendermintBlock interface includes a new annotatedEvents property which is an array of AnnotatedIndexerTendermintEvent.

The DydxIndexerSubtypes enum is introduced to represent the different subtypes of events that can occur in the system.

These changes seem to be in line with the PR summary and there doesn't appear to be any issues with them. However, ensure that these new interfaces and enum are used correctly in the rest of the codebase.

@dydxwill dydxwill merged commit 02b2ff5 into main Oct 26, 2023
11 checks passed
@dydxwill dydxwill deleted the wl/testscript branch October 26, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants