forked from lambdaclass/cairo-vm
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: deserialize PIE additional data as struct instead of hashmap
Problem: Deserializing the PIE additional data as a hashmap of `BuiltinAdditionalData` enums because of an issue with deserializing untagged unions in `serde` (see serde-rs/json#1103). Solution: add a new `AdditionalData` struct with explicit fields for each builtin, circumventing the untagged union issue. This solution has the advantage of always associating the correct data type for each builtin (it's not possible anymore to associate a builtin with a different data type), but requires modifications if a new builtin is added.
- Loading branch information
1 parent
1c07f35
commit 494a4bf
Showing
6 changed files
with
167 additions
and
50 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
cairo_programs/manually_compiled/pie_additional_data_test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"output_builtin": { | ||
"pages": { | ||
"1": [ | ||
18, | ||
46 | ||
] | ||
}, | ||
"attributes": { | ||
"gps_fact_topology": [ | ||
2, | ||
1, | ||
0, | ||
2 | ||
] | ||
} | ||
}, | ||
"pedersen_builtin": [ | ||
[ | ||
3, | ||
2 | ||
], | ||
[ | ||
3, | ||
5 | ||
], | ||
[ | ||
3, | ||
8 | ||
], | ||
[ | ||
3, | ||
11 | ||
], | ||
[ | ||
3, | ||
14 | ||
], | ||
[ | ||
3, | ||
17 | ||
] | ||
], | ||
"range_check_builtin": null, | ||
"ecdsa_builtin": [], | ||
"bitwise_builtin": null, | ||
"ec_op_builtin": null, | ||
"keccak_builtin": null, | ||
"poseidon_builtin": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters