Repository navigation
Conversation
Signed-off-by: iron-prog <dt915725@gmail.com>
Signed-off-by: iron-prog <dt915725@gmail.com>
Signed-off-by: iron-prog <dt915725@gmail.com>
29acd3a to
8c1d846
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughClient and transaction settings now control transaction ID regeneration. Expired transactions can regenerate IDs, rebuild bodies, re-sign, and retry. Execution prevents concurrent calls. Chunked message tests verify ID and body updates. ChangesTransaction ID regeneration
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant Transaction
participant Network
Client->>Transaction: execute
Transaction->>Network: submit transaction
Network-->>Transaction: TRANSACTION_EXPIRED
Transaction->>Transaction: generate ID and rebuild bodies
Transaction->>Client: use execution operator key
Transaction->>Network: submit re-signed transaction
Network-->>Transaction: successful response
Merge Risk: 🟡 Moderate · up to
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Linked Issues check | The PR implements the settings, freeze-time precedence, expiration retry, ID locking, chunk-aware rebuilding, re-signing, and tests required by #2643. The executing client must supply the regenerated … |
Use the operator account ID from the current execute(client) context for regeneration, or update the regeneration account when execution starts. Add a test that executes a transaction with a client whose operator account differs from the … |
✅ Passed checks (4 passed)
-
Check name Status Explanation Title check ✅ Passed The title clearly summarizes the main change: regenerating transaction IDs when transactions expire. Description check ✅ Passed The description directly explains configurable transaction ID regeneration, client and transaction settings, retry behavior, chunk handling, re-signing, and test coverage. Out of Scope Changes check ✅ Passed The changes stay within #2643. Client and transaction settings, expiration handling, transaction-ID replacement, locking, chunk-state rebuilding, operator re-signing, concurrency protection, multi-sig…Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 48 functions across 6 files.
Full details: Linked Issues check
-
Explanation
The PR implements the settings, freeze-time precedence, expiration retry, ID locking, chunk-aware rebuilding, re-signing, and tests required by
#2643. The executing client must supply the regenerated ID account. Inexecute(),self.operator_account_idis assigned from the client only when it isNone._handle_transaction_id_regeneration()then callsTransactionId.generate(self.operator_account_id). A transaction frozen or previously used with one account can therefore regenerate an ID for a different account when executed by another client. The cross-client test checks re-signing, but it does not check the regenerated ID account.Resolution
Use the operator account ID from the current
execute(client)context for regeneration, or update the regeneration account when execution starts. Add a test that executes a transaction with a client whose operator account differs from the account used during freezing or an earlier execution, then verifies that the regeneratedTransactionId.account_idmatches the executing client.
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Advanced
Run ID: ff5d30a6-73ae-444d-8adb-fec299bd19f7
📒 Files selected for processing (6)
src/hiero_sdk_python/client/client.pysrc/hiero_sdk_python/transaction/transaction.pytests/unit/client_test.pytests/unit/executable_test.pytests/unit/topic_message_submit_transaction_test.pytests/unit/transaction_test.py
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
aceppaluni
left a comment
There was a problem hiding this comment.
@iron-prog Nice work! Just a few questions from me.
For execute_all(), if an earlier chunk has already succeeded and a later chunk expires, why do we regenerate the IDs for all chunks? Could this invalidate or otherwise confuse the state representing chunks that have already been submitted successfully? Should we add a test covering a multi-chunk transaction where an earlier chunk succeeds, a later chunk expires, and we verify the already-submitted chunks aren't accidentally re-executed or otherwise affected?
Does regeneration intentionally discard all existing signatures? For transactions requiring signatures from multiple keys, clearing _signature_map and then signing only with the executing client's operator key appears to leave the regenerated transaction incompletely signed. Is that the intention? Or should we preserve/reapply signatures that are still valid, or explicitly reject regeneration for transactions with additional signatures?
What happens if the same transaction is executed concurrently with two clients and both receive TRANSACTION_EXPIRED?
Should there be tests for regeneration when operator is missing and for a multi-signature transaction?
You're right. The current implementation regenerates the complete transaction-ID sequence, which can alter IDs associated with chunks that have already been submitted. I checked the corresponding Hiero JS SDK implementation, and it regenerates only the transaction ID at the current index. I'll align the python implementation with that behavior and add a test where an earlier chunk succeeds and a later chunk expires. |
Signed-off-by: iron-prog <dt915725@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 3c0ddae3-e66a-4cda-949d-94446f50ff7f
📒 Files selected for processing (4)
src/hiero_sdk_python/client/client.pysrc/hiero_sdk_python/transaction/transaction.pytests/unit/executable_test.pytests/unit/topic_message_submit_transaction_test.py
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
Signed-off-by: iron-prog <dt915725@gmail.com>
33717e8 to
7aa38b7
Compare
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #2657 +/- ##
==========================================
+ Coverage 95.68% 95.73% +0.04%
==========================================
Files 169 169
Lines 11080 11174 +94
==========================================
+ Hits 10602 10697 +95
+ Misses 478 477 -1 🚀 New features to boost your workflow:
|
|
Hi, this is WorkflowBot.
|
Signed-off-by: iron-prog <dt915725@gmail.com>
Signed-off-by: iron-prog <dt915725@gmail.com>
|
Hi @manishdait @danielmarv @aceppaluni, For the open design questions (payer account, concurrency lock, batch inner IDs): do we need a meeting, or can you decide here in the PR? I wrote my proposals for each in the PR notes and I can change the code quickly either way. If a meeting is better, tell me which one and I will join. |
This comment was marked as resolved.
This comment was marked as resolved.
…nd guards Rework TRANSACTION_EXPIRED handling to the agreed design: - Pin the transaction ID when it is set, read through the public transaction_id property, serialized with to_bytes() or restored with from_bytes(); a pinned ID is never replaced. - Regenerate only when enabled, the ID is unpinned, the payer is the executing operator, every signature on the rebuilt bodies is the operator's, the transaction is not a BatchTransaction, and at most once per execute() call. - Regenerate the current chunk and every later chunk with consecutive IDs; move initialTransactionID when the first chunk expires. - Hold the operator key in an execute()-scoped context instead of a public attribute; drop the execution lock and pickle hooks. - Log and read the transaction ID internally without pinning it. - Resolve the client default in freeze_with() after the frozen check. Signed-off-by: Ntege Daniel <danientege785@gmail.com>
|
@danielmarv, thanks for the rework in e5dc445. I checked it locally and everything looks good. The execute-scoped operator key, single regeneration limit, and rebuilding later chunks look good. A few small points:
I’ll update the PR description and release-notes line accordingly. Thanks again! |
- Document in transaction_bytes.md that setting, reading, serializing or deserializing a transaction ID pins it, so it is not regenerated on TRANSACTION_EXPIRED. - Drop two executable_test cases duplicated in transaction_id_regeneration_test.py and move the remaining regeneration test there. Signed-off-by: Ntege Daniel <danientege785@gmail.com>
Signed-off-by: Ntege Daniel <danientege785@gmail.com>
|
@iron-prog Thank you for you working on this! Will be converting to draft while changes are address. Please feel free to convert back to "ready for review" when you are ready. Thank you!! |
|
Hi @aceppaluni |
Description:
Add support for regenerating transaction IDs when a transaction expires, with configurable client and transaction-level settings.
regenerate_transaction_idtoTransactiondefault_regenerate_transaction_idtoClientTRANSACTION_EXPIREDRelated issue(s):
Fixes #2643
Notes for reviewer:
Transaction ID regeneration is enabled by default at the client level and can be overridden per transaction.
When
TRANSACTION_EXPIREDis received and regeneration is enabled, the transaction ID is regenerated using the executing client's operator account, transaction bodies are rebuilt, and the transaction is re-signed before retrying.Chunked transactions regenerate the complete transaction ID sequence while preserving the current chunk and initial transaction ID.
Tests:
pytest -q tests/unitChecklist