Skip to content

Conversation

@kamilsa
Copy link
Contributor

@kamilsa kamilsa commented Sep 18, 2025

  • Added a new test suite enr_test under tests/unit/serde with comprehensive unit tests for ENR encoding and decoding, including round-trip tests, deterministic encoding checks, and decoding of a real ENR string.
  • Enhanced the ENR decoding logic in enr.cpp to skip unknown key/value pairs instead of asserting, and added a warning log for each unknown key encountered during decoding.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive unit tests for ENR (Ethereum Node Record) encoding and decoding functionality and improves the robustness of ENR decoding by handling unknown key/value pairs gracefully instead of asserting.

  • Added a complete test suite with round-trip tests, deterministic encoding verification, and real ENR string decoding
  • Modified ENR decoder to skip unknown keys with warning logs instead of crashing
  • Integrated the new test suite into the CMake build system

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/unit/serde/enr_test.cpp New comprehensive test suite for ENR encoding/decoding with three test cases
tests/unit/serde/CMakeLists.txt New CMake configuration for the ENR test suite
tests/unit/CMakeLists.txt Added serde subdirectory to unit test build
src/serde/enr.cpp Enhanced ENR decoder to handle unknown keys gracefully with warning logs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: turuslan <[email protected]>
@turuslan turuslan requested review from Copilot and xDimon September 18, 2025 14:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings September 19, 2025 07:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: turuslan <[email protected]>
Copilot AI review requested due to automatic review settings September 19, 2025 14:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@turuslan turuslan requested a review from xDimon September 19, 2025 14:13
@turuslan turuslan merged commit 0f79956 into master Sep 23, 2025
2 checks passed
@turuslan turuslan deleted the test/enr branch September 23, 2025 03:02
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.

4 participants