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 Implement TokenCancelAirdrop transaction #14115

Conversation

stoyanov-st
Copy link
Contributor

Description:

With HIP-904 we introduce Token Airdrops.
We want to provide the option for an airdrop sender to cancel an airdrop that have been sent previously by them. That would be useful if the airdrop sender has made a mistake or the receiver hasn't claimed the airdrop for too long. This would be a way to remove ongoing fees for auto renewal that would be charged from the airdrop sender account.

Related issue(s):
#13683

Fixes #

Notes for reviewer:

Checklist

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

MrValioBg and others added 7 commits June 25, 2024 17:00
Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
…rdrop' into 013683-implement-token-cancel-airdrop
Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
…ients` (#14053)

Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Co-authored-by: Mustafa Uzun <mustafa.uzun@limechain.tech>
Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
@stoyanov-st stoyanov-st added the Limechain Work planned for the LimeChain team label Jul 2, 2024
@stoyanov-st stoyanov-st added this to the v0.53 milestone Jul 2, 2024
@stoyanov-st stoyanov-st changed the base branch from develop to 13658-implement-tokenAirdropTransaction July 2, 2024 15:27
…enAirdropTransaction' into 013683-implement-token-cancel-airdrop

# Conflicts:
#	hapi/build.gradle.kts
#	hedera-node/hapi-utils/src/main/java/com/hedera/node/app/hapi/utils/CommonPbjConverters.java
#	hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/dispatcher/TransactionHandlers.java
#	hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/HandleWorkflowModule.java
#	hedera-node/hedera-config/src/main/java/com/hedera/node/config/data/ApiPermissionConfig.java
#	hedera-node/hedera-schedule-service-impl/src/main/java/com/hedera/node/app/service/schedule/impl/handlers/HandlerUtility.java
#	hedera-node/hedera-token-service-impl/src/main/java/com/hedera/node/app/service/token/impl/handlers/TokenHandlers.java
#	hedera-node/hedera-token-service-impl/src/test/java/com/hedera/node/app/service/token/impl/test/handlers/TokenHandlersTest.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>
@@ -59,7 +59,7 @@ abstract class GitClone : DefaultTask() {
commandLine(
"git",
"clone",
"https://github.com/hashgraph/hedera-protobufs.git",
"https://github.com/LimeChain/hedera-protobufs.git",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will change this when hashgraph/hedera-protobufs#387 is merged

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>
Copy link

github-actions bot commented Jul 3, 2024

Node: HAPI Test (Node Death Reconnect) Results

3 tests   3 ✅  5m 40s ⏱️
3 suites  0 💤
3 files    0 ❌

Results for commit 0110ff0.

Copy link

github-actions bot commented Jul 3, 2024

Node: HAPI Test (Token) Results

 20 files   20 suites   6m 8s ⏱️
266 tests 264 ✅ 0 💤 2 ❌
341 runs  339 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit 0110ff0.

Copy link

github-actions bot commented Jul 3, 2024

Node: HAPI Test (Restart) Results

3 tests   3 ✅  6m 38s ⏱️
3 suites  0 💤
3 files    0 ❌

Results for commit 0110ff0.

Copy link

github-actions bot commented Jul 3, 2024

Node: HAPI Test (Crypto) Results

 25 files   25 suites   13m 4s ⏱️
376 tests 375 ✅ 0 💤 1 ❌
384 runs  383 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 0110ff0.

Copy link

github-actions bot commented Jul 3, 2024

Node: HAPI Test (Misc) Results

 51 files   51 suites   20m 32s ⏱️
357 tests 357 ✅ 0 💤 0 ❌
375 runs  375 ✅ 0 💤 0 ❌

Results for commit 0110ff0.

Copy link

github-actions bot commented Jul 3, 2024

Node: HAPI Test (Time Consuming) Results

19 tests   19 ✅  23m 1s ⏱️
 4 suites   0 💤
 4 files     0 ❌

Results for commit 0110ff0.

Copy link

github-actions bot commented Jul 3, 2024

Node: HAPI Test (Smart Contract) Results

 73 files   73 suites   23m 56s ⏱️
623 tests 617 ✅ 0 💤 6 ❌
677 runs  671 ✅ 0 💤 6 ❌

For more details on these failures, see this check.

Results for commit 0110ff0.

Copy link

github-actions bot commented Jul 3, 2024

Node: Unit Test Results

  1 548 files    1 548 suites   2h 33m 57s ⏱️
116 645 tests 116 584 ✅ 59 💤 2 ❌
124 972 runs  124 911 ✅ 59 💤 2 ❌

For more details on these failures, see this check.

Results for commit 0110ff0.

MrValioBg and others added 3 commits July 5, 2024 10:56
…ncelAirdropHandler (#14091)

Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Co-authored-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
…o 013683-implement-token-cancel-airdrop

# Conflicts:
#	hapi/build.gradle.kts
#	hedera-node/hapi-utils/src/main/java/com/hedera/node/app/hapi/utils/CommonPbjConverters.java
#	hedera-node/hedera-token-service-impl/src/main/java/com/hedera/node/app/service/token/impl/handlers/TokenHandlers.java
Comment on lines +99 to +102
final var key = senderAccount.key();
if (key == null || !isValid(key)) {
throw new PreCheckException(ACCOUNT_IS_IMMUTABLE);
}
Copy link
Member

Choose a reason for hiding this comment

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

This will fail when we do requireKey. We don't need extra check here

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed in #14379


validateFalsePreCheck(op.pendingAirdrops().isEmpty(), EMPTY_PENDING_AIRDROP_ID_LIST);
validateFalsePreCheck(
op.pendingAirdrops().size() > MAX_ALLOWED_PENDING_AIRDROPS_TO_CANCEL, MAX_PENDING_AIRDROP_ID_EXCEEDED);
Copy link
Member

Choose a reason for hiding this comment

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

Can this be MAX_PENDING_AIRDROPS_EXCEEDED

Copy link
Contributor

Choose a reason for hiding this comment

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

Now the cancel is separated from the airdrop and we don't have the MAX_PENDING_AIRDROPS_EXCEEDED constant.

@vtronkov
Copy link
Contributor

Created a new PR branched from develop - #14379

@vtronkov vtronkov closed this Jul 24, 2024
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.

None yet

4 participants