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

Update TransactionPreviewResponse in Core API schema #1043

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

lrubasze
Copy link
Contributor

Summary

Deprecate and mark as not-required instruction_resource_changes field in TransactionPreviewResponse.

@lrubasze lrubasze changed the title Update transaction preview schema Update TransactionPreviewResponse in Core API schema Dec 18, 2024
A typical client of this API is not expected to use this receipt. The primary clients
this receipt is intended for is the Radix wallet or any client that needs to perform
A typical client of this API is not expected to use this receipt. The primary clients
this receipt is intended for is the Radix wallet or any client that needs to perform
execution summaries on their transactions.
instruction_resource_changes:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although this field is no longer required, it is currently always included in the TransactionPreviewResponse within the transaction preview handler.
It might be more logical to introduce an instruction_resource_changes flag in the TransactionPreviewResponseOptions to control whether instruction_resource_changes should be included in the TransactionPreviewResponse.
@dhedey WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I'd rather not introduce a flag if we're deprecating it, because the flag would have to default to true anyway for backwards compatibility, so we don't get any real use out of it, it will just be a pain because we'll have to have a deprecated flag for another protocol update after the feature is removed :)

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.

Project coverage is 40.7%. Comparing base (5a4f161) to head (cc676be).

Files with missing lines Patch % Lines
...-api-server/src/mesh_api/conversions/operations.rs 0.0% 5 Missing ⚠️
...pi-server/src/mesh_api/handlers/account_balance.rs 0.0% 5 Missing ⚠️
...st/core-api-server/src/core_api/conversions/lts.rs 0.0% 4 Missing ⚠️
...erver/src/mesh_api/handlers/mempool_transaction.rs 0.0% 3 Missing ⚠️
...i/generated/models/transaction_preview_response.rs 0.0% 2 Missing ⚠️
...erver/src/core_api/handlers/transaction_preview.rs 0.0% 2 Missing ⚠️
...-api-server/src/mesh_api/conversions/addressing.rs 0.0% 1 Missing ⚠️
core-rust/mesh-api-server/src/mesh_api/errors.rs 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             develop   #1043     +/-   ##
===========================================
- Coverage       40.7%   40.7%   -0.1%     
+ Complexity      4629    4628      -1     
===========================================
  Files           1892    1892             
  Lines          57683   57683             
  Branches        1527    1527             
===========================================
- Hits           23531   23529      -2     
- Misses         33672   33675      +3     
+ Partials         480     479      -1     
Flag Coverage Δ
rust 40.7% <0.0%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...-api-server/src/mesh_api/conversions/addressing.rs 13.1% <0.0%> (ø)
core-rust/mesh-api-server/src/mesh_api/errors.rs 0.0% <0.0%> (ø)
...i/generated/models/transaction_preview_response.rs 0.0% <0.0%> (ø)
...erver/src/core_api/handlers/transaction_preview.rs 0.0% <0.0%> (ø)
...erver/src/mesh_api/handlers/mempool_transaction.rs 0.0% <0.0%> (ø)
...st/core-api-server/src/core_api/conversions/lts.rs 0.0% <0.0%> (ø)
...-api-server/src/mesh_api/conversions/operations.rs 0.0% <0.0%> (ø)
...pi-server/src/mesh_api/handlers/account_balance.rs 0.0% <0.0%> (ø)

... and 2 files with indirect coverage changes

Copy link

Docker tags
docker.io/radixdlt/private-babylon-node:pr-1043
docker.io/radixdlt/private-babylon-node:b45c93d3c3
docker.io/radixdlt/private-babylon-node:sha-b45c93d

Copy link
Contributor

@dhedey dhedey left a comment

Choose a reason for hiding this comment

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

Nice work, thanks

A typical client of this API is not expected to use this receipt. The primary clients
this receipt is intended for is the Radix wallet or any client that needs to perform
A typical client of this API is not expected to use this receipt. The primary clients
this receipt is intended for is the Radix wallet or any client that needs to perform
execution summaries on their transactions.
instruction_resource_changes:
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I'd rather not introduce a flag if we're deprecating it, because the flag would have to default to true anyway for backwards compatibility, so we don't get any real use out of it, it will just be a pain because we'll have to have a deprecated flag for another protocol update after the feature is removed :)

execution summaries on their transactions.
instruction_resource_changes:
type: array
description: |
This object holds changes in resource balances for all vaults within affected
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably worth saying it does not include recalls, and should not be relied on for a comprehensive view of balance changes. Instead, the receipt balance changes should be used.

@@ -28,10 +28,10 @@ pub(crate) async fn handle_mempool_transaction(
)),
);
} else {
payload_hashes.get(0).unwrap()
payload_hashes.first().unwrap()
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you must have run clippy at a different (more recent?) version compared to the code base.

This isn't a problem, but in future, can we create a separate PR for reformatting changes, if we want to do them? This avoids too much noise in the PR :)

@radixbot
Copy link
Contributor

Benchmark summary 2024-12-23 10:26:26

Test case: xrd_transfer, TPS: 170
Test case: basic_swap, TPS: 135
Test case: radquest, TPS: 78

Benchmark dashboard
Node dashboard
Node JVM dashboard
Node Logs

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

Successfully merging this pull request may close these issues.

4 participants