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

indexer-alt: generate example config #20464

Merged
merged 3 commits into from
Nov 29, 2024
Merged

indexer-alt: generate example config #20464

merged 3 commits into from
Nov 29, 2024

Conversation

amnn
Copy link
Member

@amnn amnn commented Nov 28, 2024

Description

Using the default impl for IndexerConfig to generate the output for generate-config lead to sub-par results because most of its fields are optional, and so will not show up.

This change introduces an explicit example function that is responsible for generating a non-default output that does a better job of documenting what fields and pipelines are available to configure.

Test plan

Generate a config:

sui$ cargo run -p sui-indexer-alt -- generate-config

[ingestion]
checkpoint-buffer-size = 5000
ingest-concurrency = 200
retry-interval-ms = 200

[consistency]
consistent-pruning-interval-ms = 300000
pruner-delay-ms = 120000

[committer]
write-concurrency = 5
collect-interval-ms = 500
watermark-interval-ms = 500

[pruner]
interval-ms = 300000
delay-ms = 120000
retention = 4000000
max-chunk-size = 2000

[pipeline.sum_coin_balances]

[pipeline.wal_coin_balances]

[pipeline.sum_obj_types]

[pipeline.wal_obj_types]

[pipeline.sum_displays]

[pipeline.sum_packages]

[pipeline.ev_emit_mod]

[pipeline.ev_struct_inst]

[pipeline.kv_checkpoints]

[pipeline.kv_epoch_ends]

[pipeline.kv_epoch_starts]

[pipeline.kv_feature_flags]

[pipeline.kv_objects]

[pipeline.kv_protocol_configs]

[pipeline.kv_transactions]

[pipeline.obj_versions]

[pipeline.tx_affected_addresses]

[pipeline.tx_affected_objects]

[pipeline.tx_balance_changes]

[pipeline.tx_calls]

[pipeline.tx_digests]

[pipeline.tx_kinds]

Stack


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

@amnn amnn self-assigned this Nov 28, 2024
Copy link

vercel bot commented Nov 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 29, 2024 5:14pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Nov 29, 2024 5:14pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Nov 29, 2024 5:14pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Nov 29, 2024 5:14pm

@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env November 28, 2024 13:53 — with GitHub Actions Inactive
amnn added 3 commits November 29, 2024 17:07
## Description

Using the default impl for `IndexerConfig` to generate the output for
`generate-config` lead to sub-par results because most of its fields are
optional, and so will not show up.

This change introduces an explicit `example` function that is
responsible for generating a non-default output that does a better job
of documenting what fields and pipelines are available to configure.

## Test plan

Generate a config:

```
sui$ cargo run -p sui-indexer-alt -- generate-config

[ingestion]
checkpoint-buffer-size = 5000
ingest-concurrency = 200
retry-interval-ms = 200

[consistency]
consistent-pruning-interval-ms = 300000
pruner-delay-ms = 120000

[committer]
write-concurrency = 5
collect-interval-ms = 500
watermark-interval-ms = 500

[pruner]
interval-ms = 300000
delay-ms = 120000
retention = 4000000
max-chunk-size = 2000

[pipeline.sum_coin_balances]

[pipeline.wal_coin_balances]

[pipeline.sum_obj_types]

[pipeline.wal_obj_types]

[pipeline.sum_displays]

[pipeline.sum_packages]

[pipeline.ev_emit_mod]

[pipeline.ev_struct_inst]

[pipeline.kv_checkpoints]

[pipeline.kv_epoch_ends]

[pipeline.kv_epoch_starts]

[pipeline.kv_feature_flags]

[pipeline.kv_objects]

[pipeline.kv_protocol_configs]

[pipeline.kv_transactions]

[pipeline.obj_versions]

[pipeline.tx_affected_addresses]

[pipeline.tx_affected_objects]

[pipeline.tx_balance_changes]

[pipeline.tx_calls]

[pipeline.tx_digests]

[pipeline.tx_kinds]

```
## Description
Replace use of macros with a `Merge` trait.

## Test plan
CI
## Description
Avoid catch-all (`..`) patterns, and be explicit about the `extra`
pattern, so that if we introduce new fields in future, we notice.

## Test plan
CI
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env November 29, 2024 17:09 — with GitHub Actions Inactive
Base automatically changed from amnn/idx-extra to amnn/idx-cfg-ms November 29, 2024 18:17
@amnn amnn merged commit 18b79b7 into amnn/idx-cfg-ms Nov 29, 2024
49 checks passed
@amnn amnn deleted the amnn/idx-eg-cfg branch November 29, 2024 18:17
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.

2 participants