-
Notifications
You must be signed in to change notification settings - Fork 162
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
Prune consumed tx_out #1398
Prune consumed tx_out #1398
Conversation
@@ -146,6 +146,8 @@ insertBlock syncEnv cblk applyRes firstAfterRollback tookSnapshot = do | |||
Generic.fromBabbageBlock (ioPlutusExtra iopts) (getPrices applyResult) blk | |||
insertEpoch details | |||
lift $ commitOrIndexes withinTwoMin withinHalfHour | |||
when (unBlockNo blkNo `mod` 21600 == 0) $ do |
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.
think that's meant to be 2160
not 21600
.
I ended up using something like bellow rather than hard coding this value:
getSecurityParam :: SyncEnv -> Word64
getSecurityParam syncEnv =
case envLedgerEnv syncEnv of
HasLedger hle -> getSecurityParameter $ leProtocolInfo hle
NoLedger nle -> getSecurityParameter $ nleProtocolInfo nle
not sure that would be of use 🤷
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.
21600, or 10 * securityParameter, is the expected number of blocks per epoch on mainnet, so by doing this periodicaly every 21600 it's done roughly once per epoch.
Initially I wanted to do this pruning at the first block of the epoch, however the block itself doesn't carry this information, it requires the ledger state and we have options that disable it. So this was the easiest check I can make to have a realistic benchmark just by looking at the block itself (no additional state).
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.
ah cool, so we can only rollback 2160 but the length of an epoch is normally (10 * 2160) 👍
I thought the securityParameter
param was ascertained from the config value inside the shelly-genesis.json
file.
In my example would I be wrong in doing like that?
Apologies as it's not very clear to me, will the delete 'cascade' the references for tx_out from ma_tx_out as well (as it has a max of 900 1-to-many mapping from tx_out)? |
Indeed this is not done in this pr yet, though it should. I was running benchmarks with |
Gotcha - thanks. Just wanted to be sure it's not missed 🙂 |
Superseded by #1416 |
Description
This is a prototype for #1397. It doesn't correctly handles rollbacks or migrations, but it allows to benchmark syncing and querying the feauture. It builds on top of #1389
Checklist
fourmolu
(which can be run withscripts/fourmolize.sh
Migrations
If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.