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
feat: HIP-904 Introduce unlimitedAutoAssociations
feature flag
#13041
base: 012981-hip-904-unlimited-max-auto-associations
Are you sure you want to change the base?
feat: HIP-904 Introduce unlimitedAutoAssociations
feature flag
#13041
Conversation
Node: HAPI Test (Restart) Results2 tests 2 ✅ 8m 3s ⏱️ Results for commit d9d8314. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Node Death Reconnect) Results2 tests 2 ✅ 10m 8s ⏱️ Results for commit d9d8314. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Token) Results235 tests 233 ✅ 24m 24s ⏱️ Results for commit d9d8314. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Misc) Results464 tests 454 ✅ 44m 4s ⏱️ Results for commit d9d8314. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Crypto) Results335 tests 335 ✅ 39m 49s ⏱️ Results for commit d9d8314. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Time Consuming) Results21 tests 21 ✅ 53m 48s ⏱️ Results for commit d9d8314. ♻️ This comment has been updated with latest results. |
Node: Unit Test Results 2 305 files ±0 2 305 suites ±0 4h 25m 8s ⏱️ + 1h 43m 32s Results for commit d9d8314. ± Comparison against base commit e64faab. This pull request removes 4026 and adds 3789 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Node: HAPI Test (Smart Contract) Results592 tests 592 ✅ 1h 15m 41s ⏱️ Results for commit d9d8314. ♻️ This comment has been updated with latest results. |
It seems like this PR includes adding the feature flag for both the mono and modularized codebase. Why do we need it in mono? |
...ain/java/com/hedera/node/app/service/token/impl/handlers/TokenAssociateToAccountHandler.java
Outdated
Show resolved
Hide resolved
hedera-node/hedera-config/src/main/java/com/hedera/node/config/data/ContractsConfig.java
Outdated
Show resolved
Hide resolved
...pl/src/main/java/com/hedera/node/app/service/token/impl/validators/TokenCreateValidator.java
Outdated
Show resolved
Hide resolved
@@ -24,4 +24,5 @@ | |||
public record EntitiesConfig( | |||
@ConfigProperty(defaultValue = "3153600000") @NetworkProperty long maxLifetime, | |||
// @ConfigProperty(defaultValue = "FILE") Set<EntityType> systemDeletable | |||
@ConfigProperty(defaultValue = "false") @NetworkProperty boolean limitTokenAssociations) {} | |||
@ConfigProperty(defaultValue = "false") @NetworkProperty boolean limitTokenAssociations, | |||
@ConfigProperty(defaultValue = "true") @NetworkProperty boolean unlimitedAutoAssociations) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be unlimitedAutoAssociationsEnabled
or allowUnlimitedAutoAssociations
or enableUnlimitedAutoAssociations
for clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change it to allowUnlimitedAutoAssociations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be unlimitedAutoAssociationsEnabled
, because we use this pattern more frequently.
@@ -24,4 +24,5 @@ | |||
public record EntitiesConfig( | |||
@ConfigProperty(defaultValue = "3153600000") @NetworkProperty long maxLifetime, | |||
// @ConfigProperty(defaultValue = "FILE") Set<EntityType> systemDeletable | |||
@ConfigProperty(defaultValue = "false") @NetworkProperty boolean limitTokenAssociations) {} | |||
@ConfigProperty(defaultValue = "false") @NetworkProperty boolean limitTokenAssociations, | |||
@ConfigProperty(defaultValue = "true") @NetworkProperty boolean unlimitedAutoAssociations) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this should be in TokensConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new property is related to accounts. Is there a reason to move it to token configurations?
return n > ledgerConfig.maxAutoAssociations() | ||
|| (entitiesConfig.limitTokenAssociations() && n > tokensConfig.maxPerAccount()); | ||
return (entitiesConfig.limitTokenAssociations() && n > tokensConfig.maxPerAccount()) | ||
|| (!entitiesConfig.unlimitedAutoAssociations() && n > ledgerConfig.maxAutoAssociations()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to check !entitiesConfig.unlimitedAutoAssociations()
this here ? Even if the configuration is enabled, we should not be able to set a higher number. That configuration is just allowed for -1
to be set in maxAutoAssociations
right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understanding we should not limit the automatic associations if the configuration is enabled.
Or is it only if the value is -1 we have unlimited auto associations and we keep limiting the positive values e.g. 5000 is valid but 5001 - invalid?
@Neeharika-Sompalli @MiroslavGatsanoga Can you provide more info on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. If we allow unlimited auto associations, it is hard to explain why setting a concrete number should be limited. But this changes the current behavior and therefore we have to double-check (and eventually update the HIP).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is it only if the value is -1 we have unlimited auto associations and we keep limiting the positive values e.g. 5000 is valid but 5001 - invalid
Yes, that should be the intended behaviour. Having the feature flag enabled should allow maxAutoAssociations
value for any account to be set to -1.
If an account has maxAutoAssociations = -1
then we have unlimited auto associations for this account.
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
a5f43f7
to
7270b85
Compare
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 012981-hip-904-unlimited-max-auto-associations #13041 +/- ##
=================================================================================
Coverage 61.73% 61.74%
- Complexity 31227 31231 +4
=================================================================================
Files 3442 3442
Lines 141267 141269 +2
Branches 14778 14780 +2
=================================================================================
+ Hits 87217 87223 +6
+ Misses 50163 50159 -4
Partials 3887 3887 ☔ View full report in Codecov by Sentry. |
Description:
With this PR we are introducing the
unlimitedAutoAssociations
feature flag inEntitiesConfig
.We also add relative changes to handler logic in regards to auto associations and relative tests.
Related issue(s):
Fixes #12981
Notes for reviewer:
Checklist