-
Notifications
You must be signed in to change notification settings - Fork 89
generalize db-converter #2375
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
generalize db-converter #2375
Conversation
7fbcc60
to
97a6fda
Compare
97a6fda
to
b7ed0ad
Compare
I tested this on a small part of mainnet and it seems to work ok. However I noticed the validation lasted way longer when the cardano flags where enabled (instead of simple Byron). Outputs with
Cardano:
Notice 0:16.81 vs 3:28.27 ! |
This is worrying! This is reproducible, right? Not just a fluke? Can you try replacing the last The next step would be to start profiling. |
In #2375, we discovered that validating a Byron chain took 10x as long using `CardanoBlock` than using `ByronBlock`. Looking at the profiling report, we see it being dominated by: ``` exp' src/Shelley/Spec/NonIntegral.hs:(171,1)-(175,43) 52.1 56.7 ln' src/Shelley/Spec/NonIntegral.hs:(159,1)-(162,27) 22.7 26.1 ``` Which is strange, as we're validating a Byron-only chain! It turns out that these two functions are called by `mkActiveSlotCoeff`, which is called as part of `mkShelleyLedgerConfig`, which we are calling in `completeLedgerConfig`. This happens for *each* block. To fix this, we replace the partial ledger config of Shelley with a non-partial one containing a dummy `EpochInfo Identity`. In `completeLedgerConfig` we replace the dummy `EpochInfo Identity` with the correct one. This means we only call `mkShelleyLedgerConfig` once and cache its result.
We found the cause. See #2390 for a fix. |
In #2375, we discovered that validating a Byron chain took 10x as long using `CardanoBlock` than using `ByronBlock`. Looking at the profiling report, we see it being dominated by: ``` exp' src/Shelley/Spec/NonIntegral.hs:(171,1)-(175,43) 52.1 56.7 ln' src/Shelley/Spec/NonIntegral.hs:(159,1)-(162,27) 22.7 26.1 ``` Which is strange, as we're validating a Byron-only chain! It turns out that these two functions are called by `mkActiveSlotCoeff`, which is called as part of `mkShelleyLedgerConfig`, which we are calling in `completeLedgerConfig`. This happens for *each* block. To fix this, we replace the partial ledger config of Shelley with a non-partial one containing a dummy `EpochInfo Identity`. In `completeLedgerConfig` we replace the dummy `EpochInfo Identity` with the correct one. This means we only call `mkShelleyLedgerConfig` once and cache its result.
2390: Avoid recomputing the ShelleyLedgerConfig r=mrBliss a=mrBliss In #2375, we discovered that validating a Byron chain took 10x as long using `CardanoBlock` than using `ByronBlock`. Looking at the profiling report, we see it being dominated by: ``` exp' src/Shelley/Spec/NonIntegral.hs:(171,1)-(175,43) 52.1 56.7 ln' src/Shelley/Spec/NonIntegral.hs:(159,1)-(162,27) 22.7 26.1 ``` Which is strange, as we're validating a Byron-only chain! It turns out that these two functions are called by `mkActiveSlotCoeff`, which is called as part of `mkShelleyLedgerConfig`, which we are calling in `completeLedgerConfig`. This happens for *each* block. To fix this, we replace the partial ledger config of Shelley with a non-partial one containing a dummy `EpochInfo Identity`. In `completeLedgerConfig` we replace the dummy `EpochInfo Identity` with the correct one. This means we only call `mkShelleyLedgerConfig` once and cache its result. Co-authored-by: Thomas Winant <thomas@well-typed.com>
10be7d5
to
0a8f3e2
Compare
0a8f3e2
to
4b79937
Compare
bors merge |
bors cancel |
I just realised this will break https://github.com/input-output-hk/ouroboros-network/blob/master/nix/validate-mainnet.nix We should update that too. |
#2369