-
Notifications
You must be signed in to change notification settings - Fork 170
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
Improve btccheckpointinfo rpc #370
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.
Nice! np about the changes will update relevant PRs
// the BTC checkpoint transactions on the above block | ||
repeated TransactionInfo earliest_btc_block_txs = 4; | ||
// the BTC checkpoint transactions of the best submission | ||
repeated TransactionInfo best_submission_transactions = 4; | ||
// list of vigilantes' addresses |
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.
// list of vigilantes' addresses | |
// list of vigilantes' addresses of the best submission |
x/btccheckpoint/types/types.go
Outdated
// Index of the latest transaction in youngest submission block | ||
LatestTxIndex uint32 | ||
YoungestBlockInitialTxIdx uint32 |
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.
Why the initial
keyword here?
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.
hmm yea it a bit weird. Maybe lowest
will be better ? As this is only used for tie resolving, and this is transaction with lowest transaction idx in youngest block.
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.
yep sounds good
3ee8033
to
e2bcae3
Compare
Improves
BtcCheckpointInfo
query:As far as performance go this pr does not make any changes. Most probably biggest performance hit in this endpoint is the fact of linear scans when calling
MainChainDepth
. One hacky improvement would be to avoid callingMainChainDepth
when epoch is finalized, as then we know for sure that submission is on main chain and deep enough so we could only callBlockHeight
call, but I would avoid doing this if the performance unless it is critical.Imo it is better to wait for improved btc lightclient.