You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when executing declare transaction's, we are using the state in which that transaction occurred. In order to execute these kind of transactions we need its contract class, this is how its done right now:
let block_number = context.block_info().block_number;let network = parse_to_rpc_chain(&context.chain_info().chain_id.to_string());// we need to retrieve the next block in order to get the contract_classlet contract_class = state
.get_contract_class(&declare_tx.class_hash()).unwrap();let class_info = calculate_class_info_for_testing(contract_class);
The problem here is that get_contract_class(...) will fail since the contract_class has not been delcared yet and therefore it does not exist. One solution would be to create a new reader which is one state upon the transaction's one. However, since this function is used to benchmark purposes, this call would not be cached thus producing a regression.
The text was updated successfully, but these errors were encountered:
FrancoGiachetta
changed the title
Fix declare transactions in function ´execute_tx_with_blockifier´
Fix declare transactions in function execute_tx_with_blockifier
Dec 2, 2024
Currently, when executing declare transaction's, we are using the state in which that transaction occurred. In order to execute these kind of transactions we need its contract class, this is how its done right now:
The problem here is that
get_contract_class(...)
will fail since thecontract_class
has not been delcared yet and therefore it does not exist. One solution would be to create a new reader which is one state upon the transaction's one. However, since this function is used to benchmark purposes, this call would not be cached thus producing a regression.The text was updated successfully, but these errors were encountered: