Skip to content

Conversation

Pantani
Copy link
Collaborator

@Pantani Pantani commented Sep 22, 2025

@Pantani Pantani self-assigned this Sep 22, 2025
Copy link
Collaborator

@tbruyelle tbruyelle left a comment

Choose a reason for hiding this comment

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

Don't you need a store migration to initialize the max commission value ?

EDIT: sorry I was on a review rush and didn't realize this PR was marked as draft 😬


if msg.CommissionRate.GT(maxCommissionRate) {
return nil, errorsmod.Wrapf(types.ErrCommissionLTMaxRate, "cannot set validator (%s) commission to more than minimum rate of %s", msg.CommissionRate.String(), maxCommissionRate.String())
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Duplicated code.

Could also be simplified with a single condition, something like this:

if msg.CommissionRate.LT(minCommissionRate) || msg.CommissionRate.GT(maxCommissionRate) {
	return nil, errorsmod.Wrapf(types.ErrCommissionOutOfBound,
		"commission rate (%s) must be between %s and %s",
		msg.CommissionRate.String(), minCommissionRate.String(), maxCommissionRate.String(),
	)
}


simState.AppParams.GetOrGenerate(historicalEntries, &histEntries, simState.Rand, func(r *rand.Rand) { histEntries = getHistEntries(r) })

simState.AppParams.GetOrGenerate(maximumCommissionRate, &histEntries, simState.Rand, func(r *rand.Rand) { maxCommissionRate = getMaxCommissionRate(r) })
Copy link
Collaborator

Choose a reason for hiding this comment

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

For some curious reason, minCommissionRate is not initialized here. Secondly I don't think you should pass the address og histEntries here.

DefaultHistoricalEntries uint32 = 10000

// DefaultMaxCommission default maximum commission.
DefaultMaxCommission = 100 // 30% (30/100 = 0.3 = 30%
Copy link
Collaborator

Choose a reason for hiding this comment

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

// 30% (30/100 = 0.3 = 30%

This comment seems wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add fixed chain-set commission for validators to Nakamoto Bonus

2 participants