You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Essentially, for every epoch, the Parlia consensus engine would verify the validators set by calling an RPC method. However, when using the ./bsc import block_data tool, the RPC API is not available as it purely does block importing and execution. Hence, this results in the error as shown above.
There are a few solutions to this problem:
Re-engineer the getCurrentValidators method to not use the RPC method. We may risk breaking crucial components with this approach.
Launch the node alongside the RPC API when executing the ./bsc import tool. We only need the RPC API, so other services launched are trivial and add unnecessary processing overhead.
Simply add an option in Parlia to skip verifying validators.
The third option is selected. While it may not be the most elegant, it ensures that this tool is working properly with a minimal change to the codebase, and without breaking things.
There are a few solutions to this problem:
1.Re-engineer the getCurrentValidators method to not use the RPC method. We may risk breaking crucial components with this approach.
2.Launch the node alongside the RPC API when executing the ./bsc import tool. We only need the RPC API, so other services launched are trivial and add unnecessary processing overhead.
3.Simply add an option in Parlia to skip verifying validators.
///===== Actually, I would prefer Solution 1 or Solution 2 if possible.
Went with the second approach. UX is slightly worse because logs related to starting a node will also appear. But the good thing is that code changes are minimal, no need to modify major components and there is not much performance impact.
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
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 fixes a bug when importing blocks in an offline manner (i.e.
./bsc import block_data).Rationale
Expected Behaviour
Command:
./bsc import block_dataActual Behaviour
Command:
./bsc import block_dataThe error above is primarily triggered by the following function:
bsc/consensus/parlia/parlia.go
Lines 993 to 998 in bd13416
Essentially, for every epoch, the Parlia consensus engine would verify the validators set by calling an RPC method. However, when using the
./bsc import block_datatool, the RPC API is not available as it purely does block importing and execution. Hence, this results in the error as shown above.There are a few solutions to this problem:
getCurrentValidatorsmethod to not use the RPC method. We may risk breaking crucial components with this approach../bsc importtool. We only need the RPC API, so other services launched are trivial and add unnecessary processing overhead.The third option is selected. While it may not be the most elegant, it ensures that this tool is working properly with a minimal change to the codebase, and without breaking things.
Changes
noVerifyValidatorsto Parlia