Skip to content

Conversation

@iuwqyir
Copy link
Contributor

@iuwqyir iuwqyir commented Feb 5, 2025

TL;DR

Replaced custom BlockTimestamp type with standard time.Time and added chain-specific table configuration support.

What changed?

  • Removed custom BlockTimestamp type and replaced all usages with standard time.Time
  • Added TableConfig and TableOverrideConfig types to support chain-specific configurations
  • Added ChainBasedConfig to ClickhouseConfig for per-chain table customization
  • Introduced default field lists for blocks, transactions, logs, and traces
  • Added methods to handle chain-specific table names and field selections
  • Updated query execution to use chain-specific table names when configured

How to test?

  1. Verify existing timestamps are correctly handled with time.Time
  2. Configure chain-specific table overrides in config:
chainConfig:
  "1":
    blocks:
      tableName: "eth_blocks"
      defaultSelectFields: ["chain_id", "block_number", "hash"]
  1. Verify queries use correct table names and fields for specified chains
  2. Confirm default behavior remains unchanged for chains without specific configurations

Why make this change?

  • Simplifies timestamp handling by using standard Go time.Time type
  • Enables chain-specific table configurations for more flexible deployments, especially during migrations
  • Allows customization of field selection and table names per chain
  • Improves query optimization by allowing selective field retrieval

Copy link
Contributor Author

iuwqyir commented Feb 5, 2025

@iuwqyir iuwqyir mentioned this pull request Feb 5, 2025
@iuwqyir iuwqyir requested a review from a team February 5, 2025 11:56
@iuwqyir iuwqyir marked this pull request as ready for review February 5, 2025 11:56
@iuwqyir iuwqyir force-pushed the 02-05-chain_based_table_name_and_default_columns_configuration branch from 4daf88c to cdb704c Compare February 5, 2025 13:39
@iuwqyir iuwqyir force-pushed the 02-05-chain_based_table_name_and_default_columns_configuration branch from cdb704c to d544409 Compare February 6, 2025 11:59
@iuwqyir iuwqyir force-pushed the 02-04-use_versionedcollapsingmergetree_and_insert_based_deletes branch from 4d85f84 to 7b87661 Compare February 6, 2025 12:16
@iuwqyir iuwqyir force-pushed the 02-05-chain_based_table_name_and_default_columns_configuration branch from d544409 to f38472e Compare February 6, 2025 12:17
@iuwqyir iuwqyir force-pushed the 02-04-use_versionedcollapsingmergetree_and_insert_based_deletes branch from 7b87661 to 08bc042 Compare February 6, 2025 12:34
@iuwqyir iuwqyir force-pushed the 02-05-chain_based_table_name_and_default_columns_configuration branch from f38472e to 52fa30c Compare February 6, 2025 12:34
@iuwqyir iuwqyir merged commit 672a462 into 02-04-use_versionedcollapsingmergetree_and_insert_based_deletes Feb 6, 2025
4 of 5 checks passed
@iuwqyir iuwqyir deleted the 02-05-chain_based_table_name_and_default_columns_configuration branch February 6, 2025 14:13
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.

3 participants