madara icon indicating copy to clipboard operation
madara copied to clipboard

bug:Retrieving class for contract version 0 reported an error

Open fishseabowl opened this issue 9 months ago • 5 comments

Bug Report

Madara version:

commit: 38ef50e00a7c53ef55b5b2eb9a9f59426738de03 Current behavior:

In the file starknet-rpc-test/get_class_at.rs, line 67:

let program: LegacyProgram = serde_json::from_str(data.as_str())?;

reported: Error: invalid type: map, expected string at line 1 column 134

"{"prime":"0x800000000000011000000000000000000000000000000000000000000000001","builtins":["pedersen","range_check","bitwise"],"data":[{"Int":{"value":{"val":[2147450879,67600385]}}},{"Int":{"value":{"val":[1]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147188732,1073971200]}}},{"Int":{"value":{"val":[2147188733,1073971201]}}},{"Int":{"value":{"val":[2147188736,1210482689]}}},{"Int":{"value":{"val":[3]}}},{"Int":{"value":{"val":[2147188736,1208123394]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147581952,285507585]}}},{"Int":{"value":{"val":[0,0,0,0,0,0,17,134217728]}}},{"Int":{"value":{"val":[2147385344,1210351617]}}},{"Int":{"value":{"val":[4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,16,134217728]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147450880,1208385537]}}},{"Int":{"value":{"val":[1918985076,1131376244,1130458220]}}},{"Int":{"value":{"val":[2147057663,1073905664]}}},{"Int":{"value":{"val":[2147057658,1073971201]}}},{"Int":{"value":{"val":[2147057659,1073971202]}}},{"Int":{"value":{"val":[2147057660,1073971203]}}},{"Int":{"value":{"val":[2147057661,1073971204]}}},{"Int":{"value":{"val":[2147057664,1210482689]}}},{"Int":{"value":{"val":[7]}}},{"Int":{"value":{"val":[2147057664,1208123397]}}},{"Int":{"value":{"val":[2147057664,1208123398]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147450880,1208385537]}}},{"Int":{"value":{"val":[1130458220,1918988921,5007714]}}},{"Int":{"value":{"val":[2147057663,1073905664]}}},{"Int":{"value":{"val":[2147057658,1073971201]}}},{"Int":{"value":{"val":[2147057659,1073971202]}}},{"Int":{"value":{"val":[2147057660,1073971203]}}},{"Int":{"value":{"val":[2147057661,1073971204]}}},{"Int":{"value":{"val":[2147057664,1210482689]}}},{"Int":{"value":{"val":[7]}}},{"Int":{"value":{"val":[2147057664,1208123397]}}},{"Int":{"value":{"val":[2147057664,1208123398]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147450880,1208385537]}}},//<-- This is where column 134 should be

Expected behavior:

No error reported

Steps to reproduce:

Run work_ok_retrieving_class_for_contract_version_0 unit test

Related code:

insert short code snippets here
        ContractClass::Legacy(c) => {
            // decompress program
            let mut d = GzDecoder::new(&c.program[..]);
            let mut data = String::new();
            d.read_to_string(&mut data).unwrap();
            let program: LegacyProgram = serde_json::from_str(data.as_str())?;

Other information:

fishseabowl avatar May 01 '24 23:05 fishseabowl

This test is currently ignored: https://github.com/keep-starknet-strange/madara/blob/38ef50e00a7c53ef55b5b2eb9a9f59426738de03/starknet-rpc-test/get_class_at.rs#L47C13-L47C20 until #1469 is solved.

Which is the purpose of your PR #1523.

This issue seems to say that the test is failing at a commit that does not contain your PR changes. Does it still fail on your #1523 branch?

tdelabro avatar May 06 '24 08:05 tdelabro

@tdelabro Thank you for your commit. This issue arose from a recent update to the codebase. My PR #1523 addresses the missing "main_scope" field reported in issue #1469. The solution was tested with commit 5e68494fe9d96b522afe95167e51a7429e1dce1b.

fishseabowl avatar May 06 '24 17:05 fishseabowl

@fishseabowl can you list the next steps please? What to merge now? What to fix later?

tdelabro avatar May 07 '24 06:05 tdelabro

@fishseabowl can you list the next steps please? What to merge now? What to fix later?

@tdelabro The PR #1523 is ready to be merged. After that, we'll look into why ContractClass::Legacy serde_json format isn't decoding correctly in this issue #1585 and fix it. Thanks

fishseabowl avatar May 08 '24 21:05 fishseabowl

#1523 has been merged

tdelabro avatar May 13 '24 11:05 tdelabro

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!

github-actions[bot] avatar Jun 13 '24 00:06 github-actions[bot]

I changing a lot of stuffs related to this here: https://github.com/keep-starknet-strange/madara/pull/1631

tdelabro avatar Jun 14 '24 08:06 tdelabro

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!

github-actions[bot] avatar Jul 15 '24 00:07 github-actions[bot]

repository archived in favor of https://github.com/madara-alliance/madara

tdelabro avatar Aug 02 '24 18:08 tdelabro