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 response format on eth_hashrate() #2074

Merged
merged 4 commits into from Aug 30, 2023
Merged

Conversation

casiojapi
Copy link
Contributor

@casiojapi casiojapi commented Jul 13, 2023

Description

This PR changes the response of the eth_hashrate method from a plain decimal number to a hexadecimal string. The change is in line with the behavior of the Geth.

Motivation and Context

This change is required to align the behavior of the RSKj client with the Ethereum clients, which return the hashrate as a hex-encoded string. This change fixes issue #1837, where the eth_hashrate method in RSKj was returning a plain decimal number.

How Has This Been Tested?

The changes have been tested by running the RSKj node with the changes applied. I checked the response format of the eth_hashrate method, and it now returns the hashrate as a hex-encoded string, which aligns with the behavior of geth.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Tests for the changes have been added (for bug fixes / features)
  • Requires Activation Code (Hard Fork)
  • Other information:

@casiojapi
Copy link
Contributor Author

pipeline:run

@casiojapi casiojapi marked this pull request as ready for review July 17, 2023 13:11
@casiojapi
Copy link
Contributor Author

will be adding unit tests today

@sonarcloud
Copy link

sonarcloud bot commented Jul 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@casiojapi
Copy link
Contributor Author

pipeline:run

@sonarcloud
Copy link

sonarcloud bot commented Aug 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@Vovchyk Vovchyk merged commit d7ff325 into master Aug 30, 2023
10 checks passed
@Vovchyk Vovchyk deleted the fix-eth-hashrate-format branch August 30, 2023 15:17
@aeidelman aeidelman added this to the Fingerroot 5.3.0 milestone Oct 5, 2023
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.

eth_hashrate returns plain number
3 participants