chore: fix several occasional issues for EVN;#3091
Merged
zzzckck merged 4 commits intobnb-chain:developfrom May 15, 2025
Merged
chore: fix several occasional issues for EVN;#3091zzzckck merged 4 commits intobnb-chain:developfrom
zzzckck merged 4 commits intobnb-chain:developfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes occasional issues related to validator retrieval and block fetching by updating RPC calls and using the latest chain state across several protocol components.
- Updated debug logging to provide more context for request/response tracing.
- Removed block number parameters in favor of rpc.LatestBlockNumber in validator-related functions.
- Fixed a missed request issue in the p2p dispatcher.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eth/protocols/bsc/peer.go | Added a debug log for RequestBlocksByRange to trace request results. |
| eth/protocols/bsc/handler.go | Changed log level from Trace to Debug and enhanced logging details. |
| eth/protocols/bsc/dispatcher.go | Added logging for request dispatch and cleanup in the dispatcher. |
| consensus/parlia/stakehub.go | Modified GetValidators and getNodeIDsForValidators to always use the latest block, updating log messages accordingly. |
Comments suppressed due to low confidence (3)
eth/protocols/bsc/peer.go:204
- [nitpick] The log field 'ret' is ambiguous; consider renaming it to a more descriptive term, such as 'noResult', to enhance clarity.
log.Debug("RequestBlocksByRange result", "requestID", requestID, "ret", res == nil, "err", err)
consensus/parlia/stakehub.go:22
- Removing the blockNumber parameter in GetValidators alters the API; ensure that all consumers and tests account for this change and rely on using the latest block.
func (p *Parlia) GetValidators(offset, limit *big.Int) ([]common.Address, []common.Address, *big.Int, error) {
consensus/parlia/stakehub.go:64
- The removal of the blockNumber parameter in getNodeIDsForValidators simplifies the function, but confirm that this change aligns with intended behavior across all usage scenarios.
func (p *Parlia) getNodeIDsForValidators(validatorsToQuery []common.Address) (map[common.Address][]enode.ID, error) {
MatusKysel
approved these changes
May 15, 2025
zzzckck
approved these changes
May 15, 2025
This was referenced May 16, 2025
Merged
galaio
added a commit
to galaio/bsc
that referenced
this pull request
May 29, 2025
galaio
added a commit
to galaio/bsc
that referenced
this pull request
May 29, 2025
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.
Description
This PR will fix several occasional issues for EVN.
It reports this error log occasionally, which is caused by unstale chain state, here will use default
rpc.LatestBlockNumber.It reports this error log occasionally, which is caused by sending first.
Changes
Notable changes: