Add Integration Test for Staking max_entries Parameter #1175
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.
Summary
This PR adds a new integration test (
TestMaxUnbondingDelegationEntries) to verify and document the behavior of themax_entriesstaking parameter, which limits the number of concurrent unbonding delegations per delegator-validator pair.Motivation
The
max_entriesparameter is a critical but often overlooked constraint in Cosmos SDK-based chains. Several DeFi protocols on Coreum rely heavily on delegation and undelegation mechanics to generate yield:The challenge is that the
max_entriesthreshold can be reached relatively quickly during normal protocol operations, potentially blocking further undelegations until existing entries complete their unbonding period.What This Test Validates
max_entriesis reachedtoo many unbonding delegation entries) is returnedWhy This Matters for DeFi Developers
Understanding this parameter is essential when building protocols that programmatically manage delegations. Without proper handling, a protocol could find itself unable to process user withdrawal requests.
Recommended Mitigation Strategies
DeFi developers can work around this limitation by:
max_entrieslimitTest Coverage
The test performs the following sequence:
max_entriesparameter from chain statemax_entriesunbonding delegations (all should succeed)File Changed
integration-tests/modules/staking_test.go→ AddedTestMaxUnbondingDelegationEntriesTesting
This change is