diff --git a/src/proto_alpha/lib_protocol/test/integration/wasm_kernel/no_parse_bad_fingerprint.wasm b/src/proto_alpha/lib_protocol/test/integration/wasm_kernel/no_parse_bad_fingerprint.wasm new file mode 100644 index 0000000000000000000000000000000000000000..fba1f191b6ed6a5ddb68d628afa7d2ff06255a6f Binary files /dev/null and b/src/proto_alpha/lib_protocol/test/integration/wasm_kernel/no_parse_bad_fingerprint.wasm differ diff --git a/src/proto_alpha/lib_protocol/test/integration/wasm_kernel/no_parse_random.wasm b/src/proto_alpha/lib_protocol/test/integration/wasm_kernel/no_parse_random.wasm new file mode 100644 index 0000000000000000000000000000000000000000..a817ec8df9ad75e79b53236642c5fa768b130f6c --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/integration/wasm_kernel/no_parse_random.wasm @@ -0,0 +1 @@ +¹£2º@ÐCöϯ(haS€PiáÈ9«û ªg&4 \ No newline at end of file diff --git a/tezt/lib_tezos/constant.ml b/tezt/lib_tezos/constant.ml index 3523fb523d2120c89377e0e6061baa8b903fe79a..0e0403da6e23cdcdd6af82dd666ceea70eb09a5a 100644 --- a/tezt/lib_tezos/constant.ml +++ b/tezt/lib_tezos/constant.ml @@ -123,6 +123,10 @@ let tz4_account : Account.aggregate_key = (** WASM PVM boot sector that provides a zeroed chunk of kernel, and a public key. + This is enough to get the PVM past the Gather_floppies stage. Since + an all-zero kernel is not a valid WebAssembly module, a PVM using + this boot sector is expected to get stuck in the parsing stage. + This constant was computed with the following OCaml script. $ dune utop src/lib_scoru_wasm utop # open Tezos_scoru_wasm.Gather_floppies ;; diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - runs with kernel - computation.out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - runs with kernel - computation.out new file mode 100644 index 0000000000000000000000000000000000000000..6d0df9a9891efcad4fcff2c3e06a2a38968d48a6 --- /dev/null +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - runs with kernel - computation.out @@ -0,0 +1,602 @@ + +./tezos-client --wait none originate sc rollup from bootstrap1 of kind wasm_2_0_0 of type string booting with 00000026870061736d01000000014a0c60027f7f017f60027f7f0060037f7f7f017f60000060017f0060037f7f7f0060047f7f7f7f017f60047f7f7f7f0060017f017f60057f7f7f7f7f017f60017f017e60057f7f7f7f7f00034746030400050601000506040700080902070407000803080404040507010a0a0004050008010104010101010b010200000101010301010004020501020a0000080808000b00020204050170011d1d05030100110619037f01418080c0000b7f0041948cc0000b7f0041a08cc0000b073304066d656d6f727902000b6b65726e656c5f6e65787400000a5f5f646174615f656e6403010b5f5f686561705f6261736503020922010041010b1c013c090a0b0c1112131023171c161d18262728292c2d2e35413d363b0afa4646860201057f23808080800041106b22002480808080001094808080000240024041002802e083c080000d004100417f3602e083c080000240024041002802e483c080002201450d00200128020041016a210241002802ec83c08000210341002802e883c0800021040c010b410441041082808080002201450d0241002104410020013602e483c080002001410036020041012102410121030b20012002360200410020033602e883c080004100200420036a3602ec83c08000410041002802e083c0800041016a3602e083c08000200041106a2480808080000f0b41b480c080004110200041086a41c480c0800041a480c0800010c280808000000b4104410410b180808000000b02000b1301017f20002001108680808000210220020f0b0f002000200120021087808080000f0b1701017f2000200120022003108880808000210420040f0b0d002000200110b4808080000f0b120041f083c0800020002001108e808080000b140041f083c08000200020012002108f808080000b4501017f024041f083c0800020032002108e808080002204450d002004200020032001200120034b1b10c5808080001a41f083c08000200020012002108f808080000b20040b02000b7701017f02400240200241027422022003410374418080016a2203200220034b1b418780046a220441107640002203417f470d0041012102410021030c010b20034110742203420037030041002102200341003602082003200320044180807c716a4102723602000b20002003360204200020023602000b05004180040b040041010bef0401087f024020022802002205450d002001417f6a210620004102742107410020016b21080340200541086a2109024002402005280208220a4101710d00200521010c010b03402009200a417e71360200024002402005280204220a417c7122090d00410021010c010b4100200920092d00004101711b21010b02402005280200220b417c71220c450d004100200c200b4102711b220b450d00200b200b2802044103712009723602042005280204220a417c7121090b02402009450d00200920092802004103712005280200417c71723602002005280204210a0b2005200a41037136020420052005280200220941037136020002402009410271450d00200120012802004102723602000b20022001360200200141086a2109200121052001280208220a4101710d000b0b02402001280200417c71220a200141086a22056b2007490d00024002402005200320002004280210118080808000004102746a41086a200a20076b200871220a4d0d0020062005710d0220022009280200417c7136020020012001280200410172360200200121050c010b200a4100360200200a41786a2205420037020020052001280200417c7136020002402001280200220a417c71220b450d004100200b200a4102711b220a450d00200a200a2802044103712005723602040b2005200528020441037120017236020420092009280200417e71360200200120012802002209410371200572220a3602000240024020094102710d00200528020021010c010b2001200a417d713602002005200528020041027222013602000b200520014101723602000b200541086a0f0b20022001280208220536020020050d000b0b41000bac0301037f23808080800041106b22032480808080000240024020010d00200221010c010b200141036a220441027621050240200241054f0d002005417f6a220141ff014b0d00200320003602082003200020014102746a41046a41002001418002491b220028020036020c0240200520022003410c6a200341086a41ec80c08000108d8080800022010d002003200341086a200520021091808080004100210120032802000d0020032802042201200328020c3602082003200136020c200520022003410c6a200341086a41ec80c08000108d8080800021010b2000200328020c3602000c010b2003200028020036020c0240200520022003410c6a41d480c0800041d480c08000108d8080800022010d0002402004417c7122012002410374418080016a2204200120044b1b418780046a220441107640002201417f470d00410021010c010b20014110742201200328020c360208200141003602042001200120044180807c716a4102723602002003200136020c200520022003410c6a41d480c0800041d480c08000108d8080800021010b2000200328020c3602000b200341106a24808080800020010be60501067f23808080800041106b220424808080800002402001450d002002450d000240200341054f0d00200241036a410276417f6a220341ff014b0d0020014100360200200141786a22022002280200417e713602002004200036020c200020034102746a41046a22002802002103024002402004410c6a109380808000450d00024002402001417c6a2205280200417c712206450d00200628020022074101710d0002400240024020022802002208417c7122010d00200621090c010b200621094100200120084102711b2208450d002008200828020441037120067236020420052802002201417c712209450d012002280200417c712101200928020021070b20092001200741037172360200200528020021010b200520014103713602002002200228020022014103713602002001410271450d01200620062802004102723602000c010b20022802002206417c712205450d014100200520064102711b2206450d0120062d00004101710d0120012006280208417c71360200200620024101723602080b200321020c010b200120033602000b200020023602000c010b20014100360200200141786a220220022802002203417e71360200200028020021050240024002402001417c6a2207280200417c712206450d00200628020022094101710d000240024002402003417c7122010d00200621080c010b200621084100200120034102711b2203450d002003200328020441037120067236020420072802002201417c712208450d012002280200417c712101200828020021090b20082001200941037172360200200728020021010b200720014103713602002002200228020022014103713602002001410271450d01200620062802004102723602000c010b2003417c712206450d014100200620034102711b2203450d0120032d00004101710d0120012003280208417c71360200200320024101723602080b200020053602000c010b20012005360200200020023602000b200441106a2480808080000b02000b960201027f23808080800041106b220424808080800020042001280200220528020036020c024002400240200241026a220220026c220241801020024180104b1b220141042004410c6a418481c08000418481c08000108d808080002202450d002005200428020c3602000c010b2004418481c0800020014104108a80808000024002402004280200450d002005200428020c3602000c010b20042802042202200428020c3602082004200236020c200141042004410c6a418481c08000418481c08000108d8080800021022005200428020c36020020020d010b410121010c010b200242003702042002200220014102746a410272360200410021010b2000200236020420002001360200200441106a2480808080000b040020010b040041000b02000b040000000b02000b2a01017f0240200041046a2802002201450d0020002802002200450d002000200141011083808080000b0b2a01017f024020002802042201450d00200041086a2802002200450d002001200041011083808080000b0bdb0101027f23808080800041206b22032480808080000240200120026a22022001490d00200041046a280200220441017422012002200120024b1b22014108200141084b1b2101024002402004450d00200341106a41086a410136020020032004360214200320002802003602100c010b200341003602100b200320014101200341106a109a8080800002402003280200450d00200341086a2802002200450d012003280204200010b180808000000b20032802042102200041046a200136020020002002360200200341206a2480808080000f0b10b280808000000bb50101027f0240024002400240024002400240024002402002450d004101210420014100480d0120032802002205450d02200328020422030d0520010d03200221030c040b20002001360204410121040b410021010c060b20010d00200221030c010b2001200210828080800021030b2003450d010c020b200520032002200110848080800022030d010b20002001360204200221010c010b20002003360204410021040b20002004360200200041086a20013602000bdb0101037f23808080800041206b22022480808080000240200141016a22032001490d00200041046a280200220441017422012003200120034b1b22014108200141084b1b2101024002402004450d00200241106a41086a410136020020022004360214200220002802003602100c010b200241003602100b200220014101200241106a109a8080800002402002280200450d00200241086a2802002200450d012002280204200010b180808000000b20022802042103200041046a200136020020002003360200200241206a2480808080000f0b10b280808000000b0c0042f6e2f8b1f2e1afe7050b0d0042d1ae98c49983b2f7847f0bf70201037f23808080800041106b220224808080800002400240024002402001418001490d002002410036020c20014180104f0d0120022001413f71418001723a000d2002200141067641c001723a000c410221010c020b024020002802082203200041046a280200470d0020002003109b80808000200028020821030b2000200341016a360208200028020020036a20013a00000c020b0240200141808004490d0020022001413f71418001723a000f2002200141127641f001723a000c20022001410676413f71418001723a000e20022001410c76413f71418001723a000d410421010c010b20022001413f71418001723a000e20022001410c7641e001723a000c20022001410676413f71418001723a000d410321010b0240200041046a280200200041086a220428020022036b20014f0d00200020032001109980808000200428020021030b200028020020036a2002410c6a200110c5808080001a2004200320016a3602000b200241106a24808080800041000b180020002802002000280204200028020810a080808000000bbf0101027f23808080800041106b2203248080808000200041146a28020021040240024002400240200041046a2802000e020001030b20040d02419c81c080002100410021040c010b20040d01200028020022002802042104200028020021000b2003200436020420032000360200200341b882c08000200110be808080002002200110c08080800010aa80808000000b2003410036020420032000360200200341a482c08000200110be808080002002200110c08080800010aa80808000000b1c00024020000d00419c81c08000412b200110b880808000000b20000b2000024020000d00419c81c08000412b41f481c0800010b880808000000b20000b02000b2501017f2000200141002802f48bc080002202418b8080800020021b1181808080000000000b5901037f23808080800041106b2201248080808000200010bf8080800041e481c0800010a1808080002102200010be8080800010a28080800021032001200236020820012000360204200120033602002001109f80808000000bb10202047f017e23808080800041306b2202248080808000200141046a2103024020012802040d0020012802002104200241086a41086a22054100360200200242013703082002200241086a360214200241186a41106a200441106a290200370300200241186a41086a200441086a29020037030020022004290200370318200241146a41cc82c08000200241186a10ba808080001a200341086a2005280200360200200320022903083702000b200241186a41086a2204200341086a2802003602002001410c6a41003602002003290200210620014201370204200220063703180240410c410410828080800022010d00410c410410b180808000000b20012002290318370200200141086a20042802003602002000418482c0800036020420002001360200200241306a2480808080000bc80101037f23808080800041306b2202248080808000200141046a2103024020012802040d0020012802002101200241086a41086a22044100360200200242013703082002200241086a360214200241186a41106a200141106a290200370300200241186a41086a200141086a29020037030020022001290200370318200241146a41cc82c08000200241186a10ba808080001a200341086a2004280200360200200320022903083702000b2000418482c0800036020420002003360200200241306a2480808080000b4e01027f200128020421022001280200210302404108410410828080800022010d004108410410b180808000000b20012002360204200120033602002000419482c08000360204200020013602000b14002000419482c08000360204200020013602000bab0201037f23808080800041206b220524808080800041012106410041002802848cc08000220741016a3602848cc080000240024041002d00888cc08000450d0041002802908cc0800041016a21060c010b410041013a00888cc080000b410020063602908cc080000240024020074100480d00200641024b0d00200520043a0018200520033602142005200236021041002802f88bc080002207417f4c0d004100200741016a22073602f88bc08000024041002802808cc080002202450d0041002802fc8bc08000210720052000200128021011818080800000200520052903003703082007200541086a20022802141181808080000041002802f88bc0800021070b41002007417f6a3602f88bc08000200641014b0d0020040d010b00000b2000200110ab80808000000b3101017f23808080800041106b22022480808080002002200136020c20022000360208200241086a1095808080001a00000b5801027f02402000280200220341046a280200200341086a220428020022006b20024f0d00200320002002109980808000200428020021000b200328020020006a2001200210c5808080001a2004200020026a36020041000b120020002802002001109e808080001a41000b7401017f23808080800041206b220224808080800020022000280200360204200241086a41106a200141106a290200370300200241086a41086a200141086a29020037030020022001290200370308200241046a41cc82c08000200241086a10ba808080002101200241206a24808080800020010b0d002000200110b080808000000b0d0020002001108580808000000b0d002000200110b380808000000b4e01017f23808080800041206b22002480808080002000411c6a41003602002000418083c080003602182000420137020c2000419483c08000360208200041086a419c83c0800010b980808000000b0d002000200110af80808000000b0d002000200110a480808000000b0d0020002802001a037f0c000b0b02000bd80701067f20002802102103024002400240024002400240200028020822044101460d0020034101470d010b20034101470d03200120026a2105200041146a28020022060d0141002107200121080c020b2000280218200120022000411c6a28020028020c1182808080000021030c030b41002107200121080340200822032005460d020240024020032c00002208417f4c0d00200341016a21080c010b0240200841604f0d00200341026a21080c010b0240200841704f0d00200341036a21080c010b20032d0002413f7141067420032d0001413f71410c747220032d0003413f7172200841ff0171411274418080f0007172418080c400460d03200341046a21080b200720036b20086a21072006417f6a22060d000b0b20082005460d00024020082c00002203417f4a0d0020034160490d0020034170490d0020082d0002413f7141067420082d0001413f71410c747220082d0003413f7172200341ff0171411274418080f0007172418080c400460d010b02400240024020070d00410021080c010b024020072002490d00410021032002210820072002460d010c020b4100210320072108200120076a2c00004140480d010b20082107200121030b2007200220031b21022003200120031b21010b024020040d002000280218200120022000411c6a28020028020c118280808000000f0b2000410c6a28020021050240024020024110490d002001200210c38080800021080c010b024020020d00410021080c010b20024103712107024002402002417f6a41034f0d0041002108200121030c010b2002417c71210641002108200121030340200820032c000041bf7f4a6a200341016a2c000041bf7f4a6a200341026a2c000041bf7f4a6a200341036a2c000041bf7f4a6a2108200341046a21032006417c6a22060d000b0b2007450d000340200820032c000041bf7f4a6a2108200341016a21032007417f6a22070d000b0b0240200520084d0d0041002103200520086b22072106024002400240410020002d0020220820084103461b4103710e03020001020b41002106200721030c010b20074101762103200741016a41017621060b200341016a21032000411c6a28020021072000280204210820002802182100024003402003417f6a2203450d0120002008200728021011808080800000450d000b41010f0b410121032008418080c400460d01200020012002200728020c118280808000000d01410021030340024020062003470d0020062006490f0b200341016a210320002008200728021011808080800000450d000b2003417f6a2006490f0b2000280218200120022000411c6a28020028020c118280808000000f0b20030b5401017f23808080800041206b2203248080808000200341146a4100360200200341ac83c08000360210200342013702042003200136021c200320003602182003200341186a3602002003200210b980808000000b4c01017f23808080800041206b2202248080808000200241013a00182002200136021420022000360210200241bc83c0800036020c200241ac83c08000360208200241086a10a580808000000bbd05010a7f23808080800041306b2203248080808000200341246a2001360200200341033a0028200342808080808004370308200320003602204100210420034100360218200341003602100240024002400240200228020822050d00200241146a2802002206450d0120022802002101200228021021002006417f6a41ffffffff017141016a2204210603400240200141046a2802002207450d00200328022020012802002007200328022428020c118280808000000d040b2000280200200341086a200041046a280200118080808000000d03200041086a2100200141086a21012006417f6a22060d000c020b0b2002410c6a2802002200450d00200041057421082000417f6a41ffffff3f7141016a2104200228020021014100210603400240200141046a2802002200450d00200328022020012802002000200328022428020c118280808000000d030b2003200520066a2200411c6a2d00003a00282003200041046a290200422089370308200041186a28020021092002280210210a4100210b41002107024002400240200041146a2802000e03010002010b2009410374210c41002107200a200c6a220c280204419880808000470d01200c28020028020021090b410121070b2003200936021420032007360210200041106a28020021070240024002402000410c6a2802000e03010002010b20074103742109200a20096a2209280204419880808000470d01200928020028020021070b4101210b0b2003200736021c2003200b360218200a20002802004103746a2200280200200341086a2000280204118080808000000d02200141086a21012008200641206a2206470d000b0b4100210020042002280204492201450d012003280220200228020020044103746a410020011b22012802002001280204200328022428020c11828080800000450d010b410121000b200341306a24808080800020000b0c004281b8aa93f5f3e5ec140b2100200128021841ac83c08000410e2001411c6a28020028020c118280808000000b140020012000280200200028020410b7808080000b070020002802080b0700200028020c0b070020002d00100b180020002802002001200028020428020c118080808000000b930101017f23808080800041c0006b22052480808080002005200136020c2005200036020820052003360214200520023602102005412c6a41023602002005413c6a4199808080003602002005420237021c200541d083c080003602182005419a808080003602342005200541306a3602282005200541106a3602382005200541086a360230200541186a200410b980808000000ba30801097f02400240200041036a417c71220220006b220320014b0d00200341044b0d00200120036b22044104490d0020044103712105410021064100210102402003450d00200341037121070240024020022000417f736a41034f0d0041002101200021020c010b2003417c71210841002101200021020340200120022c000041bf7f4a6a200241016a2c000041bf7f4a6a200241026a2c000041bf7f4a6a200241036a2c000041bf7f4a6a2101200241046a21022008417c6a22080d000b0b2007450d000340200120022c000041bf7f4a6a2101200241016a21022007417f6a22070d000b0b200020036a210002402005450d0020002004417c716a22022c000041bf7f4a210620054101460d00200620022c000141bf7f4a6a210620054102460d00200620022c000241bf7f4a6a21060b20044102762103200620016a21080340200021062003450d02200341c001200341c001491b220441037121052004410274210902400240200441fc0171220a41027422000d00410021020c010b200620006a2107410021022006210003402000410c6a2802002201417f73410776200141067672418182840871200041086a2802002201417f73410776200141067672418182840871200041046a2802002201417f7341077620014106767241818284087120002802002201417f7341077620014106767241818284087120026a6a6a6a2102200041106a22002007470d000b0b200620096a2100200320046b2103200241087641ff81fc0771200241ff81fc07716a418180046c41107620086a21082005450d000b2006200a4102746a2100200541ffffffff036a220441ffffffff0371220241016a2201410371210302400240200241034f0d00410021020c010b200141fcffffff077121014100210203402000410c6a2802002207417f73410776200741067672418182840871200041086a2802002207417f73410776200741067672418182840871200041046a2802002207417f7341077620074106767241818284087120002802002207417f7341077620074106767241818284087120026a6a6a6a2102200041106a21002001417c6a22010d000b0b02402003450d00200441818080807c6a2101034020002802002207417f7341077620074106767241818284087120026a2102200041046a21002001417f6a22010d000b0b200241087641ff81fc0771200241ff81fc07716a418180046c41107620086a0f0b024020010d0041000f0b20014103712102024002402001417f6a41034f0d00410021080c010b2001417c712101410021080340200820002c000041bf7f4a6a200041016a2c000041bf7f4a6a200041026a2c000041bf7f4a6a200041036a2c000041bf7f4a6a2108200041046a21002001417c6a22010d000b0b2002450d000340200820002c000041bf7f4a6a2108200041016a21002002417f6a22020d000b0b20080bc10201087f024002402002410f4b0d00200021030c010b2000410020006b41037122046a210502402004450d0020002103200121060340200320062d00003a0000200641016a2106200341016a22032005490d000b0b2005200220046b2207417c7122086a210302400240200120046a2209410371450d0020084101480d012009410374220641187121022009417c71220a41046a2101410020066b4118712104200a28020021060340200520062002762001280200220620047472360200200141046a2101200541046a22052003490d000c020b0b20084101480d0020092101034020052001280200360200200141046a2101200541046a22052003490d000b0b20074103712102200920086a21010b02402002450d00200320026a21050340200320012d00003a0000200141016a2101200341016a22032005490d000b0b20000b0e0020002001200210c4808080000b0bea030100418080c0000be0032f7573722f7372632f6b65726e656c5f656e7472792f7372632f63616368652e7273000000001000220000001300000020000000616c726561647920626f72726f776564010000000000000001000000020000000300000000000000010000000400000005000000060000000300000004000000040000000700000008000000090000000a000000000000000100000004000000050000000600000063616c6c656420604f7074696f6e3a3a756e77726170282960206f6e206120604e6f6e65602076616c75656c6962726172792f7374642f7372632f70616e69636b696e672e727300c70010001c000000460200001f000000c70010001c000000470200001e0000000c0000000c000000040000000d0000000e00000008000000040000000f00000010000000100000000400000011000000120000000e000000080000000400000013000000140000000e00000004000000040000001500000016000000170000006c6962726172792f616c6c6f632f7372632f7261775f7665632e72736361706163697479206f766572666c6f770000008001100011000000640110001c0000000602000005000000426f72726f774d75744572726f7200001b00000000000000010000001c0000003a200000ac01100000000000cc01100002000000 --burn-cap 9999999 +Node is bootstrapped. +Estimated gas: 3149.921 units (will add 100 for safety) +Estimated storage: 16523 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.01055 + Expected counter: 1 + Gas limit: 3250 + Storage limit: 16543 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.01055 + payload fees(the block proposer) ....... +ꜩ0.01055 + Smart contract rollup origination: + Kind: wasm_2_0_0 + Parameter type: string + Boot sector: '&‡asmJ ```````````~`GF  + +  + pA€€À A”ŒÀ A ŒÀ 3memory kernel_next +__data_end __heap_base "A < + #&'(),-.5A=6; +úFF†#€€€€Ak"$€€€€”€€€@@A(àƒÀ€ AA6àƒÀ€@@A(äƒÀ€"E (Aj!A(ìƒÀ€!A(èƒÀ€!  AA‚€€€"E A!A 6äƒÀ€ A6A!A!  6A 6èƒÀ€A  j6ìƒÀ€AA(àƒÀ€Aj6àƒÀ€ Aj$€€€€ A´€À€A AjAÄ€À€A¤€À€€€€ AA±€€€   †€€€!    ‡€€€    ˆ€€€!  ´€€€ AðƒÀ€ Ž€€€ AðƒÀ€  €€€ E@AðƒÀ€  Ž€€€"E     KÅ€€€AðƒÀ€  €€€   w@@ At" AtA€€j"  KA‡€j"Av@"AG A!A!  At"B7A! A6   A€€|qjAr6 6 6 A€ A ï@ ("E Aj! At!A k!@ Aj! @@ (" +Aq !  @ +A~q6@@ (" +A|q" A!  A -Aq! @ (" A|q" E A Aq" E (Aq r6 (" +A|q! @ E (Aq (A|qr6 (! +  +Aq6  (" Aq6@ AqE  (Ar6  6 Aj! ! (" +Aq @ (A|q" + Aj"k I @@   (€€€€AtjAj + k q" +M  q   (A|q6  (Ar6 !  +A6 +Axj"B7  (A|q6@ (" +A|q" E A +Aq" +E + +(Aq r6  (Aq r6 (A~q6  (" Aq r" +6@@ Aq (!   +A}q6  (Ar"6  Ar6 Aj  ("6  A ¬#€€€€Ak"$€€€€@@  !  Aj"Av!@ AO Aj"AÿK  6  AtjAjA A€I"(6 @   A j AjAì€À€€€€"  Aj  ‘€€€A! ( (" ( 6  6   A j AjAì€À€€€€! ( 6   (6 @   A jAÔ€À€AÔ€À€€€€" @ A|q" AtA€€j"  KA‡€j"Av@"AG A!  At" ( 6 A6   A€€|qjAr6  6   A jAÔ€À€AÔ€À€€€€! ( 6 Aj$€€€€  æ#€€€€Ak"$€€€€@ E E @ AO AjAvAj"AÿK A6 Axj" (A~q6  6 AtjAj"(!@@ A j“€€€E @@ A|j"(A|q"E ("Aq @@@ ("A|q" !  ! A  Aq"E  (Aq r6 ("A|q" E  (A|q! (!  Aqr6 (!  Aq6  ("Aq6 AqE   (Ar6  ("A|q"E A  Aq"E  -Aq   (A|q6  Ar6 !   6 6  A6 Axj" ("A~q6 (!@@@ A|j"(A|q"E (" Aq @@@ A|q" !  !A  Aq"E  (Aq r6 ("A|q"E  (A|q! (!   Aqr6 (!  Aq6  ("Aq6 AqE   (Ar6  A|q"E A  Aq"E  -Aq   (A|q6  Ar6 6   6 6 Aj$€€€€  –#€€€€Ak"$€€€€  ("(6 @@@ Aj" l"A€ A€K"A A jA„À€A„À€€€€"E  ( 6  A„À€ AŠ€€€@@ (E  ( 6  (" ( 6  6 A A jA„À€A„À€€€€!  ( 6   A!  B7   AtjAr6A! 6 6 Aj$€€€€   A    *@ Aj("E ("E Aƒ€€€ *@ ("E Aj("E  Aƒ€€€ Û#€€€€A k"$€€€€@  j" I Aj("At"   K"A AK!@@ E AjAjA6  6  (6  A6  A Ajš€€€@ (E Aj("E  ( ±€€€ (! Aj 6 6 A j$€€€€ ²€€€ µ@@@@@@@@@ E A! AH  ("E  ("    !  6A! A!   !   ‚€€€! E      „€€€"  6 !  6A! 6 Aj 6 Û#€€€€A k"$€€€€@ Aj" I Aj("At"   K"A AK!@@ E AjAjA6  6  (6  A6  A Ajš€€€@ (E Aj("E  ( ±€€€ (! Aj 6 6 A j$€€€€ ²€€€ Böâø±òá¯ç BÑ®˜Ä™ƒ²÷„ ÷#€€€€Ak"$€€€€@@@@ A€I A6 A€O   A?qA€r:  AvAÀr: A!  @ (" Aj(G ›€€€ (! Aj6 ( j :  @ A€€I  A?qA€r:  AvAðr:  AvA?qA€r:  A vA?qA€r: A!   A?qA€r:  A vAàr:  AvA?qA€r: A! @ Aj( Aj"("k O  ™€€€ (! ( j A j Å€€€   j6 Aj$€€€€A  ( ( ( €€€ ¿#€€€€Ak"$€€€€ Aj(!@@@@ Aj(  AœÀ€!A!    ("(! (!  6  6 A¸‚À€ ¾€€€  À€€€ª€€€ A6  6 A¤‚À€ ¾€€€  À€€€ª€€€ @ AœÀ€A+ ¸€€€ @ AœÀ€A+AôÀ€¸€€€  % A(ô‹À€"A‹€€€ €€€ Y#€€€€Ak"$€€€€ ¿€€€AäÀ€¡€€€! ¾€€€¢€€€!  6  6  6 Ÿ€€€ ±~#€€€€A0k"$€€€€ Aj!@ ( (! AjAj"A6 B7  Aj6 AjAj Aj)7 AjAj Aj)7  )7 AjAÌ‚À€ Ajº€€€ Aj (6  )7 AjAj" Aj(6 A jA6 )! B7  7@A A‚€€€" A A±€€€  )7 Aj (6 A„‚À€6 6 A0j$€€€€ È#€€€€A0k"$€€€€ Aj!@ ( (! AjAj"A6 B7  Aj6 AjAj Aj)7 AjAj Aj)7  )7 AjAÌ‚À€ Ajº€€€ Aj (6  )7 A„‚À€6 6 A0j$€€€€ N (! (!@AA‚€€€" AA±€€€  6  6 A”‚À€6 6  A”‚À€6 6 «#€€€€A k"$€€€€A!AA(„ŒÀ€"Aj6„ŒÀ€@@A-ˆŒÀ€E A(ŒÀ€Aj!  AA:ˆŒÀ€ A 6ŒÀ€@@ AH AK  :  6  6A(ø‹À€"AL A Aj"6ø‹À€@A(€ŒÀ€"E A(ü‹À€!  (€€€  )7  Aj (€€€A(ø‹À€! A Aj6ø‹À€ AK   «€€€ 1#€€€€Ak"$€€€€  6  6 Aj•€€€ X@ ("Aj( Aj"("k O  ™€€€ (! ( j  Å€€€  j6A  ( ž€€€A t#€€€€A k"$€€€€  (6 AjAj Aj)7 AjAj Aj)7  )7 AjAÌ‚À€ Ajº€€€! A j$€€€€  °€€€ …€€€ ³€€€ N#€€€€A k"$€€€€ AjA6 A€ƒÀ€6 B7 A”ƒÀ€6 AjAœƒÀ€¹€€€ ¯€€€ ¤€€€ (  Ø (!@@@@@@ ("AF AG  AG   j! Aj(" A! !  (   Aj(( ‚€€€!  A! !@ " F @@ ,"AL Aj!  @ A`O Aj!  @ ApO Aj!  -A?qAt -A?qA tr -A?qr AÿqAtA€€ðqrA€€ÄF  Aj!  k j! Aj"  F @ ,"AJ A`I ApI -A?qAt -A?qA tr -A?qr AÿqAtA€€ðqrA€€ÄF  @@@  A!  @  I A! !  F   A! !  j,A@H  ! !   !   ! @  (   Aj(( ‚€€€ A j(!@@ AI  À€€!  @  A!  Aq!@@ AjAO A! !  A|q!A! !@  ,A¿Jj Aj,A¿Jj Aj,A¿Jj Aj,A¿Jj! Aj! A|j" E @  ,A¿Jj! Aj! Aj" @  M A!  k"!@@@A - " AFAq A! !  Av! AjAv! Aj! Aj(! (! (!@@ Aj"E   (€€€€E A A! A€€ÄF    ( ‚€€€ A!@@  G  I Aj!  (€€€€E Aj I (   Aj(( ‚€€€  T#€€€€A k"$€€€€ AjA6 A¬ƒÀ€6 B7  6  6  Aj6  ¹€€€ L#€€€€A k"$€€€€ A:  6  6 A¼ƒÀ€6 A¬ƒÀ€6 Aj¥€€€ ½ +#€€€€A0k"$€€€€ A$j 6 A:( B€€€€€7  6 A! A6 A6@@@@ (" Aj("E  (! (! AjAÿÿÿÿqAj"!@@ Aj("E ( (  ($( ‚€€€  ( Aj Aj(€€€€  Aj! Aj! Aj"  A j("E At! AjAÿÿÿ?qAj! (!A!@@ Aj("E ( ( ($( ‚€€€    j"Aj-:(  Aj)B ‰7 Aj(! (! +A! A!@@@ Aj( At! A! + j" (A˜€€€G  ((! A!  6  6 Aj(!@@@ A j( At! + j" (A˜€€€G  ((! A!  6  6 + (Atj"( Aj (€€€€  Aj!  A j"G A!  (I"E  ( ( AtjA "( ( ($( ‚€€€E  A! A0j$€€€€ B¸ª“õóåì ! (A¬ƒÀ€A Aj(( ‚€€€   ( (·€€€  (  (  -  (  (( €€€€ “#€€€€AÀk"$€€€€  6  6  6  6 A,jA6 A s + +(* [read_kernel filename] reads binary encoded WebAssembly module (e.g. `foo.wasm`) + and returns a hex-encoded Wasm PVM boot sector, suitable for passing to + [originate_sc_rollup] or [with_fresh_rollup]. + + See also [wasm_incomplete_kernel_boot_sector]. + + Note that this uses [Tezos_scoru_wasm.Gather_floppies.Complete_kernel], so + the kernel must fit into a single Tezos operation. +*) +let read_kernel name : string = + let module G = Tezos_scoru_wasm.Gather_floppies in + let open Tezt.Base in + let kernel_file = + project_root // Filename.dirname __FILE__ + // "../../src/proto_alpha/lib_protocol/test/integration/wasm_kernel" + // (name ^ ".wasm") + in + hex_encode + @@ Data_encoding.Binary.to_string_exn G.origination_message_encoding + @@ G.Complete_kernel (Bytes.of_string @@ read_file kernel_file) + (* Number of levels needed to process a head as finalized. This value should be the same as `node_context.block_finality_time`, where `node_context` is the `Node_context.t` used by the rollup node. For Tenderbake, the @@ -295,8 +319,8 @@ let publish_commitment ?(src = Constant.bootstrap1.public_key_hash) ~commitment *) -(* Originate a new SCORU of the arithmetic kind - -------------------------------------------- +(* Originate a new SCORU + --------------------- - Rollup addresses are fully determined by operation hashes and origination nonce. *) @@ -310,6 +334,11 @@ let test_origination ~kind = let* _sc_rollup = originate_sc_rollup ~kind ~src:bootstrap1_key client in unit) +(* Initialize configuration + ------------------------ + + Can use CLI to initialize the rollup node config file +*) let test_rollup_node_configuration ~kind = regression_test ~__FILE__ @@ -994,13 +1023,8 @@ let test_rollup_node_boots_into_initial_state ~kind = node client) -(* Ensure the PVM is transitioning upon incoming messages. - ------------------------------------------------------- - - When the rollup node receives messages, we like to see evidence that the PVM - has advanced. -*) -let test_rollup_node_advances_pvm_state protocols ~kind = +let test_rollup_node_advances_pvm_state protocols ~test_name ~boot_sector + ~internal ~kind = let go ~internal client sc_rollup sc_rollup_node = let* genesis_info = RPC.Client.call ~hooks client @@ -1037,6 +1061,7 @@ let test_rollup_node_advances_pvm_state protocols ~kind = contract_id ; return (level + 1, Some contract_id) in + (* Called with monotonically increasing [i] *) let test_message i = let* prev_state_hash = Sc_rollup_client.state_hash ~hooks sc_rollup_client @@ -1061,7 +1086,7 @@ let test_rollup_node_advances_pvm_state protocols ~kind = Client.bake_for_and_wait client in let* _ = - Sc_rollup_node.wait_for_level ~timeout:3. sc_rollup_node (level + i) + Sc_rollup_node.wait_for_level ~timeout:30. sc_rollup_node (level + i) in (* specific per kind PVM checks *) @@ -1089,7 +1114,16 @@ let test_rollup_node_advances_pvm_state protocols ~kind = int ~error_msg:"Invalid value in rollup state (%L <> %R)") ; return () - | "wasm_2_0_0" -> return () + | "wasm_2_0_0" -> + (* TODO: https://gitlab.com/tezos/tezos/-/issues/3729 + + Add an appropriate check for various test kernels + + computation.wasm - Gets into eval state + no_parse_random.wasm - Stuck state due to parse error + no_parse_bad_fingerprint.wasm - Stuck state due to parse error + *) + return () | _otherwise -> raise (Invalid_argument kind) in @@ -1102,6 +1136,7 @@ let test_rollup_node_advances_pvm_state protocols ~kind = Check.(ticks >= prev_ticks) Check.int ~error_msg:"Tick counter did not advance (%L >= %R)" ; + Lwt.return_unit in let* () = Lwt_list.iter_s test_message (range 1 10) in @@ -1109,33 +1144,70 @@ let test_rollup_node_advances_pvm_state protocols ~kind = Lwt.return_unit in - regression_test - ~__FILE__ - ~tags:["sc_rollup"; "run"; "node"; kind] - (Format.asprintf "%s - node advances PVM state with messages" kind) - (fun protocol -> - setup ~protocol @@ fun node client -> - with_fresh_rollup - ~kind - (fun sc_rollup_address sc_rollup_node _filename -> - go ~internal:false client sc_rollup_address sc_rollup_node) - node - client) - protocols ; + if not internal then + regression_test + ~__FILE__ + ~tags:["sc_rollup"; "run"; "node"; kind] + test_name + (fun protocol -> + setup ~protocol @@ fun node client -> + with_fresh_rollup + ~kind + ?boot_sector + (fun sc_rollup_address sc_rollup_node _filename -> + go ~internal:false client sc_rollup_address sc_rollup_node) + node + client) + protocols + else + regression_test + ~__FILE__ + ~tags:["sc_rollup"; "run"; "node"; "internal"; kind] + test_name + (fun protocol -> + setup ~protocol @@ fun node client -> + with_fresh_rollup + ~kind + ?boot_sector + (fun sc_rollup_address sc_rollup_node _filename -> + go ~internal:true client sc_rollup_address sc_rollup_node) + node + client) + protocols - regression_test - ~__FILE__ - ~tags:["sc_rollup"; "run"; "node"; "internal"; kind] - (Format.asprintf "%s - node advances PVM state with internal messages" kind) - (fun protocol -> - setup ~protocol @@ fun node client -> - with_fresh_rollup - ~kind - (fun sc_rollup_address sc_rollup_node _filename -> - go ~internal:true client sc_rollup_address sc_rollup_node) - node - client) +let test_rollup_node_run_with_kernel protocols ~kind ~kernel_name ~internal = + test_rollup_node_advances_pvm_state + protocols + ~test_name:(Format.asprintf "%s - runs with kernel - %s" kind kernel_name) + ~boot_sector:(Some (read_kernel kernel_name)) + ~internal + ~kind + +(* Ensure the PVM is transitioning upon incoming messages. + ------------------------------------------------------- + + When the rollup node receives messages, we like to see evidence that the PVM + has advanced. + + Specifically [test_rollup_node_advances_pvm_state ?boot_sector protocols ~kind] + + * Originates a SCORU of [kind] + * Originates a L1 contract to send internal messages from + * Sends internal or external messages to the rollup + + After each a PVM kind-specific test is run, asserting the validity of the new state. +*) +let test_rollup_node_advances_pvm_state protocols ~kind ~boot_sector ~internal = + test_rollup_node_advances_pvm_state protocols + ~test_name: + (Format.asprintf + "%s - node advances PVM state with %smessages" + kind + (if internal then "internal " else "")) + ~boot_sector + ~internal + ~kind (* Ensure that commitments are stored and published properly. ---------------------------------------------------------- @@ -2921,7 +2993,16 @@ let register ~kind ~protocols = sc_rollup_node_handles_chain_reorg protocols ; test_rollup_node_boots_into_initial_state protocols ~kind ; - test_rollup_node_advances_pvm_state protocols ~kind ; + test_rollup_node_advances_pvm_state + protocols + ~kind + ~boot_sector:None + ~internal:false ; + test_rollup_node_advances_pvm_state + protocols + ~kind + ~boot_sector:None + ~internal:true ; test_commitment_scenario "commitment_is_stored" commitment_stored @@ -3008,6 +3089,22 @@ let register ~protocols = (* Specific Arith PVM tezts *) test_rollup_arith_origination_boot_sector protocols ; test_rollup_node_uses_arith_boot_sector protocols ; + (* Specific Wasm PVM tezts *) + test_rollup_node_run_with_kernel + protocols + ~kind:"wasm_2_0_0" + ~kernel_name:"computation" + ~internal:false ; + test_rollup_node_run_with_kernel + protocols + ~kind:"wasm_2_0_0" + ~kernel_name:"no_parse_random" + ~internal:false ; + test_rollup_node_run_with_kernel + protocols + ~kind:"wasm_2_0_0" + ~kernel_name:"no_parse_bad_fingerprint" + ~internal:false ; (* Shared tezts - will be executed for both PVMs. *) register ~kind:"wasm_2_0_0" ~protocols ; register ~kind:"arith" ~protocols ;