Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions ecosystem/nodes/cpp/run-validator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This guide explains how to run a validator TON node with MyTonCtrl from scratch.

- Ubuntu 22.04 LTS or 24.04 LTS
- Python 3.10 or higher
- Clang 16.0.0 or higher
- Clang 21.0.0 or higher

```bash
# Check Ubuntu version
Expand Down Expand Up @@ -71,22 +71,24 @@ clang --version
```bash
# Check Clang version
clang --version
# If version 16, skip the steps below.
# If version 21, skip the steps below.

# Required for Ubuntu 22.04. Update current Clang to clang-16
sudo apt update
sudo apt install -y lsb-release wget software-properties-common gnupg
sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
# Ubuntu 22.04
sudo apt install lsb-release wget software-properties-common gnupg
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16 clang
sudo ./llvm.sh 21 clang

# Change default Clang
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100
# Ubuntu 24.04
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt -y update
sudo apt install -y clang-21
Comment on lines +83 to +86
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Non-copy-pasteable apt command with unsafe apt-key usage

The Ubuntu 24.04 instructions use sudo apt-key add -, which is deprecated and discouraged in modern Debian/Ubuntu tooling. This conflicts with the style requirement that commands be safe and copy‑pasteable on supported systems, and can fail on newer Ubuntu releases. The same block also hardcodes a repository without using a keyring-based signed-by configuration, which is now the recommended pattern. These issues reduce reliability of the installation instructions and may force readers to troubleshoot outside the guide.

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

Comment on lines +82 to +86
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace deprecated apt-key add with modern GPG key management.

The apt-key add command is deprecated since Ubuntu 22.04 and will show warnings or fail on newer systems. Use the modern signed-by approach for GPG key management instead.

🔒 Proposed fix using modern GPG key management
  # Ubuntu 24.04
- wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
- echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
+ wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/llvm-snapshot.asc
+ echo "deb [signed-by=/etc/apt/trusted.gpg.d/llvm-snapshot.asc] http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
  sudo apt -y update
  sudo apt install -y clang-21
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Ubuntu 24.04
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt -y update
sudo apt install -y clang-21
# Ubuntu 24.04
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/llvm-snapshot.asc
echo "deb [signed-by=/etc/apt/trusted.gpg.d/llvm-snapshot.asc] http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt -y update
sudo apt install -y clang-21
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ecosystem/nodes/cpp/run-validator.mdx` around lines 82 - 86, Replace the
deprecated apt-key add pipeline by fetching the LLVM GPG key, dearmoring it into
a keyring file and referencing that keyring with signed-by in the APT source
entry: download the key (e.g., with wget or curl) and run gpg --dearmor >
/usr/share/keyrings/llvm-archive-keyring.gpg (ensure sudo), then change the
source line from echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21
main" | sudo tee ... to echo "deb
[signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg]
http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee
/etc/apt/sources.list.d/llvm.list, then run sudo apt -y update and sudo apt
install -y clang-21 as before.


# optionally, change default clang
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-21 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-21 200

# Required for Ubuntu 24.04. Install clang-16
sudo apt install -y clang-16

```
</Accordion>
Expand Down
Loading