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

proto: transaction format cleanup #3542

Merged
merged 7 commits into from
Dec 29, 2023
Merged

proto: transaction format cleanup #3542

merged 7 commits into from
Dec 29, 2023

Conversation

hdevalence
Copy link
Member

This commit:

  • Aligns the TransactionPlan with the Transaction data structure
  • Moves the fee into the TransactionParameters

Now the transaction body consists solely of:

  • a list of Actions describing changes to the chain state
  • a set of TransactionParameters describing under what conditions those changes can be applied
  • a set of DetectionData (extensible) for assisting with transaction detection
  • a set of MemoData with encrypted information about the transaction's purpose.

This commit:

- Aligns the `TransactionPlan` with the `Transaction` data structure
- Moves the `fee` into the `TransactionParameters`

Now the transaction body consists solely of:

- a list of `Action`s describing changes to the chain state
- a set of `TransactionParameters` describing under what conditions those changes can be applied
- a set of `DetectionData` (extensible) for assisting with transaction detection
- a set of `MemoData` with encrypted information about the transaction's purpose.
@hdevalence
Copy link
Member Author

Closes #3391 #3541

@hdevalence
Copy link
Member Author

hdevalence commented Dec 29, 2023

We have a lot of memo-related types. Deduplicated in dbbc6a0

This commit makes detection data handling consistent with memo handling, using
an optional field to record the presence or absence of detection data.

Also, it fixes the effect hash computation to always hash something for the
memo and for the detection data, ensuring that absent packets are correctly
recorded in the effect hash.
Comment on lines +75 to +77
state.update(parameters_hash.as_bytes());
state.update(memo_hash.as_bytes());
state.update(detection_data_hash.as_bytes());
Copy link
Member Author

Choose a reason for hiding this comment

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

cc @redshiftzero ; in the case of a ledger or similar device, we can avoid having the ledger compute FMD clues by passing the detection data hash from the host device to the ledger

@hdevalence hdevalence marked this pull request as ready for review December 29, 2023 16:08
@hdevalence hdevalence merged commit e9905fe into main Dec 29, 2023
5 checks passed
@hdevalence hdevalence deleted the tx-proto-fixes branch December 29, 2023 16:21
@hdevalence hdevalence mentioned this pull request Jan 4, 2024
2 tasks
@cratelyn cratelyn added the protobuf-changes Makes changes to the protobuf definitions. label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protobuf-changes Makes changes to the protobuf definitions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants