forked from starkware-libs/sequencer
-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: remove the need for Sierra on the Blockifier Side #10
Labels
enhancement
New feature or request
Comments
PearsonWhite
pushed a commit
that referenced
this issue
Sep 6, 2024
NativeContractClassV1Inner contained full Sierra contract in order to run the VM code in the event of a NativeUnexpectedError. Now, this is no longer needed. Issue: #10 PR: TBA Testing: TBA
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature Request
The use of Sierra inside a Native Contract Class was initially meant as a way to have a fallback to the VM in case of failed Native execution.
We have decided to remove that feature, but still Sierra is used for other things:
So far, 1 and 2 can be solved in the Blockifier and 3 will be solved on the Cairo Native side.
Proposed Solution
Without removing the Sierra, let's address issues 1 and 2. Let's remove the code from the fallback and find a way to perform partial equility.
Solving 1 should be straightforward, so we will focus on 2.
When comparing two different
Native Contract Class
we compared the entry points by type and the sierra program since we ideally don't have access to the Sierra we need to find a new way to compare the contracts.We cannot only compare entry points because they can be two different contracts with the same entry points.
We cannot compare the executors naively, because each one of them represents an address in Memory. Two instances of the same contract will result in they being treated as different, but they are actually the same.
The Idea is to give a unique ID to each
Native Contract Class
. This unique identifier should be obtained by hashing the Sierra instructions during the creation ofNative Contract Class
.This can be solved in different manners, it is important to find the most performant one. That is, the one that requires de least amount of hashes. Haven't thought about it, it might be as well only achieved in Theta(n). The hash to be used must be thought of, it should be cheap to do on standard CPUs.
Other ideas are welcomed, maybe we can compare the executors, or perhaps obtain an identifier much more easily.
The text was updated successfully, but these errors were encountered: