Skip to content

Commit

Permalink
Remove VM Fallback
Browse files Browse the repository at this point in the history
NativeContractClassV1Inner contained full Sierra contract in order to
run the VM code in the event of a NativeUnexpectedError.
Now, this is no longer needed.

Issue: #10
PR: #13
Testing: crates/blockifier/tests/test_native_contract.rs
  • Loading branch information
PearsonWhite committed Sep 16, 2024
1 parent 398a608 commit 22ccdaa
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 61 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"sierra_program":["0x1","0x6","0x0","0x2","0x8","0x0","0xa7","0x59","0x18","0x52616e6765436865636b","0x800000000000000100000000000000000000000000000000","0x436f6e7374","0x800000000000000000000000000000000000000000000002","0x1","0x4","0x2","0x4661696c656420746f20646573657269616c697a6520706172616d202331","0x4661696c656420746f20646573657269616c697a6520706172616d202332","0x537472756374","0x800000000000000f00000000000000000000000000000001","0x0","0x2ee1e2b1b89f8c495f200e4956278a4d47395fe262f27b52e5865c9524c08c3","0x66656c74323532","0x800000000000000700000000000000000000000000000000","0x456e756d","0x800000000000000700000000000000000000000000000003","0x11c6d8087e00642489f92d2821ad6ebd6532ad1a3b6d12833da6d6810391511","0x3","0x4f7574206f6620676173","0x4172726179","0x800000000000000300000000000000000000000000000001","0x536e617073686f74","0x800000000000000700000000000000000000000000000001","0x7","0x800000000000000700000000000000000000000000000002","0x1baeba72e79e9db2587cf44fedb2f3700b2075a5e8e39a562584862c4b71f62","0x8","0x9","0xc","0x753332","0x49","0x53746f7261676541646472657373","0x53746f726167654261736541646472657373","0x4275696c74696e436f737473","0x53797374656d","0x16a4c8d7c05909052238a862d8cc3e7975bf05a07b3a69c6b28951083a6d672","0x800000000000000300000000000000000000000000000003","0x12","0x9931c641b913035ae674b400b61a51476d506bbe8bba2ff8a6272790aba9e6","0xa","0x13","0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473","0x426f78","0x4761734275696c74696e","0x34","0x7265766f6b655f61705f747261636b696e67","0x77697468647261775f676173","0x6272616e63685f616c69676e","0x7374727563745f6465636f6e737472756374","0x73746f72655f74656d70","0x61727261795f736e617073686f745f706f705f66726f6e74","0x64726f70","0x16","0x61727261795f6e6577","0x636f6e73745f61735f696d6d656469617465","0x15","0x61727261795f617070656e64","0x7374727563745f636f6e737472756374","0x656e756d5f696e6974","0x14","0x17","0x11","0x6765745f6275696c74696e5f636f737473","0x10","0x77697468647261775f6761735f616c6c","0x73746f726167655f626173655f616464726573735f636f6e7374","0x1275130f95dda36bcbb6e9d28796c1d7e10b6e9fd5ed083e0ede4b12f613528","0x73746f726167655f616464726573735f66726f6d5f62617365","0xd","0xb","0x647570","0xe","0x73746f726167655f77726974655f73797363616c6c","0x66656c743235325f616464","0x736e617073686f745f74616b65","0x6","0x656e61626c655f61705f747261636b696e67","0x756e626f78","0x72656e616d65","0x5","0x6a756d70","0x656e756d5f6d61746368","0x64697361626c655f61705f747261636b696e67","0x13e","0xffffffffffffffff","0x4d","0xf","0x40","0x19","0x1a","0x1b","0x1c","0x1d","0x36","0x1e","0x1f","0x20","0x21","0x22","0x23","0x24","0x25","0x26","0x27","0x28","0x29","0x2a","0x2b","0x2c","0x2d","0x2e","0x2f","0x30","0x31","0x32","0x33","0x35","0x37","0x38","0x91","0x70","0x84","0x130","0xad","0xb2","0x120","0xbc","0xc1","0x10f","0xd6","0xff","0xf4","0x39","0x3a","0x3b","0x3c","0x3d","0x3e","0x3f","0x41","0x42","0x43","0x44","0x45","0x46","0x47","0x48","0x4a","0x4b","0x4c","0x4e","0x4f","0x50","0x51","0x52","0x53","0x54","0x55","0x56","0x57","0x58","0x59","0x5a","0x5b","0x9f","0xb06","0x40313050605120c11100f0e0d0c0b0a090706050403080706050403020100","0x1f0c071e0504031d050d0c1a0a1c051b0c1a0a190518170605161514070605","0x280c2610190527050d0c260a250c0b0a02240f230f220f212007060504030f","0xc0505331d0505320c310c300c2f2e022d0605182c2b07060504032a052905","0x5053b0605053a060505333905053806050537360505351c05053506050534","0xc42410505330c403d0505333f0505333e05053305073d05073c2a05053b27","0x4c0c4b0c4a490505331e0505330605054847050538460505380c4544070543","0x5354d050538060505350c073d05073c2905053b1d05053b19050535190505","0x5053b0c52510505331c0505330c075105073c060505500605054f0c4e1d05","0x56050c0c0c550505053807050538130505350c545105055305075105073c13","0x60c1c0556051305130c0c56050c070c194d07575106075607050c07050c0c","0xc56051d054d0c0c56050c070c470539291d0756071c05510c060556050605","0x470c460556054605290c460556050c1d0c1e0556050c1c0c0c56052905190c","0x3f0556054105490c41055605495807460c580556050c1e0c49055605461e07","0x556053f053f0c070556050705410c510556055105580c060556050605060c","0x27052a0c270556050c270c0c560547054d0c0c56050c070c3f07510606053f","0x556050c390c0c56050c070c363907593d2a075607275106133d0c27055605","0x5a0756055a055a0c5b0556050c000c5a0556050c3e0c000556053e05360c3e","0x56052a05060c5c0556055c05290c0005560500055c0c5b0556055b055b0c5c","0x56050c1c0c0c56050c070c626160135f5e5d0756075c005b073d515d0c2a05","0x56505290c65055605645a075e0c5a0556055a05290c640556050c3e0c6305","0x5620c0c56056705610c68670756056605600c66055605656307470c650556","0x580c2a0556052a05060c6b0556056a05640c6a0556056905630c6905560568","0xc070c6b5e5d2a06056b0556056b053f0c5e0556055e05410c5d0556055d05","0x56d05490c6d055605626c07460c6c0556050c1e0c0c56055a05650c0c5605","0x6e053f0c610556056105410c600556056005580c2a0556052a05060c6e0556","0xc700556050c660c6f0556050c1c0c0c56050c070c6e61602a06056e055605","0x55605717207460c720556050c1e0c71055605706f07470c70055605700529","0x56050705410c360556053605580c390556053905060c740556057305490c73","0x1c0c0c56051305670c0c56050c070c7407363906057405560574053f0c0705","0x1e0c760556052e7507470c2e0556052e05290c2e0556050c660c750556050c","0xc4d0556054d05060c780556057705490c77055605765f07460c5f0556050c","0xc0c7807194d06057805560578053f0c070556050705410c19055605190558","0x556051305130c0c56050c070c194d07795106075607050c07050c0c56050c","0x1d054d0c0c56050c070c47057a291d0756071c05510c060556050605060c1c","0x556054605290c460556050c1d0c1e0556050c1c0c0c56052905190c0c5605","0x54105490c41055605495807460c580556050c1e0c49055605461e07470c46","0x3f053f0c070556050705410c510556055105580c060556050605060c3f0556","0xc270556050c270c0c560547054d0c0c56050c070c3f07510606053f055605","0xc1c0c0c56050c070c3639077b3d2a075607275106133d0c2705560527052a","0x5600c5a055605003e07470c000556050005290c000556050c3e0c3e055605","0x640c5e0556055d05630c5d0556055c05620c0c56055b05610c5c5b0756055a","0xc070556050705410c3d0556053d05580c2a0556052a05060c600556055e05","0x56050c660c610556050c1c0c0c56050c070c60073d2a06056005560560053f","0x636407460c640556050c1e0c63055605626107470c620556056205290c6205","0x5410c360556053605580c390556053905060c660556056505490c65055605","0x56051305670c0c56050c070c6607363906056605560566053f0c0705560507","0x55605686707470c680556056805290c680556050c660c670556050c1c0c0c","0x56054d05060c6c0556056b05490c6b055605696a07460c6a0556050c1e0c69","0x7194d06056c0556056c053f0c070556050705410c190556051905580c4d05","0x1305130c0c56050c070c194d077c5106075607050c07050c0c56050c0c0c6c","0xc47057d291d0756071c05510c060556050605060c0c56050c680c1c055605","0x6c0c4905560546056b0c460556051e056a0c1e0556052905690c0c56050c07","0x56050c6f0c0c56050c070c0c7e050c6e0c4105560549056d0c580556051d05","0x74105710c4105560527056d0c5805560547056c0c270556053f05700c3f05","0xc0c56050c070c3e058036390756075805510c0c56050c070c3d057f2a0556","0x5c05560539056c0c5b0556055a056b0c5a05560500056a0c00055605360569","0x5e05700c5e0556050c6f0c0c56050c070c0c81050c6e0c5d0556055b056d0c","0x620582610556075d05710c5d05560560056d0c5c0556053e056c0c60055605","0xc0c56050c720c0c56050c070c65058364630756075c05510c0c56050c070c","0x50c1c0c0c56052a05650c0c56056105650c0c56056405190c0c560563054d","0x50c1e0c68055605676607470c670556056705290c670556050c1d0c660556","0x5580c060556050605060c6b0556056a05490c6a055605686907460c690556","0x50c070c6b07510606056b0556056b053f0c070556050705410c5105560551","0x76c5106133d0c6c0556056c052a0c6c0556050c270c0c560565054d0c0c56","0x5a0c720556057105360c710556050c390c0c56050c070c706f07846e6d0756","0x7505560575055b0c750556050c000c740556056173075e0c732a0756052a05","0x7275076e515d0c6d0556056d05060c740556057405290c7205560572055c0c","0xc860556050c1c0c0c56050c720c0c56050c070c78775f1385762e07560774","0x556058905620c0c56058805610c89880756058705600c870556052a860747","0x56052e05580c6d0556056d05060c8c0556058b05640c8b0556058a05630c8a","0xc0c56050c070c8c762e6d06058c0556058c053f0c760556057605410c2e05","0x5490c8d055605785907460c590556050c1e0c0c56052a05650c0c56050c72","0x3f0c770556057705410c5f0556055f05580c6d0556056d05060c8e0556058d","0xc56056105650c0c56050c720c0c56050c070c8e775f6d06058e0556058e05","0x470c900556059005290c900556050c660c8f0556050c1c0c0c56052a05650c","0x940556059305490c93055605919207460c920556050c1e0c91055605908f07","0x5560594053f0c070556050705410c700556057005580c6f0556056f05060c","0x55c054d0c0c56056205730c0c56050c720c0c56050c070c9407706f060594","0x950556059505290c950556050c740c200556050c1c0c0c56052a05650c0c56","0x56055705490c57055605969707460c970556050c1e0c96055605952007470c","0x598053f0c070556050705410c510556055105580c060556050605060c9805","0x54d0c0c56053d05730c0c56050c720c0c56050c070c980751060605980556","0x9a9907470c9a0556059a05290c9a0556050c750c990556050c1c0c0c560558","0x5060c9e0556059d05490c9d0556059b9c07460c9c0556050c1e0c9b055605","0x6059e0556059e053f0c070556050705410c510556055105580c0605560506","0xa00556050c660c9f0556050c1c0c0c56051305670c0c56050c070c9e075106","0x5605a1a207460ca20556050c1e0ca1055605a09f07470ca0055605a005290c","0x50705410c190556051905580c4d0556054d05060ca4055605a305490ca305","0x7050c3d3f3e0c061d3f3e0c0613a407194d0605a4055605a4053f0c070556","0x1307050c3d3f3e0c061d3f3e0c06a51307050c3d3f3e0c061d3f3e0c060c13","0xa6"],"sierra_program_debug_info":{"type_names":[[0,"RangeCheck"],[1,"Const<felt252, 485748461484230571791265682659113160264223489397539653310998840191492913>"],[2,"Const<felt252, 485748461484230571791265682659113160264223489397539653310998840191492914>"],[3,"Unit"],[4,"felt252"],[5,"core::option::Option::<core::felt252>"],[6,"Const<felt252, 375233589013918064796019>"],[7,"Array<felt252>"],[8,"Snapshot<Array<felt252>>"],[9,"core::array::Span::<core::felt252>"],[10,"Tuple<core::array::Span::<core::felt252>>"],[11,"Const<u32, 0>"],[12,"u32"],[13,"Const<felt252, 73>"],[14,"StorageAddress"],[15,"StorageBaseAddress"],[16,"BuiltinCosts"],[17,"System"],[18,"core::panics::Panic"],[19,"Tuple<core::panics::Panic, Array<felt252>>"],[20,"core::panics::PanicResult::<(core::array::Span::<core::felt252>,)>"],[21,"Const<felt252, 7733229381460288120802334208475838166080759535023995805565484692595>"],[22,"Box<felt252>"],[23,"GasBuiltin"]],"libfunc_names":[[0,"revoke_ap_tracking"],[1,"withdraw_gas"],[2,"branch_align"],[3,"struct_deconstruct<core::array::Span::<core::felt252>>"],[4,"store_temp<RangeCheck>"],[5,"array_snapshot_pop_front<felt252>"],[6,"drop<Snapshot<Array<felt252>>>"],[7,"drop<Box<felt252>>"],[8,"array_new<felt252>"],[9,"const_as_immediate<Const<felt252, 7733229381460288120802334208475838166080759535023995805565484692595>>"],[10,"store_temp<felt252>"],[11,"array_append<felt252>"],[12,"struct_construct<core::panics::Panic>"],[13,"struct_construct<Tuple<core::panics::Panic, Array<felt252>>>"],[14,"enum_init<core::panics::PanicResult::<(core::array::Span::<core::felt252>,)>, 1>"],[15,"store_temp<GasBuiltin>"],[16,"store_temp<System>"],[17,"store_temp<core::panics::PanicResult::<(core::array::Span::<core::felt252>,)>>"],[18,"get_builtin_costs"],[19,"store_temp<BuiltinCosts>"],[20,"withdraw_gas_all"],[21,"storage_base_address_const<521780245902522698637863835114646400086704280925471510886115468919502353704>"],[22,"storage_address_from_base"],[23,"const_as_immediate<Const<felt252, 73>>"],[24,"const_as_immediate<Const<u32, 0>>"],[25,"dup<felt252>"],[26,"store_temp<u32>"],[27,"store_temp<StorageAddress>"],[28,"storage_write_syscall"],[29,"felt252_add"],[30,"snapshot_take<Array<felt252>>"],[31,"drop<Array<felt252>>"],[32,"struct_construct<core::array::Span::<core::felt252>>"],[33,"struct_construct<Tuple<core::array::Span::<core::felt252>>>"],[34,"enum_init<core::panics::PanicResult::<(core::array::Span::<core::felt252>,)>, 0>"],[35,"drop<felt252>"],[36,"const_as_immediate<Const<felt252, 375233589013918064796019>>"],[37,"drop<core::array::Span::<core::felt252>>"],[38,"enable_ap_tracking"],[39,"unbox<felt252>"],[40,"rename<felt252>"],[41,"enum_init<core::option::Option::<core::felt252>, 0>"],[42,"store_temp<Snapshot<Array<felt252>>>"],[43,"store_temp<core::option::Option::<core::felt252>>"],[44,"jump"],[45,"struct_construct<Unit>"],[46,"enum_init<core::option::Option::<core::felt252>, 1>"],[47,"enum_match<core::option::Option::<core::felt252>>"],[48,"disable_ap_tracking"],[49,"drop<Unit>"],[50,"const_as_immediate<Const<felt252, 485748461484230571791265682659113160264223489397539653310998840191492914>>"],[51,"const_as_immediate<Const<felt252, 485748461484230571791265682659113160264223489397539653310998840191492913>>"]],"user_func_names":[[0,"test_contracts::TestContract::__wrapper__get_num"],[1,"test_contracts::TestContract::__wrapper__number_a"],[2,"test_contracts::TestContract::__wrapper__constructor"]]},"contract_class_version":"0.1.0","entry_points_by_type":{"EXTERNAL":[{"selector":"0x15d9e3ddc3010201d5746658f5fe8ace001ef8f271b83fa78558aa1e2adef1a","function_idx":1},{"selector":"0x1c659e9390feb38b127ccb1d3c1101dd77161ebdc45a31d8a64f586187cc3a2","function_idx":0}],"L1_HANDLER":[],"CONSTRUCTOR":[{"selector":"0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194","function_idx":2}]},"abi":[{"type":"constructor","name":"constructor","inputs":[{"name":"arg1","type":"core::felt252"},{"name":"arg2","type":"core::felt252"}]},{"type":"function","name":"get_num","inputs":[],"outputs":[{"type":"core::felt252"}],"state_mutability":"external"},{"type":"function","name":"number_a","inputs":[],"outputs":[{"type":"core::felt252"}],"state_mutability":"external"},{"type":"event","name":"test_contracts::TestContract::Event","kind":"enum","variants":[]}]}
Loading

0 comments on commit 22ccdaa

Please sign in to comment.