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: native not executing the same as cairo #806

Closed
enitrat opened this issue Sep 24, 2024 · 4 comments
Closed

bug: native not executing the same as cairo #806

enitrat opened this issue Sep 24, 2024 · 4 comments

Comments

@enitrat
Copy link

enitrat commented Sep 24, 2024

Bug: executing on native doesn't yield the same result as Sierra:

Repro

clone ef-tests, ensure correct branch
make
make setup-kakarot
cargo test test_baseFeeDiffPlaces_d0g0v0_Cancun --features v1,native -- --nocapture

Expected behavior:
The test should pass

Actual behavior:
The test fails (the execution doesn't crash, but the expected values are not met).

Precisions:

  • From the logs I see a contract is being deployed. Normally, running this test doesn't deploy a contract.
  • Contracts can only be deployed if, when querying a certain storage var, no value is registered. Thus, perhaps the storage_read is not returning the correct value ?
@enitrat enitrat changed the title bug: native not executing the same as sierra bug: native not executing the same as cairo Sep 24, 2024
@edg-l
Copy link
Member

edg-l commented Sep 25, 2024

I have a question, would it be possible that the bug lies in the blockifier implementation? Especially the syscall handler implementation, since its not exactly the same code as the VM (due to how native is designed). (not ruling out native isn't at fault, but its a possibility)

@rodrigo-pino
Copy link
Contributor

I have a question, would it be possible that the bug lies in the blockifier implementation? Especially the syscall handler implementation, since its not exactly the same code as the VM (due to how native is designed). (not ruling out native isn't at fault, but its a possibility)

Totally possible, there might be a bugs on the syscall handler. Specifically on storage though, they are fairly straightforward to implement and we have dedicated unit tests and ERC20 contracts, which indirectly tests for the correct usage of storage syscalls.

@enitrat do the variable always gets registered? Meaning that it is not behind any conditional, maybe there might be an issue even before in the code that might cause the runtime to take another execution path?

@enitrat
Copy link
Author

enitrat commented Sep 25, 2024

yes, basically when we setup the state we write to the sequencer state this variable, so normally it's always set to some value.

It's done here:

https://github.com/kkrt-labs/ef-tests/blob/8e680e7d9167a6292a8a6c5926f094d5bcc60e0b/crates/ef-testing/src/evm_sequencer/evm_state/mod.rs#L87-L138

@enitrat
Copy link
Author

enitrat commented Sep 30, 2024

fixed by #812 I believe

@enitrat enitrat closed this as completed Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants