-
Notifications
You must be signed in to change notification settings - Fork 839
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
[BESU-1919] Add proper support for eth_hashrate #1063
[BESU-1919] Add proper support for eth_hashrate #1063
Conversation
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to move the hashrate logic out of the AbstractMiningCoordinator into EthashMiningCoordinator and not expose the SealerInfo map and instead expose the aggregate hashrate.
...ion/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractMiningCoordinator.java
Outdated
Show resolved
Hide resolved
@@ -215,4 +232,28 @@ public void setExtraData(final Bytes extraData) { | |||
|
|||
protected abstract boolean newChainHeadInvalidatesMiningOperation( | |||
final BlockHeader newChainHeadHeader); | |||
|
|||
@Override | |||
public Map<String, SealerInfo> getSealerInfos() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to move all the logic around submitting hashrate and storing the sealerInfo down into the EthashMiningCoordinator. IBFT and Clique will never use these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
...ockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/MiningCoordinator.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Raised hyperledger/besu-docs#414 to doc this so this can be closed. |
PR description
submitHashrate
endpoint which is by default limited to 1000 sealers. Adding a 1001 will remove the oldest from the list (0x0 hashrate is refused)eth_hashrate
endpoint so that it returns the cumulative hashrate of all sealers if the list is not empty. Otherwise it returns the local hashrateStratum1EthProxyProtocol
andStratum1Protocol
Tested