-
Notifications
You must be signed in to change notification settings - Fork 451
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
base: master
Are you sure you want to change the base?
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.90% +0.04%
==========================================
Files 481 481
Lines 68357 68416 +59
==========================================
+ Hits 38189 38251 +62
+ Misses 27567 27565 -2
+ Partials 2601 2600 -1 ☔ 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 |
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