diff --git a/etherlink/bin_node/config/configuration.ml b/etherlink/bin_node/config/configuration.ml index 54648722b211fd260eee105da536e14fe3ce18f8..23c8751053e565eda8d76722fd2dbb6ddda82048 100644 --- a/etherlink/bin_node/config/configuration.ml +++ b/etherlink/bin_node/config/configuration.ml @@ -45,6 +45,7 @@ type experimental_features = { overwrite_simulation_tick_limit : bool; garbage_collector : garbage_collector option; next_wasm_runtime : bool; + enable_websocket : bool; } type sequencer = { @@ -137,6 +138,7 @@ let default_experimental_features = overwrite_simulation_tick_limit = false; garbage_collector = None; next_wasm_runtime = false; + enable_websocket = false; } let default_data_dir = Filename.concat (Sys.getenv "HOME") ".octez-evm-node" @@ -687,6 +689,7 @@ let experimental_features_encoding = overwrite_simulation_tick_limit; garbage_collector; next_wasm_runtime; + enable_websocket; } -> ( drop_duplicate_on_injection, enable_send_raw_transaction, @@ -694,14 +697,16 @@ let experimental_features_encoding = block_storage_sqlite3, overwrite_simulation_tick_limit, garbage_collector, - next_wasm_runtime )) + next_wasm_runtime, + enable_websocket )) (fun ( drop_duplicate_on_injection, enable_send_raw_transaction, node_transaction_validation, block_storage_sqlite3, overwrite_simulation_tick_limit, garbage_collector, - next_wasm_runtime ) -> + next_wasm_runtime, + enable_websocket ) -> { drop_duplicate_on_injection; enable_send_raw_transaction; @@ -710,8 +715,9 @@ let experimental_features_encoding = overwrite_simulation_tick_limit; garbage_collector; next_wasm_runtime; + enable_websocket; }) - (obj7 + (obj8 (dft ~description: "Request the rollup node to filter messages it has already \ @@ -756,6 +762,11 @@ let experimental_features_encoding = "Enable or disable the experimental WASM runtime that is expected \ to replace the Smart Rollup’s Fast Exec runtime" bool + false) + (dft + "enable_websocket" + ~description:"Enable or disable the experimental websocket server" + bool false)) let proxy_encoding = diff --git a/etherlink/bin_node/config/configuration.mli b/etherlink/bin_node/config/configuration.mli index d20e1c7339a79c2ee1907a1554d9259cce91a44c..e7ac1e4a7a4391fa28a66479456ea429a4a8f74f 100644 --- a/etherlink/bin_node/config/configuration.mli +++ b/etherlink/bin_node/config/configuration.mli @@ -64,6 +64,7 @@ type experimental_features = { overwrite_simulation_tick_limit : bool; garbage_collector : garbage_collector option; next_wasm_runtime : bool; + enable_websocket : bool; } type sequencer = { diff --git a/etherlink/bin_node/main.ml b/etherlink/bin_node/main.ml index 73f19c486625676bb2c6de4a49e1547c6df66b38..af2338deeb919b3a156c0fa8b31b1e2ec70cd009 100644 --- a/etherlink/bin_node/main.ml +++ b/etherlink/bin_node/main.ml @@ -678,6 +678,13 @@ let snapshot_file_arg = is based on the snapshot information." Params.string +(* TODO: https://gitlab.com/tezos/tezos/-/issues/7591 + Remove this whenever we have an experimental websocket server ready to + be tested. *) +let fail_if_websocket_is_enabled ~config = + if config.experimental_features.enable_websocket then + Stdlib.failwith "The experimental websocket server is not implemented yet." + let start_proxy ~data_dir ~keep_alive ?rpc_addr ?rpc_port ?rpc_batch_limit ?cors_origins ?cors_headers ?log_filter_max_nb_blocks ?log_filter_max_nb_logs ?log_filter_chunk_size ?rollup_node_endpoint @@ -708,6 +715,7 @@ let start_proxy ~data_dir ~keep_alive ?rpc_addr ?rpc_port ?rpc_batch_limit ~verbose () in + fail_if_websocket_is_enabled ~config ; (* We patch [config] to take into account the proxy-specific argument [--read-only]. *) let config = @@ -815,6 +823,7 @@ let start_sequencer ?password_filename ~wallet_dir ~data_dir ?rpc_addr ?rpc_port ~finalized_view () in + fail_if_websocket_is_enabled ~config:configuration ; let*! () = let open Tezos_base_unix.Internal_event_unix in let config = @@ -896,6 +905,7 @@ let start_threshold_encryption_sequencer ?password_filename ~wallet_dir ~finalized_view () in + fail_if_websocket_is_enabled ~config:configuration ; let*! () = let open Tezos_base_unix.Internal_event_unix in let config = @@ -1090,6 +1100,7 @@ let start_observer ~data_dir ~keep_alive ?rpc_addr ?rpc_port ?rpc_batch_limit ~finalized_view () in + fail_if_websocket_is_enabled ~config ; let*! () = let open Tezos_base_unix.Internal_event_unix in let config = diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Configuration RPC.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Configuration RPC.out index ac9e05c3d0fd0819c03b9cbe86ca2e9d978f7b15..03679b98c07fac8da6ad06705d0b742cf88f3bc1 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Configuration RPC.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Configuration RPC.out @@ -16,7 +16,8 @@ "node_transaction_validation": true, "block_storage_sqlite3": true, "overwrite_simulation_tick_limit": false, - "next_wasm_runtime": true + "next_wasm_runtime": true, + "enable_websocket": false }, "proxy": { "ignore_block_param": false @@ -65,7 +66,8 @@ "node_transaction_validation": true, "block_storage_sqlite3": true, "overwrite_simulation_tick_limit": false, - "next_wasm_runtime": true + "next_wasm_runtime": true, + "enable_websocket": false }, "proxy": { "ignore_block_param": false @@ -107,7 +109,8 @@ "node_transaction_validation": true, "block_storage_sqlite3": true, "overwrite_simulation_tick_limit": false, - "next_wasm_runtime": true + "next_wasm_runtime": true, + "enable_websocket": false }, "proxy": { "evm_node_endpoint": "hidden", diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- describe config.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- describe config.out index 4f23ffedb396f8884cec9c7bcd0a40d2dbe86997..49e0fb4ccea94786648ded8f0e4504c8b601c47b 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- describe config.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- describe config.out @@ -146,7 +146,10 @@ "next_wasm_runtime"?: boolean /* Enable or disable the experimental WASM runtime that is expected - to replace the Smart Rollup’s Fast Exec runtime */ }, + to replace the Smart Rollup’s Fast Exec runtime */, + "enable_websocket"?: + boolean + /* Enable or disable the experimental websocket server */ }, "proxy"?: { "finalized_view"?: boolean