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

bug: Failing to send a transaction to precompile #857

Closed
greged93 opened this issue Oct 12, 2023 · 1 comment
Closed

bug: Failing to send a transaction to precompile #857

greged93 opened this issue Oct 12, 2023 · 1 comment

Comments

@greged93
Copy link
Contributor

Bug Report

Kakarot version f5d013f

Current behavior

It was tested on anvil using cast that it is possible to send a transaction directly to a precompile. To reproduce, run anvil and select a private key in the provided list. Then run cast send 0x0000000000000000000000000000000000000007 0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003 --value 1 --private-key "selected_private_key". You can then verify that this indeed executed the ecmul precompile by running cast run "previous_transaction_hash". This should ouput:

Executing previous transactions from the block.
Traces:
  [6000] PRECOMPILE::ecmul{value: 1}(1, 2, 3)
    └─ ← 3353031288059533942658390886683067124040920775575537747144343083137631628272 [3.353e75], 19321533766552368860946552437480515441416830039777911637913418824951667761761 [1.932e76]

However, in the case of Kakarot (ignoring the fact that for now only 4/9 precompiles are functionning), the contract that will be called is the starknet address compute using Accounts.compute_starknet_address(to). Meaning Kakarot will fail to call the correct precompile.

The following list of test call a precompile directly. Out of the list, currently only randomStatetest642 is being skipped, meaning the other tests are producing false positives.

randomStatetest644_d0g0v0_Shanghai
randomStatetest645_d0g0v0_Shanghai
randomStatetest645_d0g0v1_Shanghai
randomStatetest642_d0g0v0_Shanghai
modexpRandomInput_d0g0v0_Shanghai
modexpRandomInput_d0g1v0_Shanghai
modexpRandomInput_d1g0v0_Shanghai
modexpRandomInput_d1g1v0_Shanghai
modexpRandomInput_d2g0v0_Shanghai
modexpRandomInput_d2g1v0_Shanghai

Expected behavior

The precompiles should be correctly called when directly targeted from a transaction.

Additional information

This gives information about issue kkrt-labs/ef-tests#533.

@ClementWalter ClementWalter transferred this issue from kkrt-labs/ef-tests Dec 13, 2023
@ClementWalter
Copy link
Member

Closed in favor of epix #856

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants