-
Notifications
You must be signed in to change notification settings - Fork 156
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
more events, AnnotatedBlock #2437
Conversation
What's the logic behind |
theres discussion here IntersectMBO/cardano-db-sync#668 and AnnotatedBlock seemed relatively uncontroversial. I think it could probably be an event or something so we don't need to do all of this plumbing again |
Yep, having this data as an event makes lots of sense. I'd rather avoid the current implementation. |
558b335
to
a891924
Compare
963bd9a
to
0fcdf2b
Compare
0fcdf2b
to
1a0caf2
Compare
…ecs into db-sync-wishlist-2
This somehow has a very large number of unrelated changes integrated into it... please can you rebase just the relevant parts onto master? |
oh yeah, i don't know what's up with that. i'll fix that |
990165d
to
d30b674
Compare
…ecs into db-sync-wishlist-2
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 guess I can see why you've taken this approach, but I think it's going to be better to have these as conventional events, each generated at the correct place. So we would have a bunch of AnnotatedTx
events, plus a block-level one.
data AnnotatedTx = AnnotatedTx | ||
{ atInputSum :: !Coin, -- Sum of the tx inputs | ||
atOutSum :: !Coin, -- Sum of the tx outputs | ||
txFees :: !Coin -- All fields in the superset of all tx types |
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.
Speaking with Erik, he would also like to have the actual resolved inputs here.
@@ -64,7 +84,8 @@ class | |||
Environment (Core.EraRule "BBODY" era) ~ STS.BbodyEnv era, | |||
State (Core.EraRule "BBODY" era) ~ STS.BbodyState era, | |||
Signal (Core.EraRule "BBODY" era) ~ (Block BHeaderView era), | |||
ToCBORGroup (TxSeq era) | |||
ToCBORGroup (TxSeq era), | |||
Coercible (Event (Core.EraRule "BBODY" era)) (STS.BbodyEvent era) |
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 appreciate this is more general, but for consistency with everything else I'd rather stick with the equality constraint.
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.
Some instances won't compile if this is in equality constraint. This constraint will get floated outside of typeclass. Maybe it could be an Embed
constraint instead, but the Coercible
constraint is not superficially more general
abEpochSlot :: !SlotNo, -- The slot within the epoch (starts at 0 for first slot of each epoch | ||
abTimeStamp :: !UTCTime, -- The slot number converted to UTCTime | ||
abEpochSize :: !EpochSize, -- Number of slots in current epoch | ||
abTxs :: [AnnotatedTx] -- All fields in the superset of all block types |
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.
Don't understand the comment 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.
the AnnotatedTx
is meant to contain fields from the TxIn/TxOut/TxBody
of each i believe
pools = _pParams $ _pstate $ _delegationState $ ledgerState | ||
certs = Foldable.toList (getField @"certs" txBody) | ||
ins = | ||
Val.coin (balance @era (eval ((getField @"inputs" txBody) <| _utxo u))) |
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.
Doing this within the API, rather than during the appropriate ledger rule, means we end up resolving the inputs twice. The correct place for this would surely be in the Utxo
rule?
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.
Is this expensive? I can't imagine this AnnotatedBlock
would be very useful if it was split up into several events. I don't see where in Cardano.Ledger.Alonzo.Rules.Utxo.hs
would be more appropriate, I feel like I'm missing something
76dd5fc
to
78d10c5
Compare
78d10c5
to
78ef70f
Compare
closed in favor of #2652 |
No description provided.