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

feat: HIP-904: Adapt creation flows to support unlimited auto associations and adjust fees #13350

Conversation

stoyanov-st
Copy link
Contributor

@stoyanov-st stoyanov-st commented May 16, 2024

Description:
We are adding validations for -1 maxAutoAssociations that acts as unlimited flag for auto associations.
We are also removing the fees for auto association slots if we have enabled the unlimitedAutoAssociationsEnabled flag.

Related issue(s):

Fixes #13061

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

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>
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>
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>
@mustafauzunn mustafauzunn added the Limechain Work planned for the LimeChain team label May 16, 2024
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
mustafauzunn and others added 3 commits May 21, 2024 15:12
Signed-off-by: Mustafa Uzun <mustafa.uzun@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Base automatically changed from 012981-hip-904-unlimited-max-auto-associations-feature-flag to 012981-hip-904-unlimited-max-auto-associations May 29, 2024 10:57
…ns' into 012981-hip-904-unlimited-max-auto-associations-create-flows

# Conflicts:
#	hedera-node/hedera-token-service-impl/src/main/java/com/hedera/node/app/service/token/impl/validators/CryptoCreateValidator.java
…ns' into 012981-hip-904-unlimited-max-auto-associations-create-flows

# Conflicts:
#	hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/contract/hapi/ContractCreateSuite.java
#	hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/crypto/AutoAccountCreationSuite.java
#	hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/crypto/CryptoCreateSuite.java
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>
@kselveliev kselveliev self-requested a review May 31, 2024 10:48
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
@mustafauzunn mustafauzunn added this to the v0.51 milestone Jun 4, 2024
@@ -192,13 +192,13 @@ public void cryptoCreateUsage(

if (maxAutomaticTokenAssociations > 0) {
baseSize += INT_SIZE;
accumulator.addRbs(maxAutomaticTokenAssociations * lifeTime * CREATE_SLOT_MULTIPLIER);
Copy link
Contributor

Choose a reason for hiding this comment

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

In my understanding, all automatic token association slots should be free.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want to completely remove this as I don't see a way to check the feature flag there?

@@ -100,7 +100,7 @@ public boolean tooManyAutoAssociations(
@NonNull final TokensConfig tokensConfig) {
return (entitiesConfig.limitTokenAssociations() && n > tokensConfig.maxPerAccount())
|| n > ledgerConfig.maxAutoAssociations()
|| (n < 0 && !entitiesConfig.unlimitedAutoAssociationsEnabled())
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the Javadoc of this method. We are not only checking the upper bound.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Javadoc updated to reflect the changes

…ns' into 012981-hip-904-unlimited-max-auto-associations-create-flows

# Conflicts:
#	hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/crypto/AutoAccountCreationSuite.java
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
@stoyanov-st stoyanov-st requested a review from netopyr June 5, 2024 12:24
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>
@stoyanov-st
Copy link
Contributor Author

Merging this PR, any further comments can be addressed in the base PR

@stoyanov-st stoyanov-st merged commit 024f410 into 012981-hip-904-unlimited-max-auto-associations Jun 6, 2024
45 of 46 checks passed
@stoyanov-st stoyanov-st deleted the 012981-hip-904-unlimited-max-auto-associations-create-flows branch June 6, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Limechain Work planned for the LimeChain team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HIP-904: Adapt Creation flows to support the unlimited maxAutoAssociation and update fee calculations
5 participants