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

algod: Delete deprecated cost field in dyrun response and mapping field in sourcemap #4875

Merged
merged 4 commits into from Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions cmd/goal/clerk.go
Expand Up @@ -1229,9 +1229,6 @@ var dryrunRemoteCmd = &cobra.Command{
trace = *txnResult.LogicSigTrace
}
}
if txnResult.Cost != nil {
fmt.Fprintf(os.Stdout, "tx[%d] cost: %d\n", i, *txnResult.Cost)
algochoi marked this conversation as resolved.
Show resolved Hide resolved
}
if txnResult.BudgetConsumed != nil {
fmt.Fprintf(os.Stdout, "tx[%d] budget consumed: %d\n", i, *txnResult.BudgetConsumed)
}
Expand Down
4 changes: 0 additions & 4 deletions daemon/algod/api/algod.oas2.json
Expand Up @@ -3223,10 +3223,6 @@
"budget-consumed": {
"description": "Budget consumed during execution of app call transaction.",
"type": "integer"
},
"cost": {
"description": "Net cost of app execution. Field is DEPRECATED and is subject for removal. Instead, use `budget-added` and `budget-consumed.",
"type": "integer"
}
}
},
Expand Down
4 changes: 0 additions & 4 deletions daemon/algod/api/algod.oas3.yml
Expand Up @@ -1635,10 +1635,6 @@
"description": "Budget consumed during execution of app call transaction.",
"type": "integer"
},
"cost": {
"description": "Net cost of app execution. Field is DEPRECATED and is subject for removal. Instead, use `budget-added` and `budget-consumed.",
"type": "integer"
},
"disassembly": {
"description": "Disassembled program line by line.",
"items": {
Expand Down
3 changes: 0 additions & 3 deletions daemon/algod/api/server/v2/dryrun.go
Expand Up @@ -554,11 +554,8 @@ func doDryrunRequest(dr *DryrunRequest, response *model.DryrunResponse) {
// This is necessary because the fields can only be represented as unsigned
// integers, so a negative cost would underflow. The two fields also provide
// more information, which can be useful for testing purposes.
// cost = budgetConsumed - budgetAdded
netCost := uint64(cost)
budgetAdded := uint64(proto.MaxAppProgramCost * numInnerTxns(delta))
budgetConsumed := uint64(cost) + budgetAdded
result.Cost = &netCost
result.BudgetAdded = &budgetAdded
result.BudgetConsumed = &budgetConsumed
maxCurrentBudget = pooledAppBudget
Expand Down
339 changes: 169 additions & 170 deletions daemon/algod/api/server/v2/generated/data/routes.go

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions daemon/algod/api/server/v2/generated/model/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

337 changes: 168 additions & 169 deletions daemon/algod/api/server/v2/generated/nonparticipating/private/routes.go

Large diffs are not rendered by default.

447 changes: 223 additions & 224 deletions daemon/algod/api/server/v2/generated/nonparticipating/public/routes.go

Large diffs are not rendered by default.

341 changes: 170 additions & 171 deletions daemon/algod/api/server/v2/generated/participating/private/routes.go

Large diffs are not rendered by default.

355 changes: 177 additions & 178 deletions daemon/algod/api/server/v2/generated/participating/public/routes.go

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions data/transactions/logic/sourcemap.go
Expand Up @@ -36,9 +36,7 @@ type SourceMap struct {
SourceRoot string `json:"sourceRoot,omitempty"`
Sources []string `json:"sources"`
Names []string `json:"names"`
// Mapping field is deprecated. Use `Mappings` field instead.
Mapping string `json:"mapping"`
Mappings string `json:"mappings"`
Mappings string `json:"mappings"`
}

// GetSourceMap returns a struct containing details about
Expand All @@ -64,11 +62,9 @@ func GetSourceMap(sourceNames []string, offsetToLine map[int]int) SourceMap {
}

return SourceMap{
Version: sourceMapVersion,
Sources: sourceNames,
Names: []string{}, // TEAL code does not generate any names.
// Mapping is deprecated, and only for backwards compatibility.
Mapping: strings.Join(pcToLine, ";"),
Version: sourceMapVersion,
Sources: sourceNames,
Names: []string{}, // TEAL code does not generate any names.
Mappings: strings.Join(pcToLine, ";"),
}
}
Expand Down