-
Notifications
You must be signed in to change notification settings - Fork 439
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
(BIDS-2634) reordered transactions, fix almost-empty table #2663
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transaction table on the address page does not seem to be affected by your changes.
Here is a random example I have found:
https://holesky.beaconcha.in/address/0x6cc9397c3b38739dacbfaa68ead5f5d77ba5f455
=>
https://holesky.beaconcha.in/block/273427#transactions
So right now, the txs shown in the tx table on the address page are sorted by block in descending order (i.e. txs in younger blocks are listed ABOVE txs in older blocks) and when there are more txs in one block, lower index tx come first. Your PR should change the latter so that higher indexes are listed below, right? I am asking because of your change here: https://github.com/gobitfly/eth2-beaconchain-explorer/pull/2663/files#diff-143a07e5aa31442d87e5dd9584d1525fc98e8b2fef161a08af276d65f60184acR2137-R2138
If I run your branch and navigate to http://localhost:8081/address/0x6cc9397c3b38739dacbfaa68ead5f5d77ba5f455, it looks the same though:
Please share your thoughts.
FYI, I have not tested the other tx tables on the address page as it is possible that I am misunderstanding your intentions.
EDIT: Disregard this, I wasn't able to recall/reproduce what this was actually about after coming back to this. The new implementation regarding the paragraph below should address and hopefully fix your concern. And this also made me aware of another issue with reversePaddedIndex - it doesn't do padding correctly, resulting in index 0 being larger than index 1. This currently results in index 0 always being at the top of the list, immediately followed by the max index. |
552fabe
to
80c668e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks correct now according to my testing but please confirm that I understood the issues we have on master correctly:
- For the
/transactions
page the blocks were correctly descending but all the tx were ascending so the tx order needed to be reverted - For the
/address
page both blocks and tx were already correctly descending, however there was a bug that the first tx (idx 0) was always incorrectly at the top.
db/bigtable_eth1.go
Outdated
} | ||
|
||
// first find out if we've a (sub)transaction with index 0 whose block/transaction has maybe not been completed by the request | ||
// if we find one, make sure we do. So we won't miss that (i)tx next time (=> ignoring the query limit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: The comment seems incomplete.
db/bigtable_eth1.go
Outdated
} | ||
// tx idx | ||
if i_splits[6] != j_splits[6] { | ||
if i_splits[6] == "10000" || j_splits[6] == "10000" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Keep in mind that with BIDS-2550 we added TX_PER_BLOCK_LIMIT
and ITX_PER_TX_LIMIT
.
When some kind of merging happens these should be used throughout the new methods instead of the hardcoded "10000"/"100000".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I'm aware and intended to take care of this when necessary, just not possible yet when we don't know which PR will be merged first
Yes, your understanding is correct 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed with @Eisei24 , my initial concerns have been properly tackled.
3b9e3a7
to
8b8e6e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, error message could still be updated.
@@ -2073,7 +2073,7 @@ func skipBlockIfLastTxIndex(key string) string { | |||
return key | |||
} | |||
|
|||
func (bigtable *Bigtable) GetEth1TxForAddress(prefix string, limit int64) ([]*types.Eth1TransactionIndexed, string, error) { | |||
func (bigtable *Bigtable) GetEth1TxsForAddress(prefix string, limit int64) ([]*types.Eth1TransactionIndexed, []string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: This is just a change from a merge but the method name changed here but not in the error message here
eth2-beaconchain-explorer/db/bigtable_eth1.go
Line 2123 in 8b8e6e6
logger.WithError(err).WithField("prefix", prefix).WithField("limit", limit).Errorf("error reading rows in bigtable_eth1 / GetEth1TxForAddress") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And again, lgtm.
🤖 Generated by Copilot at a7a7b97
This pull request fixes some issues with the eth1 transactions API and the Bigtable database query. It improves the pagination and order of the
eth1Transactions.go
endpoint and prevents an error in theGetBlocksDescending
function ofbigtable_eth1.go
.