-
Notifications
You must be signed in to change notification settings - Fork 23
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
Change a representation of witnesses in transaction's certificates to an ordered map where a certificate is the key #734
Change a representation of witnesses in transaction's certificates to an ordered map where a certificate is the key #734
Conversation
090aa57
to
53c3b35
Compare
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.
Confirm we aren't reintroducing a bug and I'll be happy to approve.
, Either | ||
(TxBodyErrorAutoBalance era) | ||
( BuildTxWith | ||
BuildTx |
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.
This makes my eyes bleed (I know it's not your fault).
(Certificate era) | ||
( BuildTxWith | ||
build | ||
(Maybe (StakeCredential, Witness WitCtxStake 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 would seek confirmation that #456 is not an issue with this change. I suspect this needs to be a list still.
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 suspect this needs to be a list still.
I don't see a reason for that.
I've ran regression tests here: https://github.com/IntersectMBO/cardano-node-tests/actions/runs/12928366127
cardano-testnet
tests pass: IntersectMBO/cardano-node#6082
Is that enough?
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.
Nice work. Takes a little while to page the context back into my head. One minor comment.
mWit | ||
( cert | ||
, pure $ | ||
(,wit) <$> selectStakeCredentialWitness cert |
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.
To be aware of.
In the ledger repo
-- For both of the functions `getScriptWitnessConwayTxCert` and
-- `getVKeyWitnessConwayTxCert` we preserve the old behavior of not requiring a witness
-- for staking credential registration, but only during the transitional period of Conway
-- era and only for staking credential registration certificates without a deposit. Future
-- eras will require a witness for registration certificates, because the one without a
-- deposit will be removed.
Eventually we should be able to remove the Maybe
in:
OMap
(Certificate era)
( BuildTxWith
build
(Maybe (StakeCredential, Witness WitCtxStake era))
Can you add a comment to the type definition pointing this out?
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.
Added
… an ordered map where a certificate is the key
… cardano-gen generator
3f2a381
to
4b1fc5e
Compare
Changelog
Context
This PR changes representation of transaction certificates' witnesses from a list of with stake credentials to a map.
The issue is that there's a relationship
Certificate *--1 StakeCredential
which makes the assigning of witnesses impossible in the cases where we have more than one certificate with the same stake credential. This then breaks witnesses indexing.See related PRs:
Checklist