feat: update size checks and smart collation for hip-1300 transactions - #2608
Merged
Conversation
Signed-off-by: Kolpic <galincho112@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2608 +/- ##
=======================================
Coverage 99.95% 99.95%
=======================================
Files 184 184
Lines 7446 7446
Branches 1489 1493 +4
=======================================
Hits 7443 7443
Misses 3 3 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Implements HIP-1300 fee-payer-aware transaction sizing (6 KB standard vs 128 KB for treasury/governance payers) across frontend validation/splitting logic and backend size checks/smart collation.
Changes:
- Add privileged fee payer helpers (frontend/backend) to compute payer-based max transaction size.
- Update frontend big-file decision/chunking to use payer-aware max size and larger chunks for privileged payers.
- Update backend
isTransactionOverMaxSize/isTransactionBodyOverMaxSize/smartCollateto use payer-aware size limits, plus add tests and privileged-size constants.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| front-end/src/tests/renderer/utils/sdk/privilegedPayer.spec.ts | Adds frontend tests for privileged payer detection and max-size helpers |
| front-end/src/shared/constants/index.ts | Adds privileged (128 KB) transaction size constant |
| front-end/src/renderer/utils/sdk/privilegedPayer.ts | New frontend helper for HIP-1300 privileged payer detection / max-size |
| front-end/src/renderer/utils/sdk/index.ts | Re-exports privileged payer helper |
| front-end/src/renderer/components/Transaction/TransactionProcessor/components/ValidateRequestHandler.vue | Makes size validation payer-aware |
| front-end/src/renderer/components/Transaction/TransactionProcessor/components/BigFilePersonalRequestHandler.vue | Makes big-file splitting/chunk sizing payer-aware (personal flow) |
| front-end/src/renderer/components/Transaction/TransactionProcessor/components/BigFileOrganizationRequestHandler.vue | Makes big-file splitting/chunk sizing payer-aware (org flow) |
| front-end/src/renderer/components/Transaction/Create/FileAppend/FileAppendFormData.vue | Makes chunk-size input cap payer-aware |
| front-end/src/renderer/components/Transaction/Create/FileAppend/FileAppend.vue | Passes current payer ID down to the form |
| back-end/libs/common/src/utils/sdk/transaction.ts | Updates smart collation and size checks to use payer-aware limits |
| back-end/libs/common/src/utils/sdk/privileged-payer.ts | New backend helper for HIP-1300 privileged payer detection / max-size |
| back-end/libs/common/src/utils/sdk/privileged-payer.spec.ts | Adds backend tests for payer-aware sizing and smart collation |
| back-end/libs/common/src/database/entities/transaction.entity.ts | Adds privileged (128 KB) max transaction size constant |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Kolpic <galincho112@gmail.com>
Signed-off-by: Kolpic <galincho112@gmail.com>
Signed-off-by: Kolpic <galincho112@gmail.com>
Signed-off-by: Kolpic <galincho112@gmail.com>
svienot
reviewed
Apr 9, 2026
Kolpic
added a commit
that referenced
this pull request
Apr 15, 2026
#2608) * feat: update size checks and smart collation for hip-1300 transactions Signed-off-by: Kolpic <galincho112@gmail.com> * fix: updated imports from @hashgraph/sdk to @hiero-ledger/sdk Signed-off-by: Kolpic <galincho112@gmail.com> * fix: renamed test name Signed-off-by: Kolpic <galincho112@gmail.com> * chore: added new helper and reused across files Signed-off-by: Kolpic <galincho112@gmail.com> * chore: comments for explaining the bytes and for the be and fe files Signed-off-by: Kolpic <galincho112@gmail.com> --------- Signed-off-by: Kolpic <galincho112@gmail.com> Co-authored-by: John Bair <117694970+jbair06@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2551
Description:
Implements HIP-1300, which raises the transaction size limit from 6 KB to 128 KB when the fee payer is one of the privileged governance accounts:
0.0.2(Treasury) or any account in0.0.42through0.0.799. All other transactions continue to use the standard 6 KB limit.What changed:
privileged-payer.tson both backend and frontend) — single source of truth forisPrivilegedFeePayer()andgetMaxTransactionSize(feePayer).isTransactionOverMaxSize,isTransactionBodyOverMaxSize,smartCollate) now derive the limit from the transaction's fee payer instead of using a flat constant. Smart collation no longer prunes signatures from a 50 KB transaction paid by0.0.2.ValidateRequestHandler,BigFileOrganizationRequestHandler,BigFilePersonalRequestHandler) is fee-payer aware, so an 8 KB File Update paid by treasury goes through as a single transaction instead of being split.FileAppendFormData) chunk-sizemaxattribute is acomputeddriven by the currently selected fee payer.How it works:
Every size check calls
getMaxTransactionSize(feePayer), which inspects the account's shard.realm.num and returns 131,072 bytes for0.0.2and0.0.42–0.0.799, or 6,144 bytes for everything else. The fee payer is extracted from the SDK transaction'stransactionId.accountId, so no API signatures had to change — every existing call site automatically picks up the new behavior. Tests cover all boundary conditions (0.0.1, 0.0.2, 0.0.41, 0.0.42, 0.0.799, 0.0.800) plus the 128 KB upper bound, with 100% coverage on the new helpers.