Skip to content

Reduce noise in Debug impl of VariableList and FixedVector - #57

Merged
michaelsproul merged 1 commit into
sigp:mainfrom
jimmygchen:main
Sep 8, 2025
Merged

Reduce noise in Debug impl of VariableList and FixedVector#57
michaelsproul merged 1 commit into
sigp:mainfrom
jimmygchen:main

Conversation

@jimmygchen

@jimmygchen jimmygchen commented Sep 5, 2025

Copy link
Copy Markdown
Member

The default debug output of these types contains a lot of unnecessary noise making it hard to read. This PR removes the type and PhantomData from debug output.

VariableList

Before

Before:

VariableList { vec: [42, 42, 42, 42], _phantom: PhantomData<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>> }

After:

[42, 42, 42, 42]

FixedVector

Before

FixedVector { vec: [42, 42, 42, 42], _phantom: PhantomData<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>> }

After

[42, 42, 42, 42]

@codecov

codecov Bot commented Sep 5, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.62%. Comparing base (3f3d7de) to head (f6a4b43).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #57   +/-   ##
=======================================
  Coverage   58.62%   58.62%           
=======================================
  Files           8        8           
  Lines         290      290           
=======================================
  Hits          170      170           
  Misses        120      120           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pawanjay176 pawanjay176 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great idea!

@pawanjay176

Copy link
Copy Markdown
Member

Actually can we also print the max_len. Will be useful for debugging.

@jimmygchen

Copy link
Copy Markdown
Member Author

Actually can we also print the max_len. Will be useful for debugging.

Yeah I thought about it, these are compile time parameters though and will require a custom Debug impl for these structs.

@michaelsproul
michaelsproul merged commit 10d63e4 into sigp:main Sep 8, 2025
7 checks passed
mergify Bot pushed a commit to sigp/lighthouse that referenced this pull request Sep 10, 2025
The default debug output of these types contains a lot of unnecessary noise making it hard to read.

This PR removes the type and extra fields from debug output to make logs easier to read.

`len` could be potentially useful in some cases, but this gives us flexibility to only log it separately if we need it.

Related PR in `ssz_types`:
- sigp/ssz_types#57


  


Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
@michaelsproul michaelsproul mentioned this pull request Sep 10, 2025
@macladson macladson mentioned this pull request Sep 10, 2025
PoulavBhowmick03 pushed a commit to PoulavBhowmick03/lighthouse that referenced this pull request Sep 12, 2025
The default debug output of these types contains a lot of unnecessary noise making it hard to read.

This PR removes the type and extra fields from debug output to make logs easier to read.

`len` could be potentially useful in some cases, but this gives us flexibility to only log it separately if we need it.

Related PR in `ssz_types`:
- sigp/ssz_types#57


  


Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
kevaundray pushed a commit to kevaundray/lighthouse that referenced this pull request Sep 13, 2025
The default debug output of these types contains a lot of unnecessary noise making it hard to read.

This PR removes the type and extra fields from debug output to make logs easier to read.

`len` could be potentially useful in some cases, but this gives us flexibility to only log it separately if we need it.

Related PR in `ssz_types`:
- sigp/ssz_types#57


  


Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
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.

3 participants