diff --git a/src/lib_riscv/pvm/backend.ml b/src/lib_riscv/pvm/backend.ml index e526d708796307166ba7859b900e0545a19a5a40..13bd1846f3f28cdc0a76e01f742d83d6750be6ea 100644 --- a/src/lib_riscv/pvm/backend.ml +++ b/src/lib_riscv/pvm/backend.ml @@ -49,8 +49,11 @@ let state_hash state = Api.octez_riscv_state_hash state let set_input state level message_counter payload = Lwt.return - (Api.octez_riscv_set_input + (Api.octez_riscv_set_input_message state level message_counter (Bytes.of_string payload)) + +let set_metadata state address origination_level = + Lwt.return (Api.octez_riscv_set_metadata state address origination_level) diff --git a/src/lib_riscv/pvm/backend.mli b/src/lib_riscv/pvm/backend.mli index f62c1e0db3945ff29c8de42bd7beb93f0c166dd3..214b4cafd32c07cfd6fd6f254f956dd0e29c48a0 100644 --- a/src/lib_riscv/pvm/backend.mli +++ b/src/lib_riscv/pvm/backend.mli @@ -43,3 +43,5 @@ val get_current_level : state -> int32 option Lwt.t val state_hash : state -> bytes val set_input : state -> int32 -> int64 -> string -> state Lwt.t + +val set_metadata : state -> bytes -> int32 -> state Lwt.t diff --git a/src/proto_alpha/lib_sc_rollup_node/riscv_pvm.ml b/src/proto_alpha/lib_sc_rollup_node/riscv_pvm.ml index 49c1c08a00fb0bb231e0537b3a4a0b5ea24c0da2..e2830fcc849a4284ef13b45c001aa2325af022cd 100644 --- a/src/proto_alpha/lib_sc_rollup_node/riscv_pvm.ml +++ b/src/proto_alpha/lib_sc_rollup_node/riscv_pvm.ml @@ -62,14 +62,19 @@ module PVM : let is_input_state ~is_reveal_enabled:_ state = let open Lwt_syntax in - let* level = Backend.get_current_level state in - match level with - | None -> return Sc_rollup.Initial - | Some level -> - let* message_counter = Backend.get_message_counter state in - return - (Sc_rollup.First_after - (Raw_level.of_int32_exn level, Z.of_int64 message_counter)) + let* status = Backend.get_status state in + match status with + | Evaluating -> return Sc_rollup.No_input_required + | WaitingForInput -> ( + let* level = Backend.get_current_level state in + match level with + | None -> return Sc_rollup.Initial + | Some level -> + let* message_counter = Backend.get_message_counter state in + return + (Sc_rollup.First_after + (Raw_level.of_int32_exn level, Z.of_int64 message_counter))) + | WaitingForMetadata -> return Sc_rollup.(Needs_reveal Reveal_metadata) let set_input input state = match input with @@ -79,7 +84,12 @@ module PVM : (Raw_level.to_int32 inbox_level) (Z.to_int64 message_counter) (Sc_rollup.Inbox_message.unsafe_to_string payload) - | Sc_rollup.Reveal _ -> assert false + | Sc_rollup.(Reveal (Metadata {address; origination_level})) -> + Backend.set_metadata + state + (Sc_rollup.Address.to_bytes address) + (Raw_level.to_int32 origination_level) + | _ -> assert false let eval state = Backend.compute_step state diff --git a/src/riscv/lib/octez_riscv_api.ml b/src/riscv/lib/octez_riscv_api.ml index d61d7796d23965d201ee0ef6238677ab71b23154..6b55b4357edd920e79c73299fc19fadac945ea3a 100644 --- a/src/riscv/lib/octez_riscv_api.ml +++ b/src/riscv/lib/octez_riscv_api.ml @@ -27,6 +27,7 @@ external octez_riscv_get_tick: state -> int64 = "octez_riscv_get_tick" external octez_riscv_get_level: state -> int32 option = "octez_riscv_get_level" external octez_riscv_install_boot_sector: state -> bytes -> state = "octez_riscv_install_boot_sector" external octez_riscv_state_hash: state -> bytes = "octez_riscv_state_hash" -external octez_riscv_set_input: state -> int32 -> int64 -> bytes -> state = "octez_riscv_set_input" +external octez_riscv_set_input_message: state -> int32 -> int64 -> bytes -> state = "octez_riscv_set_input_message" +external octez_riscv_set_metadata: state -> bytes -> int32 -> state = "octez_riscv_set_metadata" external octez_riscv_get_message_counter: state -> int64 = "octez_riscv_get_message_counter" external octez_riscv_storage_export_snapshot: repo -> id -> string -> (unit, [`Msg of string]) result = "octez_riscv_storage_export_snapshot" diff --git a/src/riscv/lib/octez_riscv_api.mli b/src/riscv/lib/octez_riscv_api.mli index d61d7796d23965d201ee0ef6238677ab71b23154..6b55b4357edd920e79c73299fc19fadac945ea3a 100644 --- a/src/riscv/lib/octez_riscv_api.mli +++ b/src/riscv/lib/octez_riscv_api.mli @@ -27,6 +27,7 @@ external octez_riscv_get_tick: state -> int64 = "octez_riscv_get_tick" external octez_riscv_get_level: state -> int32 option = "octez_riscv_get_level" external octez_riscv_install_boot_sector: state -> bytes -> state = "octez_riscv_install_boot_sector" external octez_riscv_state_hash: state -> bytes = "octez_riscv_state_hash" -external octez_riscv_set_input: state -> int32 -> int64 -> bytes -> state = "octez_riscv_set_input" +external octez_riscv_set_input_message: state -> int32 -> int64 -> bytes -> state = "octez_riscv_set_input_message" +external octez_riscv_set_metadata: state -> bytes -> int32 -> state = "octez_riscv_set_metadata" external octez_riscv_get_message_counter: state -> int64 = "octez_riscv_get_message_counter" external octez_riscv_storage_export_snapshot: repo -> id -> string -> (unit, [`Msg of string]) result = "octez_riscv_storage_export_snapshot" diff --git a/src/riscv/lib/src/ocaml_api.rs b/src/riscv/lib/src/ocaml_api.rs index 5fe6656cc3c4e444dedfaf168a4e5e42c52090e4..69dc34f00c7a7293157c4cb4ba061d82b8ba020e 100644 --- a/src/riscv/lib/src/ocaml_api.rs +++ b/src/riscv/lib/src/ocaml_api.rs @@ -239,7 +239,7 @@ pub fn octez_riscv_state_hash(state: Pointer) -> [u8; 32] { #[ocaml::func] #[ocaml::sig("state -> int32 -> int64 -> bytes -> state")] -pub fn octez_riscv_set_input( +pub fn octez_riscv_set_input_message( state: Pointer, level: u32, message_counter: u64, @@ -249,11 +249,22 @@ pub fn octez_riscv_set_input( state .as_ref() .0 - .set_input(level, message_counter, input.to_vec()), + .set_input_message(level, message_counter, input.to_vec()), ) .into() } +#[ocaml::func] +#[ocaml::sig("state -> bytes -> int32 -> state")] +pub fn octez_riscv_set_metadata( + state: Pointer, + address: &[u8], + origination_level: u32, +) -> Pointer { + let address: &[u8; 20] = address.try_into().expect("Unexpected rollup address size"); + State(state.as_ref().0.set_metadata(address, origination_level)).into() +} + #[ocaml::func] #[ocaml::sig("state -> int64")] pub fn octez_riscv_get_message_counter(state: Pointer) -> u64 { diff --git a/src/riscv/lib/src/pvm/dummy_pvm.rs b/src/riscv/lib/src/pvm/dummy_pvm.rs index 3d2cd461ed1c3c7e3dc2d975eacd02a75cd3a115..34c829d7fbec10acfd7b57ed8592542cc428aaab 100644 --- a/src/riscv/lib/src/pvm/dummy_pvm.rs +++ b/src/riscv/lib/src/pvm/dummy_pvm.rs @@ -148,6 +148,7 @@ impl DummyPvm { let steps = state .pvm .eval_range_while(pvm_hooks, &(..=max_steps), |_| true); + // TODO: RV-78 update tick counter with number of steps state.tick.write(state.tick.read() + 1); (Self { backend }, steps as i64) } @@ -158,16 +159,35 @@ impl DummyPvm { .unwrap() } - pub fn set_input(&self, level: u32, message_counter: u64, _input: Vec) -> Self { + pub fn set_input_message(&self, level: u32, message_counter: u64, input: Vec) -> Self { self.with_new_backend(|state| { - let tick = state.tick.read(); - state.tick.write(tick + 1); + assert!( + state + .pvm + .provide_input(level, message_counter as u32, &input), + "Cannot accept input in current state ({})", + state.pvm.status() + ); + state.tick.write(state.tick.read() + 1); state.message_counter.write(message_counter); state.level_is_set.write(true); state.level.write(level); }) } + pub fn set_metadata(&self, rollup_address: &[u8; 20], origination_level: u32) -> Self { + self.with_new_backend(|state| { + assert!( + state + .pvm + .provide_metadata(rollup_address, origination_level), + "Cannot accept metadata in current state ({})", + state.pvm.status() + ); + state.tick.write(state.tick.read() + 1); + }) + } + pub fn to_bytes(&self) -> &[u8] { self.backend.borrow() } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- riscv - RPC API should work and be stable.out b/tezt/tests/expected/sc_rollup.ml/Alpha- riscv - RPC API should work and be stable.out index 9a70662d2b19f6fd772e37e0d495bb156f602963..55cfcee8c167bb3aa46283ab82c89a1c2cc77658 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- riscv - RPC API should work and be stable.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- riscv - RPC API should work and be stable.out @@ -1,7 +1,7 @@ -./octez-client --wait none originate smart rollup rollup from bootstrap1 of kind riscv of type string with kernel --burn-cap 9999999 +./octez-client --wait none originate smart rollup rollup from bootstrap1 of kind riscv of type string with kernel kernel:src/riscv/assets/riscv-dummy.elf:e162d416fa0c3909bbde908311e873dbb87cd1a22d8c7daee1c77074090fe593 --burn-cap 9999999 Node is bootstrapped. -Estimated gas: 1930.030 units (will add 100 for safety) +Estimated gas: 1933.839 units (will add 100 for safety) Estimated storage: 6552 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -12,19 +12,19 @@ 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.000441 + Fee to the baker: ꜩ0.000545 Expected counter: 1 - Gas limit: 2031 + Gas limit: 2034 Storage limit: 6572 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000441 - payload fees(the block proposer) ....... +ꜩ0.000441 + [PUBLIC_KEY_HASH] ... -ꜩ0.000545 + payload fees(the block proposer) ....... +ꜩ0.000545 Smart rollup origination: Kind: riscv Parameter type: string - Kernel Blake2B hash: '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8' + Kernel Blake2B hash: '8711b89903907c10b84c8eeda35df72bfb5cb7b79216f3c93a9ad6a0ccc6ac2a' This smart rollup origination was successfully applied - Consumed gas: 1929.997 + Consumed gas: 1933.806 Storage size: 6552 bytes Address: [SMART_ROLLUP_HASH] Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] @@ -235,11 +235,11 @@ GET http://[HOST]:[PORT]/global/block/head/num_messages GET http://[HOST]:[PORT]/global/block/head/status 200 OK -"Evaluating" +"Waiting for input message" GET http://[HOST]:[PORT]/global/block/head/ticks 200 OK -"8" +"16" GET http://[HOST]:[PORT]/global/block/head/state_hash 200 OK diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- riscv - node advances PVM state with messages (external).out b/tezt/tests/expected/sc_rollup.ml/Alpha- riscv - node advances PVM state with messages (external).out index d595d20afd09c6d69ec1dd0594dbd915b7e7fdb2..3a68487d0c11b114229200858bf5735b5f28ff53 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- riscv - node advances PVM state with messages (external).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- riscv - node advances PVM state with messages (external).out @@ -1,7 +1,7 @@ -./octez-client --wait none originate smart rollup rollup from bootstrap1 of kind riscv of type bytes with kernel --burn-cap 9999999 +./octez-client --wait none originate smart rollup rollup from bootstrap1 of kind riscv of type bytes with kernel kernel:src/riscv/assets/riscv-dummy.elf:e162d416fa0c3909bbde908311e873dbb87cd1a22d8c7daee1c77074090fe593 --burn-cap 9999999 Node is bootstrapped. -Estimated gas: 1930.030 units (will add 100 for safety) +Estimated gas: 1933.839 units (will add 100 for safety) Estimated storage: 6552 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -12,19 +12,19 @@ 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.000441 + Fee to the baker: ꜩ0.000545 Expected counter: 1 - Gas limit: 2031 + Gas limit: 2034 Storage limit: 6572 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000441 - payload fees(the block proposer) ....... +ꜩ0.000441 + [PUBLIC_KEY_HASH] ... -ꜩ0.000545 + payload fees(the block proposer) ....... +ꜩ0.000545 Smart rollup origination: Kind: riscv Parameter type: bytes - Kernel Blake2B hash: '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8' + Kernel Blake2B hash: '8711b89903907c10b84c8eeda35df72bfb5cb7b79216f3c93a9ad6a0ccc6ac2a' This smart rollup origination was successfully applied - Consumed gas: 1929.997 + Consumed gas: 1933.806 Storage size: 6552 bytes Address: [SMART_ROLLUP_HASH] Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] @@ -72,7 +72,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"4" +"11" GET http://[HOST]:[PORT]/global/block/head/state_hash 200 OK @@ -80,7 +80,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"4" +"11" ./octez-client --wait none send smart rollup message '["2 8 + value"]' from bootstrap2 @@ -113,7 +113,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"8" +"19" GET http://[HOST]:[PORT]/global/block/head/state_hash 200 OK @@ -121,7 +121,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"8" +"19" ./octez-client --wait none send smart rollup message '["3 10 + value"]' from bootstrap2 @@ -154,7 +154,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"12" +"27" GET http://[HOST]:[PORT]/global/block/head/state_hash 200 OK @@ -162,7 +162,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"12" +"27" ./octez-client --wait none send smart rollup message '["4 12 + value"]' from bootstrap2 @@ -195,7 +195,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"16" +"35" GET http://[HOST]:[PORT]/global/block/head/state_hash 200 OK @@ -203,7 +203,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"16" +"35" ./octez-client --wait none send smart rollup message '["5 14 + value"]' from bootstrap2 @@ -236,7 +236,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"20" +"43" GET http://[HOST]:[PORT]/global/block/head/state_hash 200 OK @@ -244,7 +244,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"20" +"43" ./octez-client --wait none send smart rollup message '["6 16 + value"]' from bootstrap2 @@ -277,7 +277,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"24" +"51" GET http://[HOST]:[PORT]/global/block/head/state_hash 200 OK @@ -285,7 +285,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"24" +"51" ./octez-client --wait none send smart rollup message '["7 18 + value"]' from bootstrap2 @@ -318,7 +318,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"28" +"59" GET http://[HOST]:[PORT]/global/block/head/state_hash 200 OK @@ -326,7 +326,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"28" +"59" ./octez-client --wait none send smart rollup message '["8 20 + value"]' from bootstrap2 @@ -359,7 +359,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"32" +"67" GET http://[HOST]:[PORT]/global/block/head/state_hash 200 OK @@ -367,7 +367,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"32" +"67" ./octez-client --wait none send smart rollup message '["9 22 + value"]' from bootstrap2 @@ -400,7 +400,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"36" +"75" GET http://[HOST]:[PORT]/global/block/head/state_hash 200 OK @@ -408,7 +408,7 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"36" +"75" ./octez-client --wait none send smart rollup message '["10 24 + value"]' from bootstrap2 @@ -441,5 +441,5 @@ GET http://[HOST]:[PORT]/global/block/head/state_hash GET http://[HOST]:[PORT]/global/block/head/total_ticks 200 OK -"40" +"83" diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- riscv - node advances PVM state with messages (internal).out b/tezt/tests/expected/sc_rollup.ml/Alpha- riscv - node advances PVM state with messages (internal).out deleted file mode 100644 index dcc2a0eee22e2fdc2a59370d3c863b0259ffeb73..0000000000000000000000000000000000000000 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- riscv - node advances PVM state with messages (internal).out +++ /dev/null @@ -1,195 +0,0 @@ - -./octez-client --wait none originate smart rollup rollup from bootstrap1 of kind riscv of type bytes with kernel --burn-cap 9999999 -Node is bootstrapped. -Estimated gas: 1930.030 units (will add 100 for safety) -Estimated storage: 6552 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 - octez-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.000441 - Expected counter: 1 - Gas limit: 2031 - Storage limit: 6572 bytes - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000441 - payload fees(the block proposer) ....... +ꜩ0.000441 - Smart rollup origination: - Kind: riscv - Parameter type: bytes - Kernel Blake2B hash: '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8' - This smart rollup origination was successfully applied - Consumed gas: 1929.997 - Storage size: 6552 bytes - Address: [SMART_ROLLUP_HASH] - Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] - Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ1.638 - storage fees ........................... +ꜩ1.638 - -Smart rollup [SMART_ROLLUP_HASH] memorized as "rollup" -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"3" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"7" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"7" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"11" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"11" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"15" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"15" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"19" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"19" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"23" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"23" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"27" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"27" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"31" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"31" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"35" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"35" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"39" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"39" - -GET http://[HOST]:[PORT]/global/block/head/state_hash -200 OK -"[SC_ROLLUP_PVM_STATE_HASH]" - -GET http://[HOST]:[PORT]/global/block/head/total_ticks -200 OK -"43" - diff --git a/tezt/tests/sc_rollup.ml b/tezt/tests/sc_rollup.ml index 1a4ea064437677ab6e0aeac58b32dca57518cd7f..34e7e5336d0f50dbe033e19eeb074926bf13af0f 100644 --- a/tezt/tests/sc_rollup.ml +++ b/tezt/tests/sc_rollup.ml @@ -5961,13 +5961,27 @@ let start_rollup_node_with_encrypted_key ~kind = in unit +(* TODO: https://linear.app/tezos/issue/RV-109/port-kernel-installer-to-risc-v + * Originate RISC-V kernels using installer kernel instead *) +let read_riscv_kernel (kernel_path : string) (checksum_path : string) : string = + let checksum = String.split_on_char ' ' (read_file checksum_path) in + "kernel:" ^ kernel_path ^ ":" ^ List.hd checksum + let register_riscv ~protocols = let kind = "riscv" in + let boot_sector = + read_riscv_kernel + "src/riscv/assets/riscv-dummy.elf" + "src/riscv/assets/riscv-dummy.elf.checksum" + in test_origination ~kind protocols ; - test_rpcs ~kind protocols ; + test_rpcs ~kind ~boot_sector protocols ; test_rollup_node_boots_into_initial_state protocols ~kind ; - test_rollup_node_advances_pvm_state protocols ~kind ~internal:false ; - test_rollup_node_advances_pvm_state protocols ~kind ~internal:true + test_rollup_node_advances_pvm_state + protocols + ~kind + ~boot_sector + ~internal:false let register ~kind ~protocols = test_origination ~kind protocols ;