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

Populate memo in blockstore signatures-for-address #19515

Merged

Conversation

CriesofCarrots
Copy link
Contributor

@CriesofCarrots CriesofCarrots commented Aug 31, 2021

Problem

cc #19512 Payment providers would like to use memos to annotate transactions, but wallets can't easily display these memos in the tx-history list. ConfirmedTransactionStatusWithSignature and RpcConfirmedTransactionStatusWithSignature contain memo fields for this purpose, but these are not being populated.

Summary of Changes

Store memos in new blockstore TransactionMemos column via the TransactionStatusService, and use it to populate the memo field for getSignaturesForAddress response objects that are queried from blockstore.

This will require a stubbed TransactionMemos column in v1.6, or backporting both memo-population PRs to v1.6. Preference?

I also considered the alternate solution of a new AddressSignatures column to store the memo alongside each address, similar to the schema in bigtable, but ultimately decided that the very small perf savings in Blockstore::get_confirmed_signatures_for_address2() are not worth the additional disk to duplicate memos for every address. (However, it may still be worth plumbing a new AddressSignatures column sometime in the future to fix the column key to return signatures in proper execution order.)

@codecov
Copy link

codecov bot commented Aug 31, 2021

Codecov Report

Merging #19515 (e27024b) into master (c550b32) will decrease coverage by 0.2%.
The diff coverage is 39.9%.

@@            Coverage Diff            @@
##           master   #19515     +/-   ##
=========================================
- Coverage    82.7%    82.4%   -0.3%     
=========================================
  Files         461      468      +7     
  Lines      131215   131675    +460     
=========================================
+ Hits       108519   108628    +109     
- Misses      22696    23047    +351     

mvines
mvines previously approved these changes Sep 2, 2021
Copy link
Member

@mvines mvines left a comment

Choose a reason for hiding this comment

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

This will require a stubbed TransactionMemos column in v1.6, or backporting both memo-population PRs to v1.6. Preference?

A full backport seems worthwhile as this looks low risk and gets us nice memos in RPC sooner

However, it may still be worth plumbing a new AddressSignatures column sometime in the future to fix the column key to return signatures in proper execution order

Can you please remind me of the limitation here? Signatures from the same block aren't returned in chronological entry order?

transaction-status/src/extract_memos.rs Outdated Show resolved Hide resolved
@CriesofCarrots
Copy link
Contributor Author

Can you please remind me of the limitation here? Signatures from the same block aren't returned in chronological entry order?

@mvines , yes, that's right. The key on the AddressSignatures column is (unused_u8, Pubkey, Slot, Signature, which means that within each slot, the signatures are stored and return in order of Signature bytes. A fixed AddressSignatures column would be keyed: (Pubkey, Slot, SlotIndex, Signature)

@mergify mergify bot dismissed mvines’s stale review September 3, 2021 01:34

Pull request has been modified.

@CriesofCarrots CriesofCarrots force-pushed the expose-memos-blockstore branch from f2cbacc to 6547d6f Compare September 3, 2021 01:35
@CriesofCarrots CriesofCarrots force-pushed the expose-memos-blockstore branch from 6547d6f to e27024b Compare September 3, 2021 01:37
@mvines
Copy link
Member

mvines commented Sep 3, 2021

Can you please remind me of the limitation here? Signatures from the same block aren't returned in chronological entry order?

@mvines , yes, that's right. The key on the AddressSignatures column is (unused_u8, Pubkey, Slot, Signature, which means that within each slot, the signatures are stored and return in order of Signature bytes. A fixed AddressSignatures column would be keyed: (Pubkey, Slot, SlotIndex, Signature)

Thanks. This may become an issue with the confidential token transfer work that we're looking at, I'll make a note and we can revisit it soon-ish if so!

@CriesofCarrots CriesofCarrots merged commit 5fa3e57 into solana-labs:master Sep 3, 2021
mergify bot pushed a commit that referenced this pull request Sep 3, 2021
* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e57)

# Conflicts:
#	core/src/transaction_status_service.rs
#	ledger/src/blockstore.rs
#	transaction-status/src/extract_memos.rs
mergify bot pushed a commit that referenced this pull request Sep 3, 2021
* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e57)

# Conflicts:
#	ledger/src/blockstore.rs
mergify bot added a commit that referenced this pull request Sep 3, 2021
…19605)

* Populate memo in blockstore signatures-for-address (#19515)

* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e57)

# Conflicts:
#	ledger/src/blockstore.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <[email protected]>
Co-authored-by: Tyera Eulberg <[email protected]>
CriesofCarrots added a commit that referenced this pull request Sep 3, 2021
* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e57)
CriesofCarrots added a commit that referenced this pull request Sep 3, 2021
* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e57)
CriesofCarrots added a commit that referenced this pull request Sep 3, 2021
* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e57)
CriesofCarrots added a commit that referenced this pull request Sep 3, 2021
* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e57)
CriesofCarrots added a commit that referenced this pull request Sep 3, 2021
* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e57)
CriesofCarrots added a commit that referenced this pull request Sep 3, 2021
* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e57)
mergify bot added a commit that referenced this pull request Sep 3, 2021
* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e57)

Co-authored-by: Tyera Eulberg <[email protected]>
frits-metalogix added a commit to identity-com/solana that referenced this pull request Nov 24, 2021
@CriesofCarrots CriesofCarrots deleted the expose-memos-blockstore branch July 27, 2022 17:50
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.

2 participants