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

UTxO should map from OutRefs, not TxIns #6

Merged
merged 1 commit into from
Oct 12, 2018
Merged

Conversation

JaredCorduan
Copy link
Contributor

The "Script UTxO" paper makes a distinction between:
OutRef = TxId x Ix and TxIn =TxId x Ix x Script x Script .
This PR fixes a few mistakes where TxIn was incorrectly used in place of OutRef.

Copy link
Contributor

@mgudemann mgudemann left a comment

Choose a reason for hiding this comment

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

LGTM

@JaredCorduan JaredCorduan merged commit f608620 into master Oct 12, 2018
@JaredCorduan JaredCorduan deleted the fix_utxo_type branch October 17, 2018 14:43
JaredCorduan pushed a commit that referenced this pull request Feb 12, 2019
* Implementation of abstract ledger spec using Backpack.

How does this work?

We parametrise over a signature `UTxO`, which currenly encompasses the types
`Hash`, `Coin` and `Addr`. We can specify explicitly our constraints on these
types. We then define an abstract ledger in `Ledger.Abstract` which depends on
these types, but knows nothing of their concrete representation.

In `simple/UTxO` we instantiate these parameters as in Jared's original spec.

There's a bit of a wart at the moment in that I don't think I can have the
`HasHash` class being part of the signature. So this is defined in
`Ledger.Abstract` and we then need to define the `simple/Ledger` module to
contain these.

* Define transitions for a simple ledger system.

* Change copyright, maintainer etc.
JaredCorduan pushed a commit that referenced this pull request Feb 12, 2019
# This is the 1st commit message:

Alter the endorsement registration rule, so that the set of confirmed proposals remains the same.

# This is the commit message #2:

Perform cleanup of confirmed proposals in  the epoch change rule.

# This is the commit message #3:

Remove the section that expressed that there were no voting deadlines. There are now.

# This is the commit message #4:

Define what "endorsement" means in this context.

# This is the commit message #5:

Explain the acronyms used in the labels of the update-proposal interface.

# This is the commit message #6:

Add a figure explaining the situation with a too small endorsement window.

# This is the commit message #7:

Model the software update proposal in the update proposal validity rule.

# This is the commit message #8:

Make it possible for an update proposal not to change the protocol version.
kevinhammond added a commit that referenced this pull request Oct 28, 2019
# This is the 1st commit message:
Merge branch 'spec/incentives-kh' of https://github.com/input-output-hk/cardano-ledger-specs into spec/incentives-kh

# This is the commit message #2:

overcoming fake make error

Signed-off-by: Kevin Hammond <12563287+kevinhammond@users.noreply.github.com>

# This is the commit message #3:

overcoming fake make error

Signed-off-by: Kevin Hammond <12563287+kevinhammond@users.noreply.github.com>

# This is the commit message #4:

overcoming fake make error

Signed-off-by: Kevin Hammond <12563287+kevinhammond@users.noreply.github.com>

# This is the commit message #5:

overcoming fake make error

Signed-off-by: Kevin Hammond <12563287+kevinhammond@users.noreply.github.com>

# This is the commit message #6:

overcoming fake make error

Signed-off-by: Kevin Hammond <12563287+kevinhammond@users.noreply.github.com>

# This is the commit message #7:

fix user.email

Signed-off-by: Kevin Hammond <12563287+kevinhammond@users.noreply.github.com>

# This is the commit message #8:

overcoming fake make error

Signed-off-by: Kevin Hammond <12563287+kevinhammond@users.noreply.github.com>

# This is the commit message #9:

overcoming fake make error

Signed-off-by: Kevin Hammond <12563287+kevinhammond@users.noreply.github.com>
nc6 added a commit that referenced this pull request May 19, 2020
* Implementation of abstract ledger spec using Backpack.

How does this work?

We parametrise over a signature `UTxO`, which currenly encompasses the types
`Hash`, `Coin` and `Addr`. We can specify explicitly our constraints on these
types. We then define an abstract ledger in `Ledger.Abstract` which depends on
these types, but knows nothing of their concrete representation.

In `simple/UTxO` we instantiate these parameters as in Jared's original spec.

There's a bit of a wart at the moment in that I don't think I can have the
`HasHash` class being part of the signature. So this is defined in
`Ledger.Abstract` and we then need to define the `simple/Ledger` module to
contain these.

* Define transitions for a simple ledger system.

* Change copyright, maintainer etc.
nc6 pushed a commit that referenced this pull request May 19, 2020
# This is the 1st commit message:

Alter the endorsement registration rule, so that the set of confirmed proposals remains the same.

# This is the commit message #2:

Perform cleanup of confirmed proposals in  the epoch change rule.

# This is the commit message #3:

Remove the section that expressed that there were no voting deadlines. There are now.

# This is the commit message #4:

Define what "endorsement" means in this context.

# This is the commit message #5:

Explain the acronyms used in the labels of the update-proposal interface.

# This is the commit message #6:

Add a figure explaining the situation with a too small endorsement window.

# This is the commit message #7:

Model the software update proposal in the update proposal validity rule.

# This is the commit message #8:

Make it possible for an update proposal not to change the protocol version.
dcoutts added a commit that referenced this pull request Jun 12, 2021
We use UnitInterval for several protocol params, but Rational for a_0
since it can be above 1.

For UnitInterval we use Ratio Word64 so that we stick to a bounded size
for the external representation.

For Rational we need to stick to a bounded external representation too,
and things are simpler if we use exactly the same one as for
UnitInterval. This is also the representation specified in the CDDL.

rational = #6.30([uint, uint])

This inconsistency was found by the generators and CBOR round trip tests
for the API package. It was using a Word64 ratio based generator for all
the Rational parameters. This failed for the a_0 param, since it only
accepts Int64 range. The a_0 param is not signed, so it does not need
signed integer support.

The name is now a bit of a misnoymer however. It might be better to make
a newtype wrapper for the a_0 param.
teodanciu pushed a commit to bienpulenta/cardano-ledger that referenced this pull request Apr 19, 2023
nc6 added a commit that referenced this pull request Jul 5, 2024
This is the final set of changes to the Conway
CDDL spec made via comparison with the original
cddl files for Conway.

As of this commit, the remaining changes with the
original cddl are as follows:

- Various fields in crypto were defined with /=
  and are now defined with =. This does not affect
  the semantics, being instead a convention as per
  https://datatracker.ietf.org/doc/html/rfc8610#section-3.9
- The index keys in auxiliary_data are written as
  if they were value and not type keys:
  ```
    39,43c30,34
      <                   / #6.259({? 0 : metadata
      <                             , ? 1 : [* native_script]
      <                             , ? 2 : [* plutus_v1_script]
      <                             , ? 3 : [* plutus_v2_script]
      <                             , ? 4 : [* plutus_v3_script]})
      ---
      >                   / #6.259({? 0 => metadata
      >                             , ? 1 => [* native_script]
      >                             , ? 2 => [* plutus_v1_script]
      >                             , ? 3 => [* plutus_v2_script]
      >                             , ? 4 => [* plutus_v3_script]})
  ```
  This is a simpler formulation with identical semantics.
- The alternatives in 'certificate', 'relay',
  'native_script' and 'gov_action' are encoded
  using type1 choice semantics ('/') rather than
  group choice semantics ('//'). In the context,
  this is an equivalent formulation.
- nonempty_oset has been removed, pending
  explanation of what it means. nonempty_set is
  used instead.
- In various places, null is replaced with nil.
  They are synonyms.
- The names of type parameters are changed;
  typically a is replaced with a0.
- A few rules using references as the bounds in
  ranges are now inlined. This will be fixed once
  input-output-hk/cuddle#29
  is addressed.
- `distinct` is not currently possible to
  implement as a generic function, since `sized`
  is currently specialised to work on values.
  input-output-hk/cuddle#31
  addresses. Until this is fixed, distinct<bytes>
  is instead distinct_bytes.
- tstr is replaced with text. They are synonyms.
- The keys in the 'pool_params' and
  'script_n_of_k' groups are lost. This is due to
  input-output-hk/cuddle#32.
  However, since pool_params is included into an
  array, this does not alter the semantics, only
  the documentation.
- datum_hash is of type datum_hash, not hash32.
  This seems an overlooked item in the original
  cddl.
nc6 added a commit that referenced this pull request Jul 25, 2024
This is the final set of changes to the Conway
CDDL spec made via comparison with the original
cddl files for Conway.

As of this commit, the remaining changes with the
original cddl are as follows:

- Various fields in crypto were defined with /=
  and are now defined with =. This does not affect
  the semantics, being instead a convention as per
  https://datatracker.ietf.org/doc/html/rfc8610#section-3.9
- The index keys in auxiliary_data are written as
  if they were value and not type keys:
  ```
    39,43c30,34
      <                   / #6.259({? 0 : metadata
      <                             , ? 1 : [* native_script]
      <                             , ? 2 : [* plutus_v1_script]
      <                             , ? 3 : [* plutus_v2_script]
      <                             , ? 4 : [* plutus_v3_script]})
      ---
      >                   / #6.259({? 0 => metadata
      >                             , ? 1 => [* native_script]
      >                             , ? 2 => [* plutus_v1_script]
      >                             , ? 3 => [* plutus_v2_script]
      >                             , ? 4 => [* plutus_v3_script]})
  ```
  This is a simpler formulation with identical semantics.
- The alternatives in 'certificate', 'relay',
  'native_script' and 'gov_action' are encoded
  using type1 choice semantics ('/') rather than
  group choice semantics ('//'). In the context,
  this is an equivalent formulation.
- nonempty_oset has been removed, pending
  explanation of what it means. nonempty_set is
  used instead.
- In various places, null is replaced with nil.
  They are synonyms.
- The names of type parameters are changed;
  typically a is replaced with a0.
- A few rules using references as the bounds in
  ranges are now inlined. This will be fixed once
  input-output-hk/cuddle#29
  is addressed.
- `distinct` is not currently possible to
  implement as a generic function, since `sized`
  is currently specialised to work on values.
  input-output-hk/cuddle#31
  addresses. Until this is fixed, distinct<bytes>
  is instead distinct_bytes.
- tstr is replaced with text. They are synonyms.
- The keys in the 'pool_params' and
  'script_n_of_k' groups are lost. This is due to
  input-output-hk/cuddle#32.
  However, since pool_params is included into an
  array, this does not alter the semantics, only
  the documentation.
- datum_hash is of type datum_hash, not hash32.
  This seems an overlooked item in the original
  cddl.
Soupstraw pushed a commit that referenced this pull request Aug 1, 2024
This is the final set of changes to the Conway
CDDL spec made via comparison with the original
cddl files for Conway.

As of this commit, the remaining changes with the
original cddl are as follows:

- Various fields in crypto were defined with /=
  and are now defined with =. This does not affect
  the semantics, being instead a convention as per
  https://datatracker.ietf.org/doc/html/rfc8610#section-3.9
- The index keys in auxiliary_data are written as
  if they were value and not type keys:
  ```
    39,43c30,34
      <                   / #6.259({? 0 : metadata
      <                             , ? 1 : [* native_script]
      <                             , ? 2 : [* plutus_v1_script]
      <                             , ? 3 : [* plutus_v2_script]
      <                             , ? 4 : [* plutus_v3_script]})
      ---
      >                   / #6.259({? 0 => metadata
      >                             , ? 1 => [* native_script]
      >                             , ? 2 => [* plutus_v1_script]
      >                             , ? 3 => [* plutus_v2_script]
      >                             , ? 4 => [* plutus_v3_script]})
  ```
  This is a simpler formulation with identical semantics.
- The alternatives in 'certificate', 'relay',
  'native_script' and 'gov_action' are encoded
  using type1 choice semantics ('/') rather than
  group choice semantics ('//'). In the context,
  this is an equivalent formulation.
- nonempty_oset has been removed, pending
  explanation of what it means. nonempty_set is
  used instead.
- In various places, null is replaced with nil.
  They are synonyms.
- The names of type parameters are changed;
  typically a is replaced with a0.
- A few rules using references as the bounds in
  ranges are now inlined. This will be fixed once
  input-output-hk/cuddle#29
  is addressed.
- `distinct` is not currently possible to
  implement as a generic function, since `sized`
  is currently specialised to work on values.
  input-output-hk/cuddle#31
  addresses. Until this is fixed, distinct<bytes>
  is instead distinct_bytes.
- tstr is replaced with text. They are synonyms.
- The keys in the 'pool_params' and
  'script_n_of_k' groups are lost. This is due to
  input-output-hk/cuddle#32.
  However, since pool_params is included into an
  array, this does not alter the semantics, only
  the documentation.
- datum_hash is of type datum_hash, not hash32.
  This seems an overlooked item in the original
  cddl.
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