-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix account signature #387
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,6 +126,9 @@ async def test_return_value(account_factory): | |
async def test_nonce(account_factory): | ||
account, _, initializable, *_ = account_factory | ||
|
||
# bump nonce | ||
await signer.send_transactions(account, [(initializable.contract_address, 'initialized', [])]) | ||
|
||
Comment on lines
+129
to
+131
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was this passing before? if so, why? if not, why is it needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was passing before, but with the proposed changes, the nonce's |
||
execution_info = await account.get_nonce().call() | ||
current_nonce = execution_info.result.res | ||
|
||
|
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.
following Fran's comment, this shouldn't be needed right?
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.
@frangio
Compilation without the
ecdsa_ptr
in_unsafe_execute
fails:_unsafe_execute
makes the actual contract call and seems to require passing the sig builtin for verification:https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/cairo/lang/builtins/signature/signature_builtin_runner.py#L12-L18
I'm still trying to understand this issue.
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.
And what if we explicitly pass the implicit arguments without including ecdsa_ptr? It looks like it's trying to pass along all the available implicit arguments including those that aren't needed.
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.
If I understand you question correctly, I don't think this works. Taking out the implicit
ecdsa_ptr
means we'll still need to create some reference to it to validate the signature...which brings us back to the same initial issue:Signature hint must point to the signature builtin segment, not {addr}
.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.
My suggestion was to write the call as
(I'm not sure if this works)
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.
Afaict the implicit arguments are not only received by
_unsafe_execute
but also passed to the next function call, doing so could revokeecdsa_ptr
but other than that it might work.