Share Sierra contracts between nodes #1395
Replies: 4 comments 12 replies
-
I think solution 2 is the one to go with, but we can probably leverage the substrate p2p mechanism rather than using the lib you suggested. |
Beta Was this translation helpful? Give feedback.
-
For Deoxys we are currently already receiving classes on the client side, verifying them against the sequencer, passing them to the digest logs and directly store them within the runtime in So we are kind of using Solution 3 relaying on the sequencer. |
Beta Was this translation helpful? Give feedback.
-
I think that on your case option 2 by storing it in the digest after some checks and comunicate it to the network via p2p is good and should be safe. But I'm not 100% sure of what it would imply since we do not respect the Starknet p2p specs yet. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/paritytech/substrate/tree/master/client/network-gossip I think this is the crate we will end up using. I think it's really doable. I can create an issue and try to find a developer with substrate experience |
Beta Was this translation helpful? Give feedback.
-
Madara needs to have the Sierra intermediate representation to handle the
ContractClass::Sierra
variant (fromstarknet_core::types
). For now, the conversion from blockifier's contract class to starknet's contract class returns dummy values (see #1316).The preferred solution, as described here would be to store each sierra class locally, and gossip them to other nodes. This discussion is for finding a good way to implement this.
Be aware that I am very much a newbie, so my suggestions may be completely ill-advised.
Solution 1 (last resort)
described at #775: implement this in the runtime. This means the runtime would have more data than the strict necessary for the chain state, so something better is needed.
Solution 2 (gossip)
Store it in the client, implement gossiping with a rust lib. I guess there should be a way to do peer-discovery, and a way to prevent DoS attacks by malicious peers.
Solution 3 (random)
Having one shared global state that is resistant to malicious actors sounds like a job for a blockchain. However, I'm clueless as to how to do this in practice. (This solution is included for entertainment purposes only).
Beta Was this translation helpful? Give feedback.
All reactions