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

Refactor subnet validator primary network requirements #2014

Merged
merged 5 commits into from
Sep 15, 2023

Conversation

dhrubabasu
Copy link
Contributor

@dhrubabasu dhrubabasu commented Sep 13, 2023

Why this should be merged

De-dupes some logic

How this works

helper function :)

How this was tested

CI

@@ -524,24 +532,8 @@ func verifyAddPermissionlessValidatorTx(

var txFee uint64
if tx.Subnet != constants.PrimaryNetworkID {
primaryNetworkValidator, err := GetValidator(chainState, constants.PrimaryNetworkID, tx.Validator.NodeID)
if err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functionality change in this PR is adding the following code here:

if err == database.ErrNotFound {
	return fmt.Errorf(
		"%s %w of the primary network",
		validator.NodeID,
		ErrNotValidator,
	)
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to clarify, this should not change validity because the functional change is to provide a more specific error message and both errors are treated the same

@dhrubabasu dhrubabasu added this to the v1.10.10 milestone Sep 13, 2023
@dhrubabasu dhrubabasu added vm This involves virtual machines cleanup Code quality improvement labels Sep 13, 2023
@StephenButtolph StephenButtolph changed the title dedupe subnet validator primary network requirements Refactor subnet validator primary network requirements Sep 15, 2023
@StephenButtolph StephenButtolph merged commit 032fb4a into dev Sep 15, 2023
16 checks passed
@StephenButtolph StephenButtolph deleted the dedupe-code branch September 15, 2023 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code quality improvement vm This involves virtual machines
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants