diff --git a/baking/src/tezos_baking/steps.py b/baking/src/tezos_baking/steps.py index de4525ce2..f2565dcfa 100644 --- a/baking/src/tezos_baking/steps.py +++ b/baking/src/tezos_baking/steps.py @@ -106,7 +106,6 @@ def pprint_options(self): networks = { "mainnet": "Main Tezos network", "ghostnet": "Long running test network, currently using the Paris Tezos protocol", - "paris2net": "Test network using the PtParisB Tezos protocol", "pariscnet": "Test network using the PsParisC Tezos protocol", } diff --git a/baking/src/tezos_baking/tezos_setup_wizard.py b/baking/src/tezos_baking/tezos_setup_wizard.py index 9982eaf90..dbb3e8375 100644 --- a/baking/src/tezos_baking/tezos_setup_wizard.py +++ b/baking/src/tezos_baking/tezos_setup_wizard.py @@ -197,8 +197,7 @@ def network_name_or_teztnets_url(network): id="network", prompt="Which Tezos network would you like to use?\nCurrently supported:", help="The selected network will be used to set up all required services.\n" - "The currently supported protocol is PtParisB (used on `paris2net`, `ghostnet, and `mainnet`)\n" - "and PsParisC (used on `pariscnet`, is going to be used on `ghostnet`, and `mainnet`).\n" + "The currently supported protocol is PsParisC (used on `pariscnet`, `ghostnet`, and `mainnet`).\n" "Keep in mind that you must select the test network (e.g. ghostnet)\n" "if you plan on baking with a faucet JSON file.\n", options=networks, @@ -861,81 +860,61 @@ def get_staked_balance(pkh): ).stdout.decode("utf-8") return json.loads(output) - def get_adaptive_issuance_launch_cycle(): - output = get_proc_output( - f"curl {self.config['node_rpc_endpoint']}/chains/main/blocks/head/context/adaptive_issuance_launch_cycle" - ).stdout.decode("utf-8") - return json.loads(output) - - def get_current_cycle(): - output = get_proc_output( - f"curl {self.config['node_rpc_endpoint']}/chains/main/blocks/head/metadata" - ).stdout.decode("utf-8") - return json.loads(output)["level_info"]["cycle"] - tezos_client_options = self.get_tezos_client_options() baker_alias = self.config["baker_alias"] baker_key_hash = self.config["baker_key_hash"] - adaptive_issuance_launch_cycle = get_adaptive_issuance_launch_cycle() - - current_cycle = get_current_cycle() + minimal_frozen_stake = get_minimal_frozen_stake() - # TODO remove this check when ParisB protocol is activated at mainnet - if adaptive_issuance_launch_cycle is not None and int(current_cycle) >= int( - adaptive_issuance_launch_cycle - ): - minimal_frozen_stake = get_minimal_frozen_stake() + staked_balance = get_staked_balance(baker_key_hash) - staked_balance = get_staked_balance(baker_key_hash) + if int(staked_balance) < int(minimal_frozen_stake): - if int(staked_balance) < int(minimal_frozen_stake): + print() - self.query_step( - get_stake_tez_query(staked_balance, minimal_frozen_stake) - ) + self.query_step(get_stake_tez_query(staked_balance, minimal_frozen_stake)) - print_and_log(f"Staking {self.config['stake_tez']}Tz...") + print_and_log(f"Staking {self.config['stake_tez']}Tz...") - if self.check_ledger_use(): - ledger_app = "Wallet" - print(f"Please open the Tezos {ledger_app} app on your ledger.") - print( - color( - "Please note, that if you are using Tezos Wallet app of version 3.0.0 or higher,\n" - 'you need to enable "expert mode" in the Tezos Wallet app settings on the Ledger device.', - color_yellow, - ) - ) - print( - color( - f"Waiting for the Tezos {ledger_app} to be opened...", - color_green, - ), + if self.check_ledger_use(): + ledger_app = "Wallet" + print(f"Please open the Tezos {ledger_app} app on your ledger.") + print( + color( + "Please note, that if you are using Tezos Wallet app of version 3.0.0 or higher,\n" + 'you need to enable "expert mode" in the Tezos Wallet app settings on the Ledger device.', + color_yellow, ) - wait_for_ledger_app(ledger_app, self.config["client_data_dir"]) - print( - color( - "Waiting for your response to the prompt on your Ledger Device...", - color_green, - ) + ) + print( + color( + f"Waiting for the Tezos {ledger_app} to be opened...", + color_green, + ), + ) + wait_for_ledger_app(ledger_app, self.config["client_data_dir"]) + print( + color( + "Waiting for your response to the prompt on your Ledger Device...", + color_green, ) - - get_proc_output( - f"sudo -u tezos {suppress_warning_text} octez-client {tezos_client_options} " - f"stake {self.config['stake_tez']} for {baker_alias}" ) - if self.check_ledger_use(): - ledger_app = "Baking" - print(f"Please reopen the Tezos {ledger_app} app on your ledger.") - print( - color( - f"Waiting for the Tezos {ledger_app} to be opened...", - color_green, - ), - ) - wait_for_ledger_app(ledger_app, self.config["client_data_dir"]) + get_proc_output( + f"sudo -u tezos {suppress_warning_text} octez-client {tezos_client_options} " + f"stake {self.config['stake_tez']} for {baker_alias}" + ) + + if self.check_ledger_use(): + ledger_app = "Baking" + print(f"Please reopen the Tezos {ledger_app} app on your ledger.") + print( + color( + f"Waiting for the Tezos {ledger_app} to be opened...", + color_green, + ), + ) + wait_for_ledger_app(ledger_app, self.config["client_data_dir"]) def register_baker(self): print() diff --git a/baking/src/tezos_baking/tezos_voting_wizard.py b/baking/src/tezos_baking/tezos_voting_wizard.py index 6b3c6a61e..a5c1782fb 100644 --- a/baking/src/tezos_baking/tezos_voting_wizard.py +++ b/baking/src/tezos_baking/tezos_voting_wizard.py @@ -314,7 +314,7 @@ def fill_voting_period_info(self): raise KeyboardInterrupt self.config["amendment_phase"] = ( - re.search(b'Current period: "(\w+)"', info).group(1).decode("utf-8") + re.search(b'Current period: "(\\w+)"', info).group(1).decode("utf-8") ) self.config["proposal_hashes"] = [ phash.decode() for phash in re.findall(protocol_hash_regex, info) diff --git a/baking/src/tezos_baking/util.py b/baking/src/tezos_baking/util.py index b76620864..9cd56b4c4 100644 --- a/baking/src/tezos_baking/util.py +++ b/baking/src/tezos_baking/util.py @@ -13,14 +13,14 @@ # Regexes -secret_key_regex = b"(encrypted|unencrypted):(?:\w{54}|\w{88})" -address_regex = b"tz[123]\w{33}" +secret_key_regex = b"(encrypted|unencrypted):(?:\\w{54}|\\w{88})" +address_regex = b"tz[123]\\w{33}" protocol_hash_regex = ( b"P[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{50}" ) -signer_uri_regex = b"((?:tcp|unix|https|http):\/\/.+)\/(tz[123]\w{33})\/?" -ledger_regex = b"ledger:\/\/[\w\-]+\/[\w\-]+\/[\w']+\/[\w']+" -derivation_path_regex = b"(?:bip25519|ed25519|secp256k1|P-256)\/[0-9]+h\/[0-9]+h" +signer_uri_regex = b"((?:tcp|unix|https|http):\\/\\/.+)\\/(tz[123]\\w{33})\\/?" +ledger_regex = b"ledger:\\/\\/[\\w\\-]+\\/[\\w\\-]+\\/[\\w']+\\/[\\w']+" +derivation_path_regex = b"(?:bip25519|ed25519|secp256k1|P-256)\\/[0-9]+h\\/[0-9]+h" # Utilities @@ -65,7 +65,7 @@ def get_systemd_service_env(service_name): for env_file in find_systemd_env_files(sys_show): with open(env_file, "r") as f: for line in f: - env_def = re.search("^(\w+)=(.*)\n", line) + env_def = re.search("^(\\w+)=(.*)\n", line) if env_def is not None: env_var = env_def.group(1) var_val = env_def.group(2).strip('"') diff --git a/baking/src/tezos_baking/validators.py b/baking/src/tezos_baking/validators.py index 51b549581..35ac5af70 100644 --- a/baking/src/tezos_baking/validators.py +++ b/baking/src/tezos_baking/validators.py @@ -129,7 +129,7 @@ def unencrypted_secret_key(input): # To be validated, the input should adhere to the derivation path format: # [0-9]+h/[0-9]+h def derivation_path(input): - derivation_path_regex_str = "[0-9]+h\/[0-9]+h" + derivation_path_regex_str = "[0-9]+h\\/[0-9]+h" match = re.match(derivation_path_regex_str, input.strip()) if not bool(match): raise ValueError( diff --git a/baking/src/tezos_baking/wizard_structure.py b/baking/src/tezos_baking/wizard_structure.py index ddb68b9eb..15827d553 100644 --- a/baking/src/tezos_baking/wizard_structure.py +++ b/baking/src/tezos_baking/wizard_structure.py @@ -52,7 +52,7 @@ def get_key_address(tezos_client_options, key_alias): + ledger_regex + b")|(?:" + secret_key_regex - + b")|(?:remote\:" + + b")|(?:remote\\:" + address_regex + b")" ) @@ -76,7 +76,7 @@ def wait_for_ledger_app(ledger_app, client_dir): ledgers_derivations = {} for ledger_derivation in re.findall(ledger_regex, output): ledger_url = ( - re.search(b"ledger:\/\/[\w\-]+\/", ledger_derivation).group(0).decode() + re.search(b"ledger:\\/\\/[\\w\\-]+\\/", ledger_derivation).group(0).decode() ) derivation_path = ( re.search(derivation_path_regex, ledger_derivation).group(0).decode() diff --git a/docker/build/fedora/build.py b/docker/build/fedora/build.py index df1641078..aa122c46c 100755 --- a/docker/build/fedora/build.py +++ b/docker/build/fedora/build.py @@ -58,7 +58,7 @@ def build_fedora(args=None) -> List[str]: # copr build infrastructure uses latest stable fedora and `mock` for builds # so we should also keep that way - images = ["39"] + images = ["40"] packages_to_build = get_packages_to_build(args.packages) diff --git a/docker/package/Dockerfile-ubuntu b/docker/package/Dockerfile-ubuntu index de9c52d5c..de12b25cb 100644 --- a/docker/package/Dockerfile-ubuntu +++ b/docker/package/Dockerfile-ubuntu @@ -18,7 +18,7 @@ RUN if [ "$dist" = "focal" ]; then apt-get install -y dh-systemd; fi RUN install -m 0755 /usr/bin/python3 /usr/bin/builder -RUN add-apt-repository ppa:ubuntu-mozilla-security/rust-next -y && apt-get update -y +RUN if [ "$dist" != "noble"]; then add-apt-repository ppa:ubuntu-mozilla-security/rust-next -y && apt-get update -y; fi RUN apt-get -y install cargo opam ENV USER dockerbuilder diff --git a/docker/package/model.py b/docker/package/model.py index 861040dc2..04336acc2 100644 --- a/docker/package/model.py +++ b/docker/package/model.py @@ -313,7 +313,7 @@ def gen_control_file(self, build_deps, run_deps, ubuntu_version, out): Section: utils Priority: optional Maintainer: {self.meta.maintainer} -Build-Depends: debhelper (>=9), {"dh-systemd (>= 1.5), " if ubuntu_version != "jammy" else ""} autotools-dev, {str_build_deps} +Build-Depends: debhelper (>=9), {"dh-systemd (>= 1.5), " if ubuntu_version == "focal" else ""} autotools-dev, {str_build_deps} Standards-Version: 3.9.6 Homepage: https://gitlab.com/tezos/tezos/ @@ -506,7 +506,7 @@ def gen_control_file(self, build_deps, run_deps, ubuntu_version, out): Section: utils Priority: optional Maintainer: {self.meta.maintainer} -Build-Depends: debhelper (>=9), {"dh-systemd (>= 1.5), " if ubuntu_version != "jammy" else ""} autotools-dev, wget +Build-Depends: debhelper (>=9), {"dh-systemd (>= 1.5), " if ubuntu_version == "focal" else ""} autotools-dev, wget Standards-Version: 3.9.6 Homepage: https://gitlab.com/tezos/tezos/ @@ -693,7 +693,7 @@ def gen_control_file(self, build_deps, run_deps, ubuntu_version, out): Section: utils Priority: optional Maintainer: {self.meta.maintainer} -Build-Depends: debhelper (>=11), {"dh-systemd (>= 1.5), " if ubuntu_version != "jammy" else ""} python3-all, autotools-dev, dh-python, python3-setuptools +Build-Depends: debhelper (>=11), {"dh-systemd (>= 1.5), " if ubuntu_version == "focal" else ""} python3-all, autotools-dev, dh-python, python3-setuptools Standards-Version: 3.9.6 Homepage: https://gitlab.com/tezos/tezos/ X-Python3-Version: >= 3.8 diff --git a/docker/package/packages.py b/docker/package/packages.py index 0177c5295..1053531c3 100644 --- a/docker/package/packages.py +++ b/docker/package/packages.py @@ -19,13 +19,11 @@ networks = { "mainnet": "mainnet", "ghostnet": "ghostnet", - "paris2net": "https://teztnets.com/paris2net", "pariscnet": "https://teztnets.com/pariscnet", } networks_protos = { "mainnet": ["PtParisB", "PsParisC"], "ghostnet": ["PtParisB", "PsParisC"], - "paris2net": ["PtParisB"], "pariscnet": ["PsParisC"], } diff --git a/docker/supported_versions.json b/docker/supported_versions.json index d02dd8f48..e886bba9a 100644 --- a/docker/supported_versions.json +++ b/docker/supported_versions.json @@ -1,9 +1,11 @@ { "ubuntu": [ "focal", - "jammy" + "jammy", + "noble" ], "fedora": [ - "39" + "39", + "40" ] } diff --git a/docs/baking.md b/docs/baking.md index 2d534fa51..69f204b08 100644 --- a/docs/baking.md +++ b/docs/baking.md @@ -30,7 +30,7 @@ that you can use by following the [installation instructions](https://www.raspbe In order to run a baking instance, you'll need the following Tezos binaries: `tezos-client`, `tezos-node`, `tezos-baker-`. -The currently supported protocol is `ParisB` (used on `paris2net`, `ghostnet` and `mainnet`) and PsParisC (used on `pariscnet`, is going to be used on `ghostnet`, and `mainnet`). +The currently supported protocol is `PsParisC` (used on `pariscnet`, `ghostnet`, and `mainnet`). Also, note that the corresponding packages have protocol suffix in lowercase, e.g. the list of available baker packages can be found [here](https://launchpad.net/~serokell/+archive/ubuntu/tezos/+packages?field.name_filter=tezos-baker&field.status_filter=published). diff --git a/docs/support-policy.md b/docs/support-policy.md index de2100fe8..fed1256b6 100644 --- a/docs/support-policy.md +++ b/docs/support-policy.md @@ -18,6 +18,7 @@ supported by Canonical. Currently, these are versions: * 20.04 LTS (Focal Fossa) * 22.04 LTS (Jammy Jellyfish) +* 24.04 LTS (Noble Numbat) There are packages for `arm64` and `amd64` architectures. @@ -37,8 +38,8 @@ There are packages for `arm64` and `amd64` architectures. We aim to provide packages for all [currently supported Fedora releases](https://docs.fedoraproject.org/en-US/releases/). Currently, these are versions: -* Fedora 38 * Fedora 39 +* Fedora 40 There are packages for `x86_64` and `aarch64` architectures. diff --git a/docs/systemd.md b/docs/systemd.md index f073c4fad..3722f75f7 100644 --- a/docs/systemd.md +++ b/docs/systemd.md @@ -63,7 +63,6 @@ networks. `tezos-node` packages provide multiple services out of the box: - `tezos-node-pariscnet` -- `tezos-node-paris2net` - `tezos-node-ghostnet` - `tezos-node-mainnet` @@ -78,7 +77,7 @@ Also, there are `tezos-node-` binary aliases that are equivalent to running `tezos-node` with [the service options](./configuration.md) given. In addition to node services where the config is predefined to a specific network -(e.g. `tezos-node-mainnet` or `tezos-node-paris2net`), it's possible to run +(e.g. `tezos-node-mainnet` or `tezos-node-pariscnet`), it's possible to run `tezos-node-custom` service. Another case for running multiple similar systemd services is when one wants to have diff --git a/tests/systemd/services_tests.py b/tests/systemd/services_tests.py index 20ef62b52..2084766c0 100644 --- a/tests/systemd/services_tests.py +++ b/tests/systemd/services_tests.py @@ -128,16 +128,8 @@ def test_node_mainnet_service(): node_service_test("mainnet") -def test_node_paris2net_service(): - node_service_test("paris2net") - - -def test_baking_paris2net_service(): - baking_service_test("paris2net", ["PtParisB"]) - - def test_baking_mainnet_service(): - baking_service_test("mainnet", ["PtParisB"]) + baking_service_test("mainnet", ["PsParisC"]) def test_node_pariscnet_service():