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

ByronBlock / MultiEraBlock explicit era tag #317

Open
rooooooooob opened this issue Mar 7, 2024 · 1 comment
Open

ByronBlock / MultiEraBlock explicit era tag #317

rooooooooob opened this issue Mar 7, 2024 · 1 comment

Comments

@rooooooooob
Copy link
Contributor

In Byron the era tag wrapping struct is explicitly a part of the CDDL:

byron_block = [
     ; @name ebb_wrapper
     tag: 0, block: byron_eb_block //
     ; @name main_block_wrapper
     tag: 1, block: byron_main_block
]

For all the other eras there is no mention at all of this outer wrapping struct e.g. Conway (all other eras are similar):

block =
  [ header
  , transaction_bodies         : [* transaction_body]
  , transaction_witness_sets   : [* transaction_witness_set]
  , auxiliary_data_set         : {* transaction_index => auxiliary_data }
  , invalid_transactions       : [* transaction_index ]
  ]

When we retrieve blocks from oura/cardano-net-fetcher we get even these blocks with explicit era tags as if it were:

conway_block = [7, block]

One approach in order to respect the CDDL it could make sense to keep the tag info in the byron blocks but not touch them in the other eras, and then in MultiEraBlock do the check as if it were defined like:

multi_era_block =
    byron_block            ; @name byron
  / [2, shelley_block]     ; @name Shelley
  / [3, allegra_block]     ; @name Allegra
  / [4, mary_block]        ; @name Mary
  / [5, alonzo_block]      ; @name Alonzo
  / [6, babbage_block]     ; @name Babbage
  / [7, block]             ; @name Conway

or similar.

We currently have MultiEraBlock::from_explicit_network_cbor_bytes() to parse using this era tag struct.

rooooooooob added a commit that referenced this issue Mar 7, 2024
Update the function to handle Byron EBBs.

We still need to figure out what to do in the general deserialize case #317 or if that behavior should just merge this function in there.
@SebastienGllmt
Copy link
Contributor

When we retrieve blocks from oura/cardano-net-fetcher we get even these blocks with explicit era tags as if it were:

As a reminder, the Cardano network specification has a separate CDDL definition from the ledger specification and CML currently doesn't contain any codegen from the networking spec. I'm not sure the networking cddl is a particularly good state (I've never heard good things about it)

rooooooooob added a commit that referenced this issue Mar 11, 2024
Update the function to handle Byron EBBs.

We still need to figure out what to do in the general deserialize case #317 or if that behavior should just merge this function in there.
SebastienGllmt pushed a commit that referenced this issue Mar 11, 2024
* MultiEraBlock::from_explicit_network_cbor_bytes EBB

Update the function to handle Byron EBBs.

We still need to figure out what to do in the general deserialize case #317 or if that behavior should just merge this function in there.

* Add comment for MultiEraBlock::hash()
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

No branches or pull requests

2 participants