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-551 atomic batch transactions #17333

Draft
wants to merge 24 commits into
base: 17360-combine-transaction-body-proto
Choose a base branch
from

Conversation

kimbor
Copy link
Member

@kimbor kimbor commented Jan 12, 2025

Description:
Feature branch for HIP-551 Atomic Batch Transactions

Related issue(s):
Fixes #17318
Fixes #17319
Fixes #17320

Notes for reviewer:

Checklist

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

Signed-off-by: Kim Rader <[email protected]>
@kimbor kimbor added this to the v0.59 milestone Jan 12, 2025
@kimbor kimbor self-assigned this Jan 12, 2025
Copy link

codecov bot commented Jan 12, 2025

Codecov Report

Attention: Patch coverage is 41.93548% with 18 lines in your changes missing coverage. Please review.

Project coverage is 67.94%. Comparing base (efcd30e) to head (2cc60c3).

Files with missing lines Patch % Lines
...service/util/impl/handlers/AtomicBatchHandler.java 16.66% 10 Missing ⚠️
.../src/main/java/com/hedera/hapi/util/HapiUtils.java 30.00% 7 Missing ⚠️
...pp/workflows/dispatcher/TransactionDispatcher.java 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                            Coverage Diff                             @@
##             17360-combine-transaction-body-proto   #17333      +/-   ##
==========================================================================
- Coverage                                   67.94%   67.94%   -0.01%     
- Complexity                                  22342    22347       +5     
==========================================================================
  Files                                        2606     2608       +2     
  Lines                                       96901    96919      +18     
  Branches                                    10098    10099       +1     
==========================================================================
+ Hits                                        65841    65847       +6     
- Misses                                      27295    27309      +14     
+ Partials                                     3765     3763       -2     
Files with missing lines Coverage Δ
...edera/node/app/config/ServicesConfigExtension.java 100.00% <ø> (ø)
.../app/workflows/dispatcher/TransactionHandlers.java 100.00% <ø> (ø)
...ode/app/workflows/handle/HandleWorkflowModule.java 100.00% <100.00%> (ø)
...m/hedera/node/config/data/ApiPermissionConfig.java 100.00% <100.00%> (ø)
...com/hedera/node/config/data/AtomicBatchConfig.java 100.00% <100.00%> (ø)
...e/app/service/util/impl/handlers/UtilHandlers.java 100.00% <100.00%> (ø)
...a/node/app/service/util/UtilServiceDefinition.java 100.00% <100.00%> (ø)
...pp/workflows/dispatcher/TransactionDispatcher.java 55.20% <0.00%> (-0.59%) ⬇️
.../src/main/java/com/hedera/hapi/util/HapiUtils.java 61.36% <30.00%> (-0.36%) ⬇️
...service/util/impl/handlers/AtomicBatchHandler.java 16.66% <16.66%> (ø)

... and 11 files with indirect coverage changes

Impacted file tree graph

Copy link

codacy-production bot commented Jan 12, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.16% (target: -1.00%) 77.26%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7c836a9) 96454 69129 71.67%
Head commit (2cc60c3) 96702 (+248) 69458 (+329) 71.83% (+0.16%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#17333) 277 214 77.26%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Signed-off-by: Lev Povolotsky <[email protected]>
@kimbor kimbor changed the base branch from main to 17360-avoid-circular-dependency January 13, 2025 21:53
@kimbor kimbor changed the base branch from 17360-avoid-circular-dependency to main January 14, 2025 23:31
@kimbor kimbor changed the base branch from main to 17360-avoid-circular-dependency January 14, 2025 23:32
Signed-off-by: Kim Rader <[email protected]>
Signed-off-by: Kim Rader <[email protected]>
…roto' into hip-551-batch-txs

# Conflicts:
#	hapi/hedera-protobufs/services/transaction.proto
Signed-off-by: Kim Rader <[email protected]>
@kimbor kimbor changed the base branch from 17360-avoid-circular-dependency to 17360-combine-transaction-body-proto January 16, 2025 00:37
import com.swirlds.config.api.ConfigProperty;

@ConfigData("atomicBatch")
public record AtomicBatchConfig(@ConfigProperty(defaultValue = "true") @NetworkProperty boolean isEnabled) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the default should be false? Then we can enable it when we are ready or we can enable it only on specific environments?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can change it later on before we merge it to main. this is only feature flag

Comment on lines +72 to +74
if (!handleContext
.configuration()
.getConfigData(AtomicBatchConfig.class)
Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I know, this check should be done in the calculateFees method. The reason is that the calculateFees method is called on Ingest and we will throw an error early without creating an unnecessary record. This is how we implemented it for the Airdrops.

Copy link
Contributor

Choose a reason for hiding this comment

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

I saw it in some other places in that place but happy to remove it to enable or disable a service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants