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

Ml/plt 5384 mintburn dbsync compare #84

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

eyeinsky
Copy link
Contributor

@eyeinsky eyeinsky commented Jun 30, 2023

Status: figuring out redeemers is still in progress, but the rest passes the test.


PLT-5384: Main addition is this test here which:

  • gets a random slot from an existing Marconi mintburn.db
  • gets [TxMintRow] for that slot
  • gets [TxMintRow] from a preexisting dbsync postgres database for that slot as well. (The sql query to get these from postgres is this one, confirmed correctness of this on cardano-db-sync's slack channel)
  • compares them

Managed to find and fix a bug.

This test is meant to be run only manually as there are no pre-existing Marconi nor dbsync databases around in CI. Since the entire cabal component is set to "not buildable" with a flag. To build/run/repl it locally one needs to add --flag '-ci' to the cabal cli, so for example

  • cabal build marconi-chain-index-test-compare-cardano-db-sync --flag '-ci'
  • cabal repl marconi-chain-index-test-compare-cardano-db-sync --flag '-ci'
  • cabal run marconi-chain-index-test-compare-cardano-db-sync --flag '-ci'

will work.


Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense and have useful messages
    • Important changes are reflected in changelog.d of the affected packages
    • Relevant tickets are mentioned in commit messages
  • PR
    • (For external contributions) Corresponding issue exists and is linked in the description
    • Targeting main unless this is a cherry-pick backport
    • Self-reviewed the diff
    • Useful pull request description
    • If relevant, reference the ADR in the PR and reference the PR in the ADR
    • Reviewer requested

eyeinsky added 2 commits June 26, 2023 12:55
The query only exposes a way to get all mint/burn events for slot as
upper bound.
@eyeinsky eyeinsky force-pushed the ml/plt-5384--mintburn-dbsync-compare branch from 42f3d88 to 6648c3e Compare June 30, 2023 09:32
@eyeinsky eyeinsky requested review from berewt and koslambrou June 30, 2023 09:43
Apparently, I made it myself already in
51fe6ec Add MintBurn indexer (#913)
@eyeinsky eyeinsky force-pushed the ml/plt-5384--mintburn-dbsync-compare branch 2 times, most recently from 3f35049 to 54acfe3 Compare July 4, 2023 17:03
@eyeinsky eyeinsky force-pushed the ml/plt-5384--mintburn-dbsync-compare branch from 54acfe3 to 8098347 Compare July 5, 2023 08:48
@eyeinsky
Copy link
Contributor Author

eyeinsky commented Jul 5, 2023

@koslambrou @berewt So it looks like I won't be able to finish this ticket.

The issue that remains is that redeemer hash and data don't always match between marconi and dbsync (if you set it to Nothing on both marconi and dbsync results then the test succeeds). The funny part being that they sometimes don't match. Might be worth it to double-check the sql query with dbsync team and also and maybe ledger or plutus-core team on whether the redeemer we save is correct.

There are TODO items in the test which help to see where it goes wrong.

How to run the test:

  • sync mintburn indexer on preprod
  • sync dbsync on preprod
  • set env variables
  • (run the test as described in issue description)

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.

1 participant