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

ecdsa_ptr points to reference in Account lib's execute #386

Closed
andrew-fleming opened this issue Jul 10, 2022 · 0 comments · Fixed by #387
Closed

ecdsa_ptr points to reference in Account lib's execute #386

andrew-fleming opened this issue Jul 10, 2022 · 0 comments · Fixed by #387

Comments

@andrew-fleming
Copy link
Collaborator

andrew-fleming commented Jul 10, 2022

Transactions on goerli fail with the following error message:

🛑 The transaction was rejected but no contract address was identified in the error message.
Error message:
Error at pc=0:133:
Got an exception while executing a hint.
Cairo traceback (most recent call last):
Unknown location (pc=0:746)
Unknown location (pc=0:682)
Error message: Account: invalid signature
Unknown location (pc=0:347)
Unknown location (pc=0:321)

Traceback (most recent call last):
  File "<hint14>", line 1, in <module>
  File "/app/src/starkware/starknet/services/batcher/starknet_batcher_venv-site/starkware/cairo/lang/builtins/signature/signature_builtin_runner.py", line 94, in add_signature
    ), f"Signature hint must point to the signature builtin segment, not {addr}."
AssertionError: Signature hint must point to the signature builtin segment, not 14:0.

Neither the StarkNet test environment nor the devnet raise this error.

The error stems from here:
https://github.com/OpenZeppelin/cairo-contracts/blob/release-0.2.0/src/openzeppelin/account/library.cairo#L203

let (local ecdsa_ptr : SignatureBuiltin*) = alloc()

The Signature hint points to this reference (which the SignatureBuiltinRunner does not like). To resolve this, I suggest adding the ecdsa_ptr: SignatureBuiltin* as an implicit arg to execute, eth_execute, and _unsafe_execute in the Account library and EthAccount's __execute__ as well.

Another solution would be to isolate the functionality of both accounts (thus removing _unsafe_execute), so we don't have to pass the implicit ecdsa_ptr in the EthAccount methods.

@martriay martriay added this to the next milestone Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants