madara
madara copied to clipboard
feat: `to_rpc_contract_class` is still returning contracts with a lot of missing data
/// Returns a [`ContractClass`] from a [`BlockifierContractClass`]
pub fn to_rpc_contract_class(contract_class: BlockifierContractClass) -> Result<ContractClass> {
match contract_class {
BlockifierContractClass::V0(contract_class) => {
let entry_points_by_type = to_legacy_entry_points_by_type(&contract_class.entry_points_by_type)?;
let compressed_program = compress(&contract_class.program.to_bytes())?;
Ok(ContractClass::Legacy(CompressedLegacyContractClass {
program: compressed_program,
entry_points_by_type,
// FIXME 723
abi: None,
}))
}
BlockifierContractClass::V1(_contract_class) => Ok(ContractClass::Sierra(FlattenedSierraClass {
sierra_program: vec![], // FIXME: https://github.com/keep-starknet-strange/madara/issues/775
contract_class_version: option_env!("COMPILER_VERSION").unwrap_or("0.11.2").into(),
entry_points_by_type: EntryPointsByType { constructor: vec![], external: vec![], l1_handler: vec![] }, /* TODO: add entry_points_by_type */
abi: String::from("{}"), // FIXME: https://github.com/keep-starknet-strange/madara/issues/790
})),
}
}
This piece of code is still missing most fields. How to solve this?
Possible solution:
- store the data lost when passed to the runtime (eg. abi) in a kvStorage in the client, read them back from there when answering
get_class
rpc request
Hi, would be interested to work on this.
Thanks a lot @Juul-Mc-Goa ! Message me if you don't know how to design things.
Hey @Juul-Mc-Goa, this one had been assigned to you but I don't think you ever worked on it. Do you want to, or can I unassign you?
Hey, sorry got busy with other things. I can start working on it next monday, or you can unassign me if you prefer.
Starting next Monday will be great! Thank you
make sure to read #790 as it is part of what you will be doing
Hey @tdelabro, just to be sure, the kvStorage in the client will not be gossiped to other nodes ? If it has to be gossiped, as said in #775, then I don't know how it should be implemented.
@Juul-Mc-Goa indeed it is not gossiped. We have to find some other way. Starknet does not have the issue coz it is centralized. I think we have to gossip them or make them available one way or another.
Put your work here in hold, and open a discussion so that we can find the best way to do that. List the potential solutions you can think as a starting point for the discussion.
@tdelabro started a discussion there
I'm working on this whole flow. There is a number of task to do first, but I'm on it
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!
We now have contract classes stored in the client (since https://github.com/keep-starknet-strange/madara/pull/1409). So I think it reopen the possibility to improve this part
wanna give it a try @Juul-Mc-Goa ?
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!
has this been fixed? @tdelabro @Juul-Mc-Goa
@elielnfinic nope, still an issue
I will come back to this after completing the other task you just assigned to me. If you don't mind, you can assign this to me too.
Has this function been changed to blockifier_to_rpc_contract_class_types
in crates/client/rpc-core/src/utils.rs
?
@elielnfinic yes indeed
Is conversion from EntryPointV1
to SierraEntryPoint
available?
I think, I am able to fix that conversion.
@elielnfinic I think this PR will be fixed by some work I'm doing, storing the casm contract class on the client. It will provide all the data required to fill those missing fields. I don't think you will be able to complete this issue without this
I can create a draft PR to see if some parts of my code be used.
Sure, but don't spend too much time on that :)
Hey @tdelabro, please proceed, I will not submit the PR draft.
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!
Hey,
Is this issue still relevant ? I would be interested to work on this.
I'm on it #1631
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!
repository archived in favor of https://github.com/madara-alliance/madara