Open SantiagoPittella opened 1 year ago
FYI: it seems there are Sierra classes out there where ABI cannot even be parsed:
I get a "missing field kind
" error when trying to parse the JSON using serde into ContractClass
.
Very easy to reproduce using the class in this comment: https://github.com/eqlabs/pathfinder/issues/1208#issuecomment-1635607016
The starknet_estimateFee
call fails with starknet_in_rust because the class hash miscalculation leads to an invalid transaction hash, which then fails signature check...
I'm forwarding a message from @kkovaacs : "
starknet_in_rust
uses the ContractClass type fromcairo-lang-starknet
when creating a Declare v2 transaction. Unfortunately the JSON representation for that type isn’t quite the same as the one used on Starknet. The ABI is defined as a string on Starknet to avoid the issue of the class hash depending on the exact method of JSON-serializing the ABI data structure. However, the ContractClass type contains a parsed representation of the ABI which is then transformed back to string whenstarknet_in_rust
is doing class hash calculation." This leads to potencial hash mismatches.Thanks @kkovaacs for the report.