-
Notifications
You must be signed in to change notification settings - Fork 206
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
docs: Clarifying info on the compiled class hash. #1067
Conversation
Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1067/documentation/ . |
a7c93ea
to
906bf7e
Compare
Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1067/documentation/ . |
906bf7e
to
0023b08
Compare
Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1067/documentation/ . |
0023b08
to
48c5303
Compare
Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1067/documentation/ . |
...ts/Starknet/modules/architecture_and_concepts/pages/Network_Architecture/starknet-state.adoc
Outdated
Show resolved
Hide resolved
|
||
* It sounds like the prover decodes the hash to get that information. Is that correct---Can the prover decode the hash to get that information? | ||
+ | ||
Or is the Casm also stored in Starknet storage, and the compiled class hash is an identifier for the leaf in the trie that also includes the storage address for the Casm code? |
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.
It depends on what you call the StarknetStorage.
The Casm is stored by the sequencer, we load it to execute the contract entrypoints.
But it is not in the Starknet State (aka what is pushed to l1). So the .casm
contracts are not part of the storage trie. Only their hash is.
. The sequencer assembles the Casm from the Sierra code, stores it on the Starknet blockchain's storage, and generates a hash of the compiled class. | ||
-- | ||
+ | ||
This doesn't make sense, though, because when submitting the `DECLARE` transaction to declare the class, which is before you have the compiled class hash, you need to specify the `compiled_class_hash` as a transaction fied. Sounds like a Catch 22. |
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.
The idea is for the caller to have on his side both the sierra and the casm hash, and submit both in his tx, along with the sierra code.
The sequencer compiles Sierra to casm then checks that the casm code outputted is the one the user really intended to deploy by computing the hash of his casm output and making sure it is the same as the one passed in the tx.
. The sequencer assembles the Casm from the Sierra code, stores it on the Starknet blockchain's storage, and generates a hash of the compiled class. | ||
-- | ||
+ | ||
This doesn't make sense, though, because when submitting the `DECLARE` transaction to declare the class, which is before you have the compiled class hash, you need to specify the `compiled_class_hash` as a transaction fied. Sounds like a Catch 22. |
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.
typos warning: "fied" should be "field".
This doesn't make sense, though, because when submitting the `DECLARE` transaction to declare the class, which is before you have the compiled class hash, you need to specify the `compiled_class_hash` as a transaction fied. Sounds like a Catch 22. | |
This doesn't make sense, though, because when submitting the `DECLARE` transaction to declare the class, which is before you have the compiled class hash, you need to specify the `compiled_class_hash` as a transaction field. Sounds like a Catch 22. |
48c5303
to
bd77967
Compare
Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1067/documentation/ . |
...nents/Starknet/modules/architecture_and_concepts/pages/Smart_Contracts/cairo-and-sierra.adoc
Show resolved
Hide resolved
...nents/Starknet/modules/architecture_and_concepts/pages/Smart_Contracts/cairo-and-sierra.adoc
Show resolved
Hide resolved
Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1067/documentation/ . |
...nents/Starknet/modules/architecture_and_concepts/pages/Smart_Contracts/cairo-and-sierra.adoc
Show resolved
Hide resolved
Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1067/documentation/ . |
6415912
to
bc419f6
Compare
Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1067/documentation/ . |
Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1067/documentation/ . |
components/Starknet/modules/architecture_and_concepts/pages/Smart_Contracts/class-hash.adoc
Outdated
Show resolved
Hide resolved
…art_Contracts/class-hash.adoc Revert typo in id of class-hash.adoc
Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/pr-1067/documentation/ . |
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.
Reviewed 1 of 2 files at r4, 1 of 1 files at r5.
Reviewable status: 2 of 3 files reviewed, 8 unresolved discussions (waiting on @ArielElp, @stoobie, and @tdelabro)
Description of the Changes
Questions to answer about the compiled class hash
PR Preview URL
https://starknet-io.github.io/starknet-docs/pr-1067/documentation/architecture_and_concepts/Network_Architecture/starknet-state/#classes_trie
Paste here the specific URL(s) of the content that this PR addresses.
Check List
<docs/feat/fix/chore>(optional scope): <description>
, e.g:fix: minor typos in code
This change is