Bigtable bug fixes (#12058)

* Accommodate stricted get_bincode_cell in get_confirmed_signatures_for_address

* Sort signatures newest-oldest, even within slot
This commit is contained in:
Tyera Eulberg 2020-09-04 20:29:11 -06:00 committed by GitHub
parent b64fb295a1
commit 879c98efeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -397,12 +397,14 @@ impl LedgerStorage {
let mut infos = vec![];
let starting_slot_tx_by_addr_infos = bigtable
let starting_slot_tx_len = bigtable
.get_bincode_cell::<Vec<TransactionByAddrInfo>>(
"tx-by-addr",
format!("{}{}", address_prefix, slot_to_key(!first_slot)),
)
.await?;
.await
.map(|txs| txs.len())
.unwrap_or(0);
// Return the next tx-by-addr data of amount `limit` plus extra to account for the largest
// number that might be flitered out
@ -411,7 +413,7 @@ impl LedgerStorage {
"tx-by-addr",
Some(format!("{}{}", address_prefix, slot_to_key(!first_slot))),
Some(format!("{}{}", address_prefix, slot_to_key(!last_slot))),
limit as i64 + starting_slot_tx_by_addr_infos.len() as i64,
limit as i64 + starting_slot_tx_len as i64,
)
.await?;
@ -422,8 +424,9 @@ impl LedgerStorage {
row_key
))
})?;
let cell_data: Vec<TransactionByAddrInfo> =
let mut cell_data: Vec<TransactionByAddrInfo> =
bigtable::deserialize_cell_data(&data, "tx-by-addr", row_key)?;
cell_data.reverse();
for tx_by_addr_info in cell_data.into_iter() {
// Filter out records before `before_transaction_index`
if slot == first_slot && tx_by_addr_info.index >= before_transaction_index {