-
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
Stake Distribution, Deposits and Conway #1484
Conversation
They are now inserted earlier
These are type b migrations
Due to Conway migration there are now 28 additional indexes
12eb568
to
c8c9f8c
Compare
@@ -20,7 +20,7 @@ checkForceIndexesArg = | |||
startDBSync dbSyncEnv | |||
-- assertBlockNoBackoff dbSyncEnv 0 | |||
threadDelay 3_000_000 | |||
assertEqQuery dbSyncEnv DB.queryPgIndexesCount 143 "there wasn't the correct number of indexes" | |||
assertEqQuery dbSyncEnv DB.queryPgIndexesCount 161 "there wasn't the correct number of indexes" |
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.
these were failing on me today too (they were out by 1) but if I turned on consumed + purge to True they would pass 🤷
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.
There is an additional index when this flag is used, so this is expected
CREATE INDEX IF NOT EXISTS idx_tx_out_consumed_by_tx_in_id ON tx_out (consumed_by_tx_in_id)
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 just a couple of questions 👍
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE RankNTypes #-} | ||
{-# LANGUAGE ScopedTypeVariables #-} | ||
{-# LANGUAGE TypeApplications #-} | ||
{-# LANGUAGE TypeFamilies #-} | ||
{-# LANGUAGE TypeOperators #-} | ||
{-# LANGUAGE NoImplicitPrelude #-} |
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'm assuming this is fourmolu, wonder why it keeps putting N
after T
as you'd think they are ordered alphabetically 🤷
@@ -147,20 +149,29 @@ genericStakeSlice pInfo epoch sliceIndex minSliceSize lstate | |||
|
|||
-- The starting index of the data in the delegation vector. | |||
index :: Word64 | |||
index = sliceIndex * epochSliceSize | |||
index |
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.
in the future it might be worth splitting these out (index
+ size
) so we can unit test them.
hasConsumed <- liftIO $ getHasConsumed syncEnv | ||
(resolvedInputs, fees', deposits) <- case (mdeposits, unCoin <$> Generic.txFees tx) of | ||
(Just deposits, Just fees) -> do | ||
(resolvedInputs, _) <- splitLast <$> mapM (resolveTxInputs hasConsumed False (fst <$> groupedTxOut grouped)) (Generic.txInputs tx) |
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 splitLast
has been deprecated?
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.
oh no take it back just seen it later in the review, is it worth having explicit import for it?
c8c9f8c
to
380a313
Compare
Description
This pr combines 3 different stuff :
These are combined in a single pr, since testing on master any of these 3 tickets is necessary and it's more efficient to test them at once.
Checklist
fourmolu
on version 0.10.1.0 (which can be run withscripts/fourmolize.sh
)Migrations
This pr adds migrations files and is a b type breaking change.
In addition an adjusting procedure is created for the stake distribution changes. On an upgrade this procedure will insert the missing entries that should have been inserted earlier.