-
Notifications
You must be signed in to change notification settings - Fork 2
feat: adds a cctp finalizer mode #562
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
base: stage
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ export type Config = { | |
| enableBundleBuilder: boolean; | ||
| cctpIndexerChainIds: number[]; | ||
| enableCctpFinalizer: boolean; | ||
| cctpFinalizerMode: CctpFinalizerMode; | ||
| pubSubCctpFinalizerTopic: string; | ||
| pubSubGcpProjectId: string; | ||
| enableOftIndexer: boolean; | ||
|
|
@@ -69,6 +70,12 @@ export type RetryProviderConfig = { | |
|
|
||
| export type Env = Record<string, string | undefined>; | ||
|
|
||
| export enum CctpFinalizerMode { | ||
| Off = "off", | ||
| Full = "full", | ||
| FetchAttestationOnly = "fetch-attestation-only", | ||
| } | ||
|
|
||
| export function parseRedisConfig(env: Env): RedisConfig { | ||
| const { REDIS_HOST, REDIS_PORT } = env; | ||
| assert(REDIS_HOST, "requires REDIS_HOST"); | ||
|
|
@@ -232,6 +239,26 @@ export function envToConfig(env: Env): Config { | |
| const enableCctpFinalizer = env.ENABLE_CCTP_FINALIZER | ||
| ? env.ENABLE_CCTP_FINALIZER === "true" | ||
| : false; | ||
|
Comment on lines
239
to
241
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we good to remove this? |
||
| let cctpFinalizerMode: CctpFinalizerMode = CctpFinalizerMode.Off; | ||
|
|
||
| if (env.CCTP_FINALIZER_MODE) { | ||
| if ( | ||
| env.CCTP_FINALIZER_MODE === "full" || | ||
| env.CCTP_FINALIZER_MODE === "fetch-attestation-only" || | ||
| env.CCTP_FINALIZER_MODE === "off" | ||
| ) { | ||
| cctpFinalizerMode = env.CCTP_FINALIZER_MODE as CctpFinalizerMode; | ||
| } else { | ||
| throw new Error( | ||
| `Invalid CCTP_FINALIZER_MODE: ${env.CCTP_FINALIZER_MODE}. Must be one of 'off', 'full', 'fetch-attestation-only'`, | ||
| ); | ||
| } | ||
| } else if (env.ENABLE_CCTP_FINALIZER) { | ||
| cctpFinalizerMode = | ||
| env.ENABLE_CCTP_FINALIZER === "true" | ||
| ? CctpFinalizerMode.Full | ||
| : CctpFinalizerMode.Off; | ||
| } | ||
|
Comment on lines
+256
to
+261
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we remove the support for ENABLE_CCTP_FINALIZER env entirely?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are not removing the support for |
||
| const pubSubCctpFinalizerTopic = env.PUBSUB_CCTP_FINALIZER_TOPIC ?? ""; | ||
| const pubSubGcpProjectId = env.PUBSUB_GCP_PROJECT_ID ?? ""; | ||
| const enableBundleIncludedEventsService = | ||
|
|
@@ -293,6 +320,7 @@ export function envToConfig(env: Env): Config { | |
| cctpIndexerChainIds, | ||
| enableOftIndexer, | ||
| enableCctpFinalizer, | ||
| cctpFinalizerMode, | ||
| pubSubCctpFinalizerTopic, | ||
| pubSubGcpProjectId, | ||
| webhookConfig, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mode is attesation-only here