Skip to content

Re-evaluate topic type name and type hash#965

Open
v8p1197 wants to merge 4 commits into
ros2:rollingfrom
v8p1197:rolling
Open

Re-evaluate topic type name and type hash#965
v8p1197 wants to merge 4 commits into
ros2:rollingfrom
v8p1197:rolling

Conversation

@v8p1197

@v8p1197 v8p1197 commented May 16, 2026

Copy link
Copy Markdown

Description

Fixes ros2/ros2#1682.

This PR introduces a new hash scheme based on BLAKE2.

Is this user-facing behavior change?

If users want to build messages with the new scheme, they should specify the -DROSIDL_GENERATOR_USE_RIHS02=ON flag (see below).

Additional Information

This PR can be tested in two ways:

  1. Formal tests:
mkdir ~/ros2_ws/
cd ~/ros2_ws/
git clone https://github.com/v8p1197/rosidl.git src/rosidl/
colcon build
colcon test
  1. Building a custom message:
mkdir ~/ros2_ws/
cd ~/ros2_ws/
git clone https://github.com/v8p1197/rosidl.git src/rosidl/
colcon build
source install/setup.bash
git clone https://github.com/v8p1197/my_test_msgs.git src/my_test_msgs/
colcon build --packages-select my_test_msgs --cmake-clean-cache --cmake-args -DROSIDL_GENERATOR_USE_RIHS02=OFF
cat build/my_test_msgs/rosidl_generator_type_description/my_test_msgs/msg/MyMessage.json | grep hash_string
# Expected output: RIHS01_aa6fa4c8d287fd38ac88d666c540b4485a93f0d6118911d513528b77f1eaf27c
colcon build --packages-select my_test_msgs --cmake-clean-cache --cmake-args -DROSIDL_GENERATOR_USE_RIHS02=ON
cat build/my_test_msgs/rosidl_generator_type_description/my_test_msgs/msg/MyMessage.json | grep hash_string
# Expected output: RIHS02_17a6e69ee67f1252c4fc5b1ab5173340

v8p1197 and others added 3 commits May 16, 2026 13:21
Signed-off-by: Vincenzo Petrone <vipetrone@unisa.it>
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Vincenzo Petrone <vipetrone@unisa.it>
Signed-off-by: Vincenzo Petrone <vipetrone@unisa.it>

@fujitatomoya fujitatomoya left a comment

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.

blake2 would be our option here, out of curiosity do we have any discussion on PMC meeting including pros/cons?

@v8p1197

v8p1197 commented May 18, 2026

Copy link
Copy Markdown
Author

Hi @fujitatomoya, personally I don't usually take part in PMC meetings, but a discussion on this hashing scheme is reported in the referenced issue.
For sure, a pro is the shortest encoded string length.

@skyegalaxy skyegalaxy requested a review from mjcarroll May 28, 2026 16:42
@mjcarroll

Copy link
Copy Markdown
Member

Neat! I think the idea was that we needed a much shorter string length so that we don't use excessive amounts of memory in resource constrained devices, as reported in the issue upstream.

Changing this hash will have some impact on previously recorded bag files, so we probably want to make sure that we get it correct and not introduce a lot of churn around that.

Rather than having discussion at the PMC meetings, I will just flag it in the next meeting so that people know to take a look at it.

@mjcarroll

Copy link
Copy Markdown
Member

Ah, but on closer inspection, you made it opt in, so maybe that takes care of some of the immediate concern there.

@v8p1197

v8p1197 commented May 30, 2026

Copy link
Copy Markdown
Author

Hi @mjcarroll, yes I made this flag optional but ON by default. Do you suggest changing it to OFF?

Is there anything else to do to address the referenced issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-evaluate topic type name and type hash

4 participants