-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: completed transaction use bytes for transaction protocol (not …
…hex string) in wallet database (#5906) Description --- Changed the transaction protocol in the wallet database to use bytes instead of a hex string, as the underlying data type is encrypted bytes. This issue was highlighted due to the `to_hex` function in `tari_utilities` not being able to convert large transactions into hex strings (returned `**String to large**`) for saving in the wallet database during system-level coin-split stress testing. Motivation and Context --- See above. How Has This Been Tested? --- Existing unit tests and cucumber tests passed Added two new unit tests and a cucumber test (long-running) System-level test creating a coin-split transaction with 499 outputs passed What process can a PR reviewer use to test or verify this change? --- Code walk-through Run the new unit tests Perform a system-level test creating a coin-split transaction with 499 outputs and wait for it to be mined and confirmed, <!-- Checklist --> <!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> Breaking Changes --- - [ ] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [X] Other - Please specify <!-- Does this include a breaking change? If so, include this line as a footer --> BREAKING CHANGE: All completed transactions in the wallet database will be deleted at startup, while subsequent output validation will re-allocate outputs that were encumbered to be spent as available and invalidate outputs that were encumbered to be received.
- Loading branch information
1 parent
1195afb
commit 61256cd
Showing
10 changed files
with
181 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
1 change: 1 addition & 0 deletions
1
base_layer/wallet/migrations/2023-11-03-161500_transaction_protocol/down.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- This file should undo anything in `up.sql` |
27 changes: 27 additions & 0 deletions
27
base_layer/wallet/migrations/2023-11-03-161500_transaction_protocol/up.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- Any old 'completed_transactions' will not be valid due to the change in 'transaction_protocol' to | ||
-- 'BLOB', so we drop and recreate the table. | ||
|
||
DROP TABLE completed_transactions; | ||
CREATE TABLE completed_transactions | ||
( | ||
tx_id BIGINT PRIMARY KEY NOT NULL, | ||
source_address BLOB NOT NULL, | ||
destination_address BLOB NOT NULL, | ||
amount BIGINT NOT NULL, | ||
fee BIGINT NOT NULL, | ||
transaction_protocol BLOB NOT NULL, | ||
status INTEGER NOT NULL, | ||
message TEXT NOT NULL, | ||
timestamp DATETIME NOT NULL, | ||
cancelled INTEGER NULL, | ||
direction INTEGER NULL, | ||
coinbase_block_height BIGINT NULL, | ||
send_count INTEGER DEFAULT 0 NOT NULL, | ||
last_send_timestamp DATETIME NULL, | ||
confirmations BIGINT NULL, | ||
mined_height BIGINT NULL, | ||
mined_in_block BLOB NULL, | ||
mined_timestamp DATETIME NULL, | ||
transaction_signature_nonce BLOB DEFAULT 0 NOT NULL, | ||
transaction_signature_key BLOB DEFAULT 0 NOT NULL | ||
); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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