-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add new analysis --count-blocks #3418
Conversation
EncodePanda
commented
Oct 7, 2021
=> Analysis blk | ||
countBlocks (AnalysisEnv { db, registry, initLedger, limit }) = do | ||
putStrLn $ "About to count number of blocks processed..." | ||
counted <- processAll db registry GetBlock initLedger limit 0 process |
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.
You don't necessarily need GetBlock
here. It could be any of the following ctors, since it's unused.
In particular, it could be GetPure ()
-- ie "get nothing". If we're wanting this command to identify eg malformed files (eg things that don't successfully deserialize), then that wouldn't work. But I don't get the sense that's what this command is for.
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.
I agree. Will make a change 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.
I don't know the motivation for this specific command, but it doesn't seem unreasonable and the implementation here is fine. (I suggested one simplification.)
Also, right now this also counts EBBs. Is that right? Does it matter? Should we be explicit about it? If needed: there is a BlockComponent
constructor that would let us simultaneously count the number of EBBs, so this command could report both counts.
So: I have clicked Approve.
If we accumulate too many of these "trivial" commands for our liking, we may wish to remember that there are lots of other ways this same query could be answered. EG reporting the first and last block no of some other "more significant" but not "too much slower" command and then printing the difference at the end.
There two motivations:
|
0634a3a
to
dca81ef
Compare
changed |
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.
Approved. Thanks!
bors merge |
3418: Add new analysis --count-blocks r=EncodePanda a=EncodePanda ``` cabal run ouroboros-consensus-cardano:db-analyser --\ --db db_mainnet_with_alonzo_40217333 cardano \ --configByron dbacfg/mainnet-byron-genesis.json \ --configShelley dbacfg/mainnet-shelley-genesis.json \ --nonce 1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81 \ --configAlonzo dbacfg/mainnet-alonzo-genesis.json \ --only-immutable-db \ --analyse-from 39842441 \ --count-blocks About to count number of blocks processed... Counted: 16378 ``` Co-authored-by: EncodePanda <paul.szulc@gmail.com>
Build failed: |
5fa3dc3
to
36812cf
Compare
36812cf
to
36134cb
Compare
bors merge |
3418: Add new analysis --count-blocks r=EncodePanda a=EncodePanda ``` cabal run ouroboros-consensus-cardano:db-analyser --\ --db db_mainnet_with_alonzo_40217333 cardano \ --configByron dbacfg/mainnet-byron-genesis.json \ --configShelley dbacfg/mainnet-shelley-genesis.json \ --nonce 1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81 \ --configAlonzo dbacfg/mainnet-alonzo-genesis.json \ --only-immutable-db \ --analyse-from 39842441 \ --count-blocks About to count number of blocks processed... Counted: 16378 ``` Co-authored-by: EncodePanda <paul.szulc@gmail.com>
Build failed: |
bors merge |
Build succeeded: |