Skip to content
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 latest ledger, consensus, network in preparation for cardano-node 8.8 #407

Merged
merged 23 commits into from
Feb 5, 2024

Conversation

Jimbo4350
Copy link
Contributor

@Jimbo4350 Jimbo4350 commented Dec 18, 2023

Changelog

- description: |
    Bump CHaP for cardano node 8.8 release
    Parameterize `TransactionValidityError` and `TxBodyErrorAutoBalance` on era 
    Data constructor `TransactionValidityTranslationError` is now parameterized on `ContextError (ShelleyLedgerEra era)`
    `cppPoolRetireMaxEpoch`, `protocolParamPoolRetireMaxEpoch`,  `icCommitteeTermLength` and `protocolUpdatePoolRetireMaxEpoch` records are updated to `Ledger.EpochInterval`
    Records `cppMaxBlockBodySize`, `cppMaxTxSize`, `protocolUpdateMaxBlockBodySize`, `protocolUpdateMaxTxSize` have been updated to `StrictMaybe Word32`
    Records`cppMaxBlockHeaderSize`, `protocolUpdateMaxBlockHeaderSize` has been updated to `StrictMaybe Word16`
    Inhabitants `SuccessfulPlutusScript` and `FailedPlutusScript` of `LedgerEvent` are now parameterized on `NonEmpty PlutusWithContext`
    `queryNodeLocalState` are now `executeLocalStateQueryExpr` parameterized on `Target ChainPoint`
    `ResolvablePointers` data constructor has been updated with associated data types `PlutusPurpose AsIndex (ShelleyLedgerEra era)` and `PlutusPurpose AsItem (ShelleyLedgerEra era)`
    Replace `PrevGovActionId` with `GovPurposeId`
    Implement `TxProposalProcedures` and `TxVotingProcedures` which enables Plutus script witnessing of proposals and votes.
    Remove support for intermediate tx body format.
# uncomment types applicable to the change:
  type:
  - feature        # introduces a new feature
  - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - improvement    # QoL changes e.g. refactoring
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Additional context for the PR goes here. If the PR fixes a particular issue please provide a link to the issue.

How to trust this PR

Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@Jimbo4350 Jimbo4350 changed the title WIP WIP:WIP: Bump CHaP to latest ledger, consensus, network Dec 18, 2023
@Jimbo4350 Jimbo4350 changed the title WIP:WIP: Bump CHaP to latest ledger, consensus, network WIP: Bump CHaP to latest ledger, consensus, network Dec 18, 2023
@Jimbo4350 Jimbo4350 force-pushed the jordan/20231218-ledger-consensus-network-bump branch from 361b1aa to 7f246bb Compare December 18, 2023 13:47
@Jimbo4350 Jimbo4350 force-pushed the jordan/20231218-ledger-consensus-network-bump branch 2 times, most recently from a2ebff4 to 4fc8aae Compare December 19, 2023 16:38
@Jimbo4350 Jimbo4350 force-pushed the jordan/20231218-ledger-consensus-network-bump branch 7 times, most recently from 89248cf to eaad676 Compare December 20, 2023 15:26
@Jimbo4350 Jimbo4350 force-pushed the jordan/20231218-ledger-consensus-network-bump branch 4 times, most recently from 3320fdd to ea0835d Compare January 19, 2024 20:58
@Jimbo4350 Jimbo4350 force-pushed the jordan/20231218-ledger-consensus-network-bump branch 3 times, most recently from b923148 to 7b4dabb Compare January 30, 2024 00:00
@Jimbo4350 Jimbo4350 force-pushed the jordan/20231218-ledger-consensus-network-bump branch 2 times, most recently from 3e8372f to 215e587 Compare January 31, 2024 16:04
@Jimbo4350 Jimbo4350 changed the title WIP: Bump CHaP to latest ledger, consensus, network Bump CHaP to latest ledger, consensus, network in preparation for cardano-node 8.8 Jan 31, 2024
@@ -599,7 +600,10 @@ toConsensusQueryShelleyBased sbe = \case
Some (consensusQueryInEraInMode era Consensus.GetEpochNo)

QueryConstitution ->
Some (consensusQueryInEraInMode era Consensus.GetConstitution)
caseShelleyToBabbageOrConwayEraOnwards
(const $ error "toConsensusQueryShelleyBased: QueryConstitution is only available in the Conway era")
Copy link
Contributor

@carbolymer carbolymer Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This check feels redundant because it duplicates what's already here: https://github.com/IntersectMBO/cardano-api/blob/main/cardano-api/internal/Cardano/Api/Query/Expr.hs#L213

Copy link
Contributor Author

@Jimbo4350 Jimbo4350 Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we now have to provide this constraint because in ouroboros-consensus:

  -- | Not supported in eras before Conway
  GetConstitution
    :: CG.ConwayEraGov era
    => BlockQuery (ShelleyBlock proto era) (Maybe (LC.Constitution era))

Copy link
Contributor

@carbolymer carbolymer Feb 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But era :: CardanoEra era, so this caseShelleyToBabbageOrConwayEraOnwards is not required and just consensusQueryInEraInMode era should work as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Push a branch that compiles with the above ^

&& txscriptsA == txscriptsB
&& redeemersA == redeemersB
&& txmetadataA == txmetadataB
&& scriptValidityA == scriptValidityB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why scriptValidity and redeemers equality does not make sense for previous eras?

Copy link
Contributor Author

@Jimbo4350 Jimbo4350 Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were introduced in Alonzo. You can't construct those in pre-Alonzo eras. This conversation here is another example of why we need to nuke the pre-mainnet eras where transaction construction is concerned. We shouldn't be thinking about this.

Copy link
Contributor

@carbolymer carbolymer Feb 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't construct those in pre-Alonzo eras.

Do you mean that in such case both fields will be equal to []? If that's true, there shouldn't be anything wrong with still comparing them for earlier eras.

Add required constraints
'ResolvablePointers' GADT
Replace 'RdmrPtr' with 'ScriptWitnessIndex' in 'ScriptErrorMissingScript'
  - CommitteeTermLength: EpochNo -> EpochInterval
  - MaxBlockBodySize: Natural -> Word32
  - MaxTxSize: Natural -> Word32
  - MaxBlockHeaderSize: Natural -> Word16
…eId'

Add Governance policy script hash to 'TreasuryWithdrawal' and
'UpdatePParams'
  - Cardano.Api.Tx -> Cardano.Api.Tx.Sign
  - Cardano.Api.TxBody -> Cardano.Api.Tx.Body
These encapsulate the possibility of having plutus script witnesses
for votes and proposals

Update collectTxBodyScriptWitnesses to collect script witneses for votes
and proposals
cardano-cli intermediate format and fully rely on ledger CBOR
serialization instances. See SerialiseAsCBOR (TxBody era) instance.
@Jimbo4350 Jimbo4350 force-pushed the jordan/20231218-ledger-consensus-network-bump branch from 80cab27 to 9aae71c Compare February 5, 2024 15:46
@Jimbo4350 Jimbo4350 added this pull request to the merge queue Feb 5, 2024
Merged via the queue into main with commit 9143a17 Feb 5, 2024
19 of 25 checks passed
@Jimbo4350 Jimbo4350 deleted the jordan/20231218-ledger-consensus-network-bump branch February 5, 2024 18:56
newhoggy pushed a commit that referenced this pull request Mar 11, 2024
…ne-datums-in-babbage

#406 Enable use of inline datums in Babbage era transactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants