-
Notifications
You must be signed in to change notification settings - Fork 490
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
base: master
Are you sure you want to change the base?
Conversation
466fd50
to
5ba0a9a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6015 +/- ##
==========================================
+ Coverage 51.84% 52.03% +0.19%
==========================================
Files 643 643
Lines 86384 86772 +388
==========================================
+ Hits 44783 45152 +369
- Misses 38737 38753 +16
- Partials 2864 2867 +3 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Jason Paulos <jasonpaulos@users.noreply.github.com>
Co-authored-by: Jason Paulos <jasonpaulos@users.noreply.github.com> Co-authored-by: John Jannotti <jannotti@gmail.com>
In 292a9b9 I updated the API model to avoid using If I print the raw response I see this:
So for some reason // PreEncodedSimulateTxnResult mirrors model.SimulateTransactionResult
type PreEncodedSimulateTxnResult struct {
Txn PreEncodedTxInfo `codec:"txn-result"`
AppBudgetConsumed *uint64 `codec:"app-budget-consumed,omitempty"`
LogicSigBudgetConsumed *uint64 `codec:"logic-sig-budget-consumed,omitempty"`
TransactionTrace *model.SimulationTransactionExecTrace `codec:"exec-trace,omitempty"`
UnnamedResourcesAccessed *model.SimulateUnnamedResourcesAccessed `codec:"unnamed-resources-accessed,omitempty"`
FixedSigner *string `codec:"fixed-signer,omitempty"`
PopulatedResourceArrays *model.ResourceArrays `codec:"populated-resource-arrays,omitempty"`
} Any ideas on what might be happening here? |
It almost seems like the |
At a glance it seems to me like you might have a bug somewhere where you're assigning Where are you printing the raw response? |
Edit2: The error is actually in simulate. |
exmpty box ref is expected because the box size is 1025
After having this on the backburner for awhile I've come back to working on this and discovered why I was slow to make progress once I started to implement the endpoint. I was making two mistakes
Now with 41d63dd all tests are passing, although I am experiencing an intermittent issue with database tables being locked when testing, which is seemingly causing a tracked app to be missing
Here is a gist showing the full output with 2/10 runs failing because of the above: https://gist.github.com/joe-p/860cf28908a99db2f58c5010cb378894 I have not yet tried to reproduce on the e2e tests, but I was running them extensively last week and never saw this issue. Once this issue is resolved the only remaining work is to make some smaller unit tests to test the "bad" cases and make sure things fail gracefully. |
as per the comment, these checks should never be needed due to the logic in eval context, but felt safer to add just in case
previously non appls weren't properly added to the populator, meaning their fields were not accounted for when checking for availability. This is actually probably fine since these sorts of duplicates should be prevented by the logic in evalcontext, but as mentioned in previous commits it feels safer to check here just in case
I believe all comments have been addressed at this point and test coverage is near 100%. The only problem is I'm still occasionally getting |
Summary
When a user calls simulate with
UnnamedResources
enabled, simulate should suggest to the user how they can populate the resource arrays in their transactions to properly send the transaction group to the network.Test Plan
/simulate
endpoint with ResourcePopulator functionalityledger/simulation/resources.go
coverage