Skip to content

Conversation

AmbientTea
Copy link
Contributor

@AmbientTea AmbientTea commented Aug 6, 2025

Description

  • Adds db-sync queries that use the consumed_by_tx_id column in tx_out instead of joins with tx_in table. This column is populated when tx-out.value in db-sync config is set to "consumed"
  • Adds enum TxInConfiguration { Legacy, Consumed } which signifies which set of queries should be used.
  • All data sources that use queries that touch transaction inputs now select the query to use based on their configured TxInConfiguration
  • TxInConfiguration value is determined by checking whether tx_in table exists and is populated
  • All relevant tests are run against two sets of db migrations, this is where the bulk of LOC changes in this PR come from

Checklist

  • Commit sequence broadly makes sense and commits have useful messages.
  • The size limit of 400 LOC isn't needlessly exceeded
  • The PR refers to a JIRA ticket (if one exists)
  • New tests are added if needed and existing tests are updated.
  • New code is documented and existing documentation is updated.
  • Relevant logging and metrics added
  • Any changes are noted in the changelog.md for affected crate
  • Self-reviewed the diff

@LGLO
Copy link
Contributor

LGLO commented Aug 7, 2025

Adding new queries instead of replacing existing ones and making decision in runtime which to use will cost us less than all the fallout of in-place change.

@AmbientTea AmbientTea force-pushed the ETCM-12220-use-tx-out-consumed-db-sync-option branch 2 times, most recently from 5ca2c0d to 1b7d2ad Compare August 8, 2025 14:05
@AmbientTea AmbientTea marked this pull request as ready for review August 8, 2025 14:27
@AmbientTea AmbientTea changed the title change: ETCM-12220 use tx-out.value = "consumed" Db-Sync option change: ETCM-12220 Support tx-out.value = "consumed" Db-Sync option Aug 8, 2025
@AmbientTea AmbientTea force-pushed the ETCM-12220-use-tx-out-consumed-db-sync-option branch 2 times, most recently from c9d44a5 to 7a92ee2 Compare August 11, 2025 11:49
@AmbientTea AmbientTea requested review from jankun4, LGLO and kpinter-iohk and removed request for jankun4 and LGLO August 12, 2025 13:08
@AmbientTea AmbientTea force-pushed the ETCM-12220-use-tx-out-consumed-db-sync-option branch from 40cf253 to 7a92ee2 Compare August 12, 2025 14:30
@AmbientTea AmbientTea force-pushed the ETCM-12220-use-tx-out-consumed-db-sync-option branch 7 times, most recently from e2bf574 to f94aa34 Compare August 20, 2025 08:13
Copy link
Contributor

@neotheprogramist neotheprogramist left a comment

Choose a reason for hiding this comment

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

LGTM, but what happens if insert_options.tx_output.value option is not present, do we have any idea how to handle it or such situation is impossible?

@AmbientTea AmbientTea force-pushed the ETCM-12220-use-tx-out-consumed-db-sync-option branch 4 times, most recently from 152b29e to 2924e11 Compare August 20, 2025 12:21
@AmbientTea AmbientTea force-pushed the ETCM-12220-use-tx-out-consumed-db-sync-option branch from 2924e11 to 08d723d Compare August 25, 2025 07:38
Copy link
Contributor

@LGLO LGLO left a comment

Choose a reason for hiding this comment

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

Please fill changelog and docs

@AmbientTea
Copy link
Contributor Author

Please fill changelog and docs

Added changelog. The docs are already updated.

@AmbientTea AmbientTea requested a review from LGLO August 25, 2025 08:06
Copy link
Contributor

@LGLO LGLO left a comment

Choose a reason for hiding this comment

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

Just please fix changelog, the config field name is invalid there

@AmbientTea AmbientTea force-pushed the ETCM-12220-use-tx-out-consumed-db-sync-option branch from f3863f7 to 43d8b8a Compare August 26, 2025 08:15
@AmbientTea AmbientTea enabled auto-merge (squash) August 26, 2025 08:16
@AmbientTea AmbientTea force-pushed the ETCM-12220-use-tx-out-consumed-db-sync-option branch from fb29125 to 306cd7b Compare August 27, 2025 13:17
@AmbientTea AmbientTea force-pushed the ETCM-12220-use-tx-out-consumed-db-sync-option branch from 705e05f to c6fe667 Compare August 28, 2025 08:06
@AmbientTea AmbientTea merged commit 5d78e39 into master Aug 28, 2025
29 checks passed
@AmbientTea AmbientTea deleted the ETCM-12220-use-tx-out-consumed-db-sync-option branch August 28, 2025 12:35
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