-
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
Bump CHaP to cardano-ledger-conway-1.7.0.0 #179
Conversation
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Fixed
Show fixed
Hide fixed
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Fixed
Show fixed
Hide fixed
$ Ledger.ConwayRegDRep | ||
vcred | ||
(toShelleyLovelace deposit) | ||
(error "TODO" `asTypeOf` Ledger.SNothing) |
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.
Anchor can be added later to DRepRegistrationRequirements
constructor.
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 added an argument of type (Ledger.Url, ByteString)
, the same precursor of the to-be-defined cardano-api:Anchor
data type that I've used elsewhere.
@@ -79,18 +85,14 @@ data AnyGovernanceAction = forall era. AnyGovernanceAction (Gov.GovernanceAction | |||
-- TODO: Conway - fill in remaining actions | |||
data GovernanceAction | |||
= MotionOfNoConfidence | |||
| ProposeNewConstitution ByteString | |||
| ProposeNewCommittee [Hash StakeKey] Rational -- NB: This also includes stake pool keys | |||
| ProposeNewConstitution ByteString -- NB: This is the bytes of the hash, not the bytes that were hashed |
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.
from @nfrisby :
I anticipate that this argument should become an Anchor soon enough (eg this PR IntersectMBO/cardano-ledger#3625).
I don't However, it's your repo! :D Should I default to accepting all of the suggestions? (.,. Even the one about |
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Outdated
Show resolved
Hide resolved
ce768a4
to
654bacb
Compare
cardano-api/internal/Cardano/Api/Governance/Actions/VotingProcedure.hs
Outdated
Show resolved
Hide resolved
654bacb
to
0939a88
Compare
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Fixed
Show fixed
Hide fixed
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Fixed
Show fixed
Hide fixed
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Fixed
Show fixed
Hide fixed
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Fixed
Show fixed
Hide fixed
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Fixed
Show fixed
Hide fixed
I just force pushed a commit.
|
0939a88
to
fdd45ff
Compare
I just pushed another; it backs out the changes that I thought were required, but eg didn't understand the planned work's scope well enough to realize were premature. In their place, I've left many calls to |
fdd45ff
to
b517214
Compare
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Show resolved
Hide resolved
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Outdated
Show resolved
Hide resolved
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Show resolved
Hide resolved
, Gov.pProcAnchor = SNothing -- TODO: Conway | ||
, Gov.pProcReturnAddr = L.mkRwdAcnt (error "TODO which network?") (L.KeyHashObj retAddrh) | ||
, Gov.pProcGovAction = toGovernanceAction sbe govAct | ||
, Gov.pProcAnchor = error "TODO which anchor?" |
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.
SNothing
would be better here with a -- TODO: Conway era
. We want to still be able to submit Proposal
s in the cli.
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 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 used SNothing
elsewhere, wherever it was permitted, along the lines of your suggestion here. But it's not permitted here any longer :/
Looks good to me. Minor fixes: |
{ Gov.constitutionAnchor = Gov.Anchor | ||
{ Gov.anchorUrl = case textToUrl "TODO constitution anchorUrl" of | ||
Nothing -> error "impossible! How could 27 ASCII chars be more than 64 bytes?" | ||
Just url -> url |
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 TODO to add CLI parsing for the anchor url?
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.
Throughout this code PR, "TODO" means "The most recent ledger changes will ultimately require additional data here, which the arguments of the local function do not yet provide. Frisby doesn't know the right way to handle that here right now, so here's a stub deserving attention of the Node Team."
{ Gov.anchorUrl = case textToUrl "TODO constitution anchorUrl" of | ||
Nothing -> error "impossible! How could 27 ASCII chars be more than 64 bytes?" | ||
Just url -> url | ||
, Gov.anchorDataHash = unsafeBytesToSafeHash bs -- TODO "safe*" alternative? |
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.
What might the safe alternative involve?
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.
My guess:
- introduce a type for the hash of the constitution data (or perhaps the hash of any anchor data)
- use that in the argument to
ProposeNewConstitution
instead of a bareByteString
- somewhere between the command-line and this logic needs to properly handle the case where the bytes given by the user cannot be interpreted as such a hash
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.
Would it be unreasonable to ask ledger to provide this function?
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.
@lehins As far as I know, unsafeMakeSafeHash :: Hash.Hash (HASH c) index -> SafeHash c index
after Crypto.hashFromBytes :: ByteString -> Maybe (Hash a)
is the only way to construct a SafeHash
from the bytes of the hash. Is that right? And unsafeMakeSafeHash
has a very strongly worded Haddock comment saying it shouldn't be used as it's currently being used in this PR.
This makes me wonder if the anchorDataHash
really needs to be a SafeHash
. The ledger rules themselves never deal with the actual constitution data, so I don't know that the Safe*
part of SafeHash
is actually useful here (or more generally to any Anchor
for that matter).
fa68b41
to
ef35b6c
Compare
cardano-api/internal/Cardano/Api/Governance/Actions/ProposalProcedure.hs
Outdated
Show resolved
Hide resolved
a06068a
to
4556af2
Compare
12bc50c
to
d67ab5b
Compare
b4a5569
to
513de10
Compare
64738a5
to
0519ee1
Compare
1e0e393
to
f5fae2c
Compare
d8b91e0
to
f5fae2c
Compare
f5fae2c
to
fef23f2
Compare
the relevant functions
QueryConstitution now returns the Constitution
…ProtocolParams StandardCrypto Implement Semigroup (Ledger.ConwayPParams StrictMaybe era) Update ScriptErrorMissingScript
fef23f2
to
6b03aa4
Compare
…e-action Add goverance info action creation to era based cli
Changelog
Context
Updating the ledger dependency to the work-in-progress
cardano-ledger-conway-1.7.0.0
(via asource-repository-package
for now) required the following.TxVotes
carries a map nowResolvablePointers
now has a different representation than does the ledgerProposalNewCommitee
requires the old committee's credentialsProposalNewConstitution
case oftoGovernanceAction
was hashing the argument'ByteString
, but it was already a hash.temporarilyOptOutOfPrevGovAction
TODO
s throughout the code due to new partiality/missing arguments/etcmakeGovernanceActionId
was reusing the transaction id as the governance action id, but the types no longer allow that.Semigroup
oprhan was missing forConwayPParams
QueryConstitutionHash
phantom type is now more specificCardano.Ledger.Api
no longer exportEraCrypto
Checklist
See Running tests for more details
.cabal
files are updatedhlint
. See.github/workflows/check-hlint.yml
to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
to get thestylish-haskell
versionghc-8.10.7
andghc-9.2.7