Closed barnjamin closed 1 year ago
Yes, that cast is giving the huge u64. The underlying problem is that the way we track the cost of a transaction doesn't work in the new world in which transactions can increased their budget by issuing inner app calls. We calculate cost as "starting budget - ending budget". So, if a call adds more budget that it consumes, the answer is negative.
I think I'm actually in favor of reporting this as a negative cost. That would mean changing the type of the return value to i64 or just int. Not sure how much that messes with backward compatibility.
Subject of the issue
Running some dryrun request against the algod /v2/teal/dryrun endpoint results in a cost close to MaxUint64.
Dryrun Request and Dryrun Response included in zipped file dryruns.zip
Its likely the uint64 cast of the cost determined rolled some negative number past zero https://github.com/algorand/go-algorand/blob/master/daemon/algod/api/server/v2/dryrun.go#L542
Your environment
sandbox with go-algorand 3.5.0
Steps to reproduce
Expected behaviour
Actual cost up to error is reported
Actual behaviour
Wild cost reported