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

Multi-Era expanded functionality + Shelley Metadata set fix #272

Merged
merged 3 commits into from
Nov 14, 2023

Conversation

rooooooooob
Copy link
Contributor

@rooooooooob rooooooooob commented Oct 27, 2023

All multi-era functionality besides some Byron-specific stuff should be exposed. e.g now the blocks can have the tx bodies/metadata/witnesses inspected and tx bodies can have all their fields inspected through era-agnostic wrappers. WASM wrappers are also provided.

ShelleyBlock's metadataset was not wrapped in the tx index map for some reason. This still passed the deserialization tests since this still ended up being able to parse the metadata as the metadatum label map/tx index map are the same and then the inner label was also valid regular metadata by itself. After the fix mainnet shelley was retested just in case and there were no issues.

All multi-era functionality besides updates/governance should now be
exposed. e.g now the blocks can have the tx bodies/metadata/witnesses
inspected and tx bodies can have all their fields (bar update/gov)
inspected through era-agnostic wrappers. WASM wrappers are also
provided.

ShelleyBlock's metadataset was not wrapped in the tx index map for some
reason. This still passed the deserialization tests since this still
ended up being able to parse the metadata as the metadatum label map/tx
index map are the same and then the inner label was also valid regular
metadata by itself. After the fix mainnet shelley was retested just in
case and there were no issues.
@rooooooooob rooooooooob requested a review from gostkin October 27, 2023 01:38
}
}

pub fn slot(&self) -> Option<u64> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want to do something for Byron? I'm not sure how the transition went there. IIRC it used to be like 22600 or something slots per epoch, and the slots reset but I don't really know/remember. Should we calculate it like that? Or is that only on mainnet that it was that number? Or should we just only have this work on shelley-onward blocks?

Copy link
Contributor

Choose a reason for hiding this comment

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

need to check

@gostkin
Copy link
Contributor

gostkin commented Nov 7, 2023

just in case is there a way to iterate through e.g. all tx inputs or outputs without parsing each block type?

@gostkin
Copy link
Contributor

gostkin commented Nov 7, 2023

would be good to have numeric era rep as well, wdyt?

@rooooooooob
Copy link
Contributor Author

would be good to have numeric era rep as well, wdyt?

Do you mean like the one corresponding to what pallas gives like 6 for babbage, 5 for alonzo, etc?

just in case is there a way to iterate through e.g. all tx inputs or outputs without parsing each block type?

I'm not sure if I understand. Like parsing only part of the CBOR bytes? You'd need to parse everything before it to know when they start as otherwise you wouldn't know how many bytes to skip. You'd be able to skip parsing the witnesses in the blocks since the tx bodies come before that. It would be pretty mess though.

@gostkin
Copy link
Contributor

gostkin commented Nov 10, 2023

would be good to have numeric era rep as well, wdyt?

Do you mean like the one corresponding to what pallas gives like 6 for babbage, 5 for alonzo, etc?

yes

@rooooooooob
Copy link
Contributor Author

You would only be able to get that info if you parsed it from that specific format. It's impossible to know otherwise since it's not stored anywhere in the actual block CBOR. Are you recommending storing it as an Option and only returning it for when it was parsed from the pallas bytes and returning None otherwise? Otherwise I could make it check the format and return it based just on that but then you'd have it reporting Shelley - 2 for Alonzo / Mary / Allegra blocks, or Babbage - 6 for Conway whenever they're backwards compatible.

@gostkin gostkin merged commit 3f7888f into develop Nov 14, 2023
1 check passed
@rooooooooob rooooooooob deleted the multi-era-tx branch July 18, 2024 18:12
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