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

(Don't Merge) SCRIPT COST ERROR - After adding V2 & V3 version of the GiftCard example compiled by Aiken 1.1.2 #444

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lucky777ada
Copy link

Added version V2 & V3 of the updated GiftCard example.

When executed there's an error for the new compiled V2 & V3 scripts:

quicktx.QuickTxBuilder$TxContext (QuickTxBuilder.java:351) - Error while evaluating script cost com.bloxbean.cardano.client.function.exception.TxBuildException: Failed to compute script cost : {"ScriptFailures":{}} at com.bloxbean.cardano.client.function.helper.ScriptCostEvaluators.lambda$evaluateScriptCost$0(ScriptCostEvaluators.java:40) at com.bloxbean.cardano.client.quicktx.QuickTxBuilder$TxContext.lambda$build$3(QuickTxBuilder.java:348) at com.bloxbean.cardano.client.function.TxBuilder.lambda$andThen$0(TxBuilder.java:48) at com.bloxbean.cardano.client.function.TxBuilder.lambda$andThen$0(TxBuilder.java:47) at com.bloxbean.cardano.client.function.TxBuilder.lambda$andThen$0(TxBuilder.java:47) at com.bloxbean.cardano.client.function.TxBuilderContext.build(TxBuilderContext.java:259) at com.bloxbean.cardano.client.quicktx.QuickTxBuilder$TxContext.build(QuickTxBuilder.java:372) at com.bloxbean.cardano.client.quicktx.QuickTxBuilder$TxContext.buildAndSign(QuickTxBuilder.java:389)

aiken.toml

version = "0.0.0"
compiler = "v1.1.2"
plutus = "v3" // & v2 respectively
license = "Apache-2.0"
description = "Aiken contracts for project"

[[dependencies]]
name = "aiken-lang/stdlib"
version = "v2.0.0"
source = "github"

@lucky777ada lucky777ada changed the title SCRIPT COST ERROR - After adding V2 & V3 version of the GiftCard example compiled by Aiken 1.1.2 (Don't Merge) SCRIPT COST ERROR - After adding V2 & V3 version of the GiftCard example compiled by Aiken 1.1.2 Sep 17, 2024
@satran004
Copy link
Member

@lucky777ada

The current AikenScriptUtil, which is part of the aiken-java-binding project, has not yet been updated with the new version of Aiken. This could be the problem. But I think it should work for V2 unless there is also a breaking change for V2.

The Aiken Java binding project upgrade is in progress now.

@satran004
Copy link
Member

@lucky777ada I have pushed a snapshot version of aiken-java-binding with the fix to sontype repository. Can you please try?

Here's the pom.xml details

<dependencies>
...
     <dependency>
            <groupId>com.bloxbean.cardano</groupId>
            <artifactId>aiken-java-binding</artifactId>
            <version>0.0.9-SNAPSHOT</version>
        </dependency>
</dependencies>

<repositories>
        <repository>
            <id>snapshots-repo</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
</repositories>

@lucky777ada
Copy link
Author

Yes, I'll try it and report back.

Regarding your comment:
" But I think it should work for V2 unless there is also a breaking change for V2."

It does work with the V2 you have in the example, but it fails if you compile the same Aiken code with the new compiler even if the target is V2.

So probably there has been a breaking change.

@lucky777ada
Copy link
Author

Alright, tried again with 0.0.9-SNAPSHOT and got the same error:

failedToComputeCost

The transaction that was evaluated:
DEBUG | 2024-09-21 16:26:13 | [Test worker] quicktx.QuickTxBuilder$TxContext (QuickTxBuilder.java:353) - Transaction : { "era" : null, "body" : { "inputs" : [ { "transactionId" : "9d5b52c2ec383ad878f81afca09f27a46450ca9c68a1ec96c3f341ce4a580355", "index" : 0 } ], "outputs" : [ { "address" : "addr_test1qp73ljurtknpm5fgey5r2y9aympd33ksgw0f8rc5khheg83y35rncur9mjvs665cg4052985ry9rzzmqend9sqw0cdksxvefah", "value" : { "coin" : 542576783, "multiAssets" : [ { "policyId" : "e58037324303b2f1eeea19dcf1d5d7feae051b0b69c3111fbb2a45ff", "assets" : [ { "name" : "0x41696b656e4a617661", "value" : 1 } ] }, { "policyId" : "a7fb5c7571c5f8dde6c7e61cfdad0206228b2a3e4d653488b50bd598", "assets" : [ { "name" : "0x41696b656e4a617661", "value" : 1 } ] }, { "policyId" : "f06c1deb21f81d034690b21a10f3991d0be8defc2cd0b38000d97f6c", "assets" : [ { "name" : "0x41696b656e4a617661", "value" : 1 } ] } ] }, "datumHash" : null, "inlineDatum" : null, "scriptRef" : null } ], "fee" : 0, "ttl" : 0, "certs" : [ ], "withdrawals" : [ ], "update" : null, "auxiliaryDataHash" : null, "validityStartInterval" : 0, "mint" : [ { "policyId" : "e58037324303b2f1eeea19dcf1d5d7feae051b0b69c3111fbb2a45ff", "assets" : [ { "name" : "AikenJava", "value" : 1 } ] } ], "scriptDataHash" : null, "collateral" : [ { "transactionId" : "9d5b52c2ec383ad878f81afca09f27a46450ca9c68a1ec96c3f341ce4a580355", "index" : 0 } ], "requiredSigners" : [ ], "networkId" : null, "collateralReturn" : { "address" : "addr_test1qp73ljurtknpm5fgey5r2y9aympd33ksgw0f8rc5khheg83y35rncur9mjvs665cg4052985ry9rzzmqend9sqw0cdksxvefah", "value" : { "coin" : 542576783, "multiAssets" : [ { "policyId" : "a7fb5c7571c5f8dde6c7e61cfdad0206228b2a3e4d653488b50bd598", "assets" : [ { "name" : "0x41696b656e4a617661", "value" : 1 } ] }, { "policyId" : "f06c1deb21f81d034690b21a10f3991d0be8defc2cd0b38000d97f6c", "assets" : [ { "name" : "0x41696b656e4a617661", "value" : 1 } ] } ] }, "datumHash" : null, "inlineDatum" : null, "scriptRef" : null }, "totalCollateral" : 1000000, "referenceInputs" : [ ], "votingProcedures" : null, "proposalProcedures" : null, "currentTreasuryValue" : null, "donation" : null }, "witnessSet" : { "vkeyWitnesses" : [ ], "nativeScripts" : [ ], "bootstrapWitnesses" : [ ], "plutusV1Scripts" : [ ], "plutusDataList" : [ ], "redeemers" : [ { "tag" : "mint", "index" : 0, "data" : { "constructor" : 0, "fields" : [ ] }, "exUnits" : { "mem" : 10000, "steps" : 10000 } } ], "plutusV2Scripts" : [ { "type" : null, "description" : null, "cborHex" : "5902b75902b4010000333232323232323223222533300532323232323232323232532333010300500613232323232325333016300730173754002264a66602e601860306ea80044c8c94ccc070c07c0084c94ccc068cdc39bad301c002480044cdc780080c0a50375c60340022c603a002660160066eb8c070c064dd50008b1804980c1baa3009301837546036603860306ea8c06cc060dd50008b198039bac301a00223375e601260306ea8004014dd5980c980d180d180d180d000980a9baa00d3017301800230160013012375400e2a666020600200c2646464a66602660080022a66602c602a6ea802c540085854ccc04cc02000454ccc058c054dd50058a8010b0b18099baa00a1323232325333018301b00213232533301730083018375401e2a66602e601060306ea8cc0240148cdd79805980d1baa00101515333017300c00113371e00402a29405854ccc05ccdc3800a4002266e3c0080545281bad3018002375c602c0022c60320026600e6eacc060c064c064c064c06400800cdd6180b80098099baa00b375c602a60246ea801c58dc3a400044646600200200644a66602a0022980103d87a8000132325333014300500213374a90001980c00125eb804cc010010004c064008c05c0048c04c00488c94ccc03cc010c040dd50008a5eb7bdb1804dd5980a18089baa001323300100100322533301300114c103d87a800013232323253330143372200e0042a66602866e3c01c0084cdd2a4000660306e980052f5c02980103d87a80001330060060033756602a0066eb8c04c008c05c008c054004dc3a400460166ea8004c038c03c008c034004c034008c02c004c01cdd50008a4c26cac6eb80055cd2ab9d5573caae7d5d02ba1574498010a4941696b656e4a617661004c012bd8799fd8799f58209d5b52c2ec383ad878f81afca09f27a46450ca9c68a1ec96c3f341ce4a580355ff00ff0001", "language" : "PLUTUS_V2" } ], "plutusV3Scripts" : [ ] }, "auxiliaryData" : null, "valid" : true }

Copy link

sonarcloud bot commented Oct 14, 2024

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