Implement "pending" for qbft_getValidatorsByBlockNumber#6436
Merged
matthew1001 merged 6 commits intobesu-eth:mainfrom Jan 30, 2024
Merged
Implement "pending" for qbft_getValidatorsByBlockNumber#6436matthew1001 merged 6 commits intobesu-eth:mainfrom
matthew1001 merged 6 commits intobesu-eth:mainfrom
Conversation
|
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
538f2fd to
2f999fa
Compare
jframe
approved these changes
Jan 30, 2024
Contributor
jframe
left a comment
There was a problem hiding this comment.
This use of pending makes sense to me. Just a minor code suggestion
...java/org/hyperledger/besu/consensus/qbft/jsonrpc/methods/QbftGetValidatorsByBlockNumber.java
Outdated
Show resolved
Hide resolved
…ft/jsonrpc/methods/QbftGetValidatorsByBlockNumber.java Co-authored-by: Jason Frame <jasonwframe@gmail.com> Signed-off-by: Matt Whitehead <matthew1001@hotmail.com>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
jflo
pushed a commit
to jflo/besu
that referenced
this pull request
Jan 30, 2024
* Implement 'pending' for qbft_getValidatorsByBlockNumber Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Update change log Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Update consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/jsonrpc/methods/QbftGetValidatorsByBlockNumber.java Co-authored-by: Jason Frame <jasonwframe@gmail.com> Signed-off-by: Matt Whitehead <matthew1001@hotmail.com> * Refactoring Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> --------- Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> Signed-off-by: Matt Whitehead <matthew1001@hotmail.com> Co-authored-by: Jason Frame <jasonwframe@gmail.com> Signed-off-by: Justin Florentine <justin+github@florentine.us>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR description
This PR adds support for "pending" as a string in qbft_getValidatorsByBlockNumber.
It returns the validators for the block that is in the process of being mined.
In certain stalled-chain scenarios where a new validator has been voted in but not enough validators are online to mine the next block, neither
qbft_getPendingVotesnorqbft_getValidatorsByBlockNumber("latest")are useful since the vote is no longer pending, and the "latest" block is not the one that is failing to be mined. Similarly,qbft_getValidatorsByBlockNumber(<next-block-number>)cannot be used because the next block doesn't exist yet."pending" already exists as a block string, but isn't implemented by most JSON/RPC methods. This is only the 2nd method that implements it I believe, but it seems like a valid interpretation of "pending" in this case. All other JSON/RPC methods will continue to revert to "latest" if "pending" is specified.
Fixed Issue(s)
No issue raised for this.
Doc changes required