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

simulate: resource population #6015

Draft
wants to merge 35 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5ba0a9a
ResourcePopulator
joe-p Jun 5, 2024
028b8c4
TestPopulatorWithGlobalResources (arrays only)
joe-p Jun 6, 2024
941ba6e
test addBox
joe-p Jun 6, 2024
a69091c
use ElementsMatch
joe-p Jun 6, 2024
d9e77ef
addHolding
joe-p Jun 6, 2024
4667647
test variable renaming
joe-p Jun 6, 2024
cbd1d8a
appLocals
joe-p Jun 6, 2024
d79780f
restore default limits
joe-p Jun 6, 2024
e6d59ba
fix rekey field
joe-p Jun 6, 2024
54cd38c
populate with static properties and remove zeroAddr
joe-p Jun 6, 2024
673b03d
empty boxes
joe-p Jun 6, 2024
ceddaa2
ensure duplicates are removed
joe-p Jun 6, 2024
62213a0
overflow txn resources
joe-p Jun 6, 2024
f616449
use ConsensusParams
joe-p Jun 6, 2024
6a4f1ee
fix empty box count
joe-p Jun 6, 2024
0524c3c
golangci-lint
joe-p Jun 6, 2024
73e5b4c
Merge branch 'master' into feat/populate_resources
joe-p Jun 14, 2024
6d8c161
PopulateResourceArrays in simulate (untested)
joe-p Jun 15, 2024
022c565
populate from ResourceTracker
joe-p Jun 18, 2024
93dd4e9
initial TestPopulateResources
joe-p Jun 18, 2024
3f78752
group sharing and no group sharing TestPopulateResources
joe-p Jun 18, 2024
359b5b0
test with non appl in group
joe-p Jun 19, 2024
2229b0a
modify visibility on resource pop stuff
joe-p Jun 19, 2024
ec7a36a
remove duplicate partitiontest.PartitionTest(t)
joe-p Jun 19, 2024
351f915
don't make RekeyTo address available
joe-p Jun 19, 2024
99abd2f
add PopulateResourceArrays to simulate API (WIP)
joe-p Jul 24, 2024
96f1af1
Apply suggestions from code review
joe-p Oct 2, 2024
02534ae
Apply suggestions from code review
joe-p Oct 2, 2024
0815e29
PopulateResourceArrays -> PopulateResources
joe-p Oct 2, 2024
b4f7f54
static -> prefilled
joe-p Oct 2, 2024
e665817
replace ifs with switch
joe-p Oct 2, 2024
c9e6e5d
hasAccount short circuit logic
joe-p Oct 2, 2024
2ea34f2
check for room and return error in add... methods
joe-p Oct 2, 2024
93e7b81
mixed resources test
joe-p Oct 2, 2024
292a9b9
use arrays in txn and group result rather than map[int] for API (WIP)
joe-p Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3948,6 +3948,10 @@
"fix-signers": {
"description": "If true, signers for transactions that are missing signatures will be fixed during evaluation.",
"type": "boolean"
},
"populate-resources": {
"description": "If true, return populated resource arrays for each transaction based on unnamed resources",
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -4230,7 +4234,40 @@
}
}
},
"SimulateTransactionGroupResult": {
"ResourceArrays": {
"description": "Resource arrays that are required for a transaction",
"type": "object",
"properties": {
"accounts": {
"type": "array",
"items": {
"type": "string",
"x-algorand-format": "Address"
}
},
"assets": {
"type": "array",
"items": {
"type": "integer",
"x-algorand-format": "uint64"
}
},
"apps": {
"type": "array",
"items": {
"type": "integer",
"x-algorand-format": "uint64"
}
},
"boxes": {
"type": "array",
"items": {
"$ref": "#/definitions/BoxReference"
}
}
}
},
"SimulateTransactionGroupResult": {
"description": "Simulation result for an atomic transaction group",
"type": "object",
"required": [
Expand Down Expand Up @@ -4265,6 +4302,13 @@
},
"unnamed-resources-accessed": {
"$ref": "#/definitions/SimulateUnnamedResourcesAccessed"
},
"extra-resource-arrays": {
"description": "Present if populate-resource-arrays is true in the request and additional tranactions are needed to name all the accessed resources.",
"type": "array",
"items": {
"$ref": "#/definitions/ResourceArrays"
}
}
}
},
Expand Down Expand Up @@ -4296,6 +4340,10 @@
"description": "The account that needed to sign this transaction when no signature was provided and the provided signer was incorrect.",
"type": "string",
"x-algorand-format": "Address"
},
"populated-resource-arrays": {
"description": "Present if populate-resource-arrays is true in the request. In this case, it will be all of the resources this transaction needs to be evaluated.",
"$ref": "#/definitions/ResourceArrays"
}
}
},
Expand Down
47 changes: 47 additions & 0 deletions daemon/algod/api/algod.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2250,6 +2250,39 @@
],
"type": "object"
},
"ResourceArrays": {
"description": "Resource arrays that are required for a transaction",
"properties": {
"accounts": {
"items": {
"type": "string",
"x-algorand-format": "Address"
},
"type": "array"
},
"apps": {
"items": {
"type": "integer",
"x-algorand-format": "uint64"
},
"type": "array"
},
"assets": {
"items": {
"type": "integer",
"x-algorand-format": "uint64"
},
"type": "array"
},
"boxes": {
"items": {
"$ref": "#/components/schemas/BoxReference"
},
"type": "array"
}
},
"type": "object"
},
"ScratchChange": {
"description": "A write operation into a scratch slot.",
"properties": {
Expand Down Expand Up @@ -2306,6 +2339,10 @@
"description": "If true, signers for transactions that are missing signatures will be fixed during evaluation.",
"type": "boolean"
},
"populate-resources": {
"description": "If true, return populated resource arrays for each transaction based on unnamed resources",
"type": "boolean"
},
"round": {
"description": "If provided, specifies the round preceding the simulation. State changes through this round will be used to run this simulation. Usually only the 4 most recent rounds will be available (controlled by the node config value MaxAcctLookback). If not specified, defaults to the latest available round.",
"type": "integer"
Expand Down Expand Up @@ -2375,6 +2412,13 @@
"description": "Total budget consumed during execution of app calls in the transaction group.",
"type": "integer"
},
"extra-resource-arrays": {
"description": "Present if populate-resource-arrays is true in the request and additional transactions with the following resources need to be added to the transaction group.",
"items": {
"$ref": "#/components/schemas/ResourceArrays"
},
"type": "array"
},
"failed-at": {
"description": "If present, indicates which transaction in this group caused the failure. This array represents the path to the failing transaction. Indexes are zero based, the first element indicates the top-level transaction, and successive elements indicate deeper inner transactions.",
"items": {
Expand Down Expand Up @@ -2421,6 +2465,9 @@
"description": "Budget used during execution of a logic sig transaction.",
"type": "integer"
},
"populated-resource-arrays": {
"$ref": "#/components/schemas/ResourceArrays"
},
"txn-result": {
"$ref": "#/components/schemas/PendingTransactionResponse"
},
Expand Down
124 changes: 63 additions & 61 deletions daemon/algod/api/server/v2/generated/data/routes.go

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

Loading