Open mkoura opened 3 months ago
First step here can be to write a unit test to verify the bug. The fix can be combined with https://github.com/IntersectMBO/cardano-db-sync/issues/1746, which simplifies the code that pottentially has the bug.
@mkoura: Have you been able to reproduce this in Sanchonet?
OS Fedora 40
Versions The
db-sync
version (egcardano-db-sync --version
): 13.4.0.0 PostgreSQL version: 14.9Build/Install Method The method you use to build or install
cardano-db-sync
: nixRun method The method you used to run
cardano-db-sync
(eg Nix/Docker/systemd/none): shell scriptAdditional context
Problem Report I have a test where a PlutusV2 certificate script address is registered and delegated in a single tx. Therefore the same PlutusV2 script is used twice in the same tx. In the test, I check the cost reported by
cardano-cli conway transaction build
and compare it to data in db-sync. In Conway era, the cost for one use of the script differs from whatcardano-cli
is reporting.Cost reported by
cardano-cli conway transaction build
:Cost reported by db-sync:
It looks like db-sync is reporting the same cost for both usages of the same script. Is it possible that db-sync uses data type that allows just single record for each script hash?
There was a change in behavior in Conway vs Babbage: In Babbage, there is only a single cost when the same Plutus script is used multiple times. Also the script and redeemer is specified only once when building the Tx in Babbage, even if the script and redeemer is used multiple times in the Tx. In Conway, the script and redeemer needs to be specified for each use, even if the script is the same.
The transaction is built in Conway like this:
Files used for building the Tx: dbsync_reg_deleg_cost_issue.tar.gz