fix: transaction builder remove signatures+indexer fixes - #1658
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughReplaces generic RPC error generics with concrete ValidatorNodeRpcClientError, introduces ResponseErrorStatus and TransactionStatusResponseError, refactors transaction builder/signing to separate finish() and seal(), and updates numerous call sites, trait bounds, and error mappings across indexer, wallet SDK, validator RPC, and transaction crates. Changes
Sequence Diagram(s)sequenceDiagram
participant App as App / Test
participant Builder as TransactionBuilder
participant Unsigned as UnsignedTransaction
participant Unsealed as UnsealedTransactionV1
participant Signed as SignedTransaction
rect rgb(200,240,230)
Note over Builder,Signed: Old flow (single-step)
App->>Builder: build_and_seal(secret)
Builder->>Signed: finalize + seal in one step
end
rect rgb(220,240,200)
Note over Builder,Signed: New flow (two-step)
App->>Builder: finish()
Builder->>Unsealed: produce UnsealedTransactionV1
App->>Unsealed: seal(secret)
Unsealed->>Signed: attach seal signature
end
sequenceDiagram
participant Handler as API Handler
participant Net as NetworkClient
participant Validator as ValidatorNodeRPC
participant Mapper as ErrorMapper
rect rgb(240,220,220)
Note over Handler,Validator: Old error path
Handler->>Net: try_single_with_committee(...)
Net->>Validator: submit_transaction()
Validator-->>Net: Result<T, E (generic)>
Net-->>Handler: AllValidatorsFailed { last_error: Option<String> }
end
rect rgb(220,230,240)
Note over Handler,Validator: New error path
Handler->>Net: try_single_with_committee(...)
Net->>Validator: submit_transaction()
Validator-->>Net: Result<T, ValidatorNodeRpcClientError>
Net-->>Handler: AllValidatorsFailed { last_error: Option<ValidatorNodeRpcClientError> }
Handler->>Mapper: inspect last_error.status()
Mapper-->>Handler: ResponseErrorStatus (NotFound/Rejected/Internal)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (28)
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 |
e3b5d25 to
62f60b6
Compare
62f60b6 to
140c169
Compare
Description
fix: transaction builder remove signatures
fix(indexer): return HTTP bad request error if validators return RPC bad request
fix(indexer): bug in get transaction receipts always returning internal error
Motivation and Context
Previously, it was possible to partially sign a transaction and then make changes to the transaction (invalidating the signature(s)) using the builder. This would result in a panic.
This PR removes the internal signature collection from the builder, and changes the signing functions to return an Unsealed transaction which already has an API for adding futher signatures without allowing changes to the transaction.
Only code that previously used the builder incorrectly (i.e. would panic) will now fail to compile.
How Has This Been Tested?
Manually
What process can a PR reviewer use to test or verify this change?
Breaking Changes
Summary by CodeRabbit
Release Notes
Bug Fixes
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.