Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ClassCastException in DebugMetrics nested structures [#7383] #7499

Merged

Conversation

cloudspores
Copy link
Contributor

@cloudspores cloudspores commented Aug 20, 2024

This commit resolves an issue where Double values in nested metric structures were incorrectly cast to Map objects, causing a ClassCastException. The fix allows for proper handling of both direct values and nested structures at the same level.

A comprehensive test case has been added to reproduce the bug and verify the fix, ensuring that complex, dynamically nested metric structures can be handled without errors.

Resolves: #7383

PR description

Fixed Issue(s)

"fixes #7383"

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

cloudspores and others added 8 commits August 20, 2024 18:51
This commit resolves an issue where Double values in nested metric
structures were incorrectly cast to Map objects, causing a
ClassCastException. The fix allows for proper handling of both
direct values and nested structures at the same level.

A comprehensive test case has been added to reproduce the bug and
verify the fix, ensuring that complex, dynamically nested metric
structures can be handled without errors.

Resolves: hyperledger#7383
Signed-off-by: Ade Lucas <[email protected]>
This commit adds a new entry to `CHANGELOG.md` detailing the fix
for the `ClassCastException` in `DebugMetrics`. Additionally,
`DebugMetricsTest.java` has been reformatted using `spotlessApply`
to ensure code style consistency.

These changes contribute to maintaining clear documentation and
code quality in the project.

Resolves: hyperledger#7383
Signed-off-by: Ade Lucas <[email protected]>
…#7483)

Add pending block header to TransactionEvaluationContext plugin API, so PluginTransactionSelector can access info of the pending block.

---
Signed-off-by: Fabio Di Fabio <[email protected]>
Co-authored-by: Usman Saleem <[email protected]>
Signed-off-by: Ade Lucas <[email protected]>
Signed-off-by: Snazzy <[email protected]>
Co-authored-by: Sally MacFarlane <[email protected]>
Signed-off-by: Ade Lucas <[email protected]>
Update the EOF validation error strings so that they can validate
against expected exceptions in reference tests.

Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Ade Lucas <[email protected]>
)

* 5098: Add RpcErrorTypes

Signed-off-by: Matilda Clerke <[email protected]>

---------

Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda-Clerke <[email protected]>
Co-authored-by: Sally MacFarlane <[email protected]>
Signed-off-by: Ade Lucas <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Ade Lucas <[email protected]>
@cloudspores cloudspores force-pushed the issue-7383-debug_metrics-method-error branch from ae7bdf9 to 4534020 Compare August 20, 2024 22:51
cloudspores and others added 2 commits August 21, 2024 08:51
This commit merges updates from the main branch into the current
branch and resolves a conflict in the CHANGELOG.md file. Both
the changelog entry for the DebugMetrics fix and the additions
from the main branch have been preserved.

This ensures that the documentation for upcoming releases is
consistent and complete.

Signed-off-by: Ade Lucas <[email protected]>
Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

LGTM

@cloudspores cloudspores marked this pull request as ready for review August 22, 2024 12:50
@macfarla macfarla merged commit c3f455c into hyperledger:main Aug 23, 2024
40 checks passed
gconnect pushed a commit to gconnect/besu that referenced this pull request Aug 26, 2024
…#7383] (hyperledger#7499)

* Fix ClassCastException in DebugMetrics nested structures

This commit resolves an issue where Double values in nested metric
structures were incorrectly cast to Map objects, causing a
ClassCastException. The fix allows for proper handling of both
direct values and nested structures at the same level.

A comprehensive test case has been added to reproduce the bug and
verify the fix, ensuring that complex, dynamically nested metric
structures can be handled without errors.

Resolves: hyperledger#7383

Signed-off-by: Ade Lucas <[email protected]>

---------

Signed-off-by: Ade Lucas <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: Snazzy <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda-Clerke <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
Co-authored-by: garyschulte <[email protected]>
Co-authored-by: Fabio Di Fabio <[email protected]>
Co-authored-by: gringsam <[email protected]>
Co-authored-by: Sally MacFarlane <[email protected]>
Co-authored-by: Danno Ferrin <[email protected]>
Co-authored-by: Matilda-Clerke <[email protected]>
Signed-off-by: gconnect <[email protected]>
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.

debug_metrics Method Error
7 participants