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

Alonzo support for protocol parameter updates #2784

Merged
merged 12 commits into from
Jun 9, 2021

Conversation

newhoggy
Copy link
Contributor

@newhoggy newhoggy commented Jun 4, 2021

Add direct serialisation instances for UpdateProposal and related types. Extend the CLI for the new parameters.

Also refactor the "deriving via" machinery to make some of the instances simpler.

Add more round trip tests for the protocol params and related types.

@newhoggy newhoggy force-pushed the direct-serialisation-instances branch 2 times, most recently from f7170c7 to 9614f9b Compare June 4, 2021 07:36
@dcoutts dcoutts force-pushed the direct-serialisation-instances branch from 9614f9b to 8a2a984 Compare June 8, 2021 00:42
@dcoutts dcoutts marked this pull request as ready for review June 8, 2021 00:43
@dcoutts
Copy link
Contributor

dcoutts commented Jun 8, 2021

This should mean that CLI protocol param updates for new Alonzo era protocol params works (but not yet tested).

@dcoutts dcoutts force-pushed the direct-serialisation-instances branch 2 times, most recently from d079805 to 3915b99 Compare June 8, 2021 11:33
@dcoutts dcoutts changed the title Direct serialisation instances Alonzo support for protocol parameter updates Jun 8, 2021
@dcoutts dcoutts force-pushed the direct-serialisation-instances branch 3 times, most recently from bab5dac to 478c070 Compare June 8, 2021 22:56
@dcoutts
Copy link
Contributor

dcoutts commented Jun 8, 2021

bors merge

iohk-bors bot added a commit that referenced this pull request Jun 8, 2021
2784: Alonzo support for protocol parameter updates r=dcoutts a=newhoggy

Add direct serialisation instances for UpdateProposal and related types. Extend the CLI for the new parameters.

Also refactor the "deriving via" machinery to make some of the instances simpler.

Add more round trip tests for the protocol params and related types.

Co-authored-by: Duncan Coutts <duncan@well-typed.com>
Co-authored-by: John Ky <john.ky@iohk.io>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 9, 2021

Timed out.

dcoutts and others added 11 commits June 9, 2021 12:19
For the UsingRawBytesHex type, which we're going to extend and add other
similar types. The imports are such that it's easier in a separate
module. Additionally, these types can provide many instances so it's not
really specific to the SerialiseAsRawBytes class.
This provides To/FromCBOR based on the SerialiseAsRawBytes instance.

The example is
> deriving (ToCBOR, FromCBOR) via (UsingRawBytes Blah)
This provides the same instances as UsingRawBytesHex but based on the
bech32 encoding rather than hex encoding.
And other minor related tidy ups of the deriving instances.
Previously we serialised UpdateProposal to CBOR using the underlying
CBOR instance for the Shelley.Update type. We can no longer do this
because our strategy in the API for the protocol params is to use a
single representation across all eras, rather than an era-dependent
representation. This means that no single era from the underlying ledger
can represent all the protocol params. Thus for serialisation we need a
direct instance, rather than going via the ledger types.

This requires To/FromCBOR instances for ProtocolParametersUpdate, which
entail To/FromCBOR instances for a few other types.

Co-authored-by: John Ky <john.ky@iohk.io>
Extend the generators for the new Alonzo era fields. Add a CBOR round
trip test for UpdateProposals.

Fix some bugs in the JSON serialisation for the new Alonzo fields in the
ProtocolParameters type, as found by the round trip test.
Co-authored-by: Duncan Coutts <duncan@well-typed.com>
We have --tx-in and --mint so the corresponding script flags should be
called --tx-in-script-file and --mint-script-file to match.

For backwards compat we keep the old names as hidden aliases.
@newhoggy newhoggy force-pushed the direct-serialisation-instances branch from ba31337 to d8025a6 Compare June 9, 2021 02:20
@newhoggy
Copy link
Contributor Author

newhoggy commented Jun 9, 2021

Rebased

@newhoggy
Copy link
Contributor Author

newhoggy commented Jun 9, 2021

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 9, 2021

@iohk-bors iohk-bors bot merged commit 1a35eea into master Jun 9, 2021
@iohk-bors iohk-bors bot deleted the direct-serialisation-instances branch June 9, 2021 03:00
iohk-bors bot added a commit that referenced this pull request Jun 9, 2021
2798: Update CLI to enable Plutus script submission r=newhoggy a=Jimbo4350

- Depends on #2784 

Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
iohk-bors bot added a commit that referenced this pull request Jun 9, 2021
2798: Update CLI to enable Plutus script submission r=newhoggy a=Jimbo4350

- Depends on #2784 

Co-authored-by: Jordan Millar <jordan.millar@iohk.io>
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.

2 participants