-
Notifications
You must be signed in to change notification settings - Fork 479
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: fix signers #5942
simulate: fix signers #5942
Conversation
@jasonpaulos let me know what you think about this general approach. If it looks good, I can work on the endpoint and more tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The direction makes sense to me. This will need extensive testing.
What are you thinking about for how to enable this? At the moment my preference would be a boolean alongside AllowEmptySignatures
, which you'd only be allowed to set if AllowEmptySignatures
is also set
@jasonpaulos this comment in the test you initially wrote got me thinking... Should we expect the transaction group to be modified in the response? Is there any precedent for this? I feel like there is value in seeing the txn group as it was given and also seeing what was modified. Perhaps an additional field that indicates a changed signer per txn, but the actual transaction object remains unchanged? |
Also I'm switching from the terminology "fix auth addr" to "fix signer" to avoid confusion between the auth addr for a given account in the ledger and the signer for the transaction, making it clear the ledger remains unchanged and its just txns that are getting modified. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5942 +/- ##
==========================================
- Coverage 55.86% 55.85% -0.02%
==========================================
Files 482 482
Lines 68475 68538 +63
==========================================
+ Hits 38253 38280 +27
- Misses 27620 27646 +26
- Partials 2602 2612 +10 ☔ View full report in Codecov by Sentry. |
I agree that it would be preferable to not modify the transactions as given, and instead provide an additional response field with the overridden signer. The only problem is that the response structure may make it difficult to associate this additional information with inner transactions. |
Unless you are thinking of functionality that I am not, we're only modifying the signers on the outer transactions, so we only need to add additional information to the outers. |
Good point, this plan should have no problems then |
@jasonpaulos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, but I left a few asks and I made this sub-PR with mostly test changes: joe-p#3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM one small suggestion
Co-authored-by: Pavel Zbitskiy <[email protected]>
a3c6d9f
to
cf0272f
Compare
Thanks @algorandskiy. Apologies for the force push. Fixed a typo in the commit message and didn't realize it would dismiss @jasonpaulos review status |
Remove custom `makeEmptyTransactionSigner` implementation and `AuthAddressProvider` since algosdk now correctly handles simulate calls from rekeyed accounts. This was originally added as a workaround in #89 but is no longer needed after algorand/go-algorand#5942.
Summary
This is a new feature in simulate that will close #5914. Auth address correction is done is two places:
simulateWithTracer
the txn fields will be analyzed and auth addrs for txns will be updated past on previousrekeyTo
fieldsAfterProgram
the auth addr field for all txns up to the next app call will be correctedThis allows one to simulate with empty signatures without knowing the proper auth addresses when forming the group.
Test Plan
Simple test to ensure the endpoint works as expected in
test/e2e-go/restAPI/simulate/simulateRestAPI_test.go
and more comprehensive testing inledger/simulation/simulation_eval_test.go