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

Add a CoinbaseData field, replacing Vec<u8>. #259

Merged
merged 1 commit into from
Feb 19, 2020
Merged

Conversation

hdevalence
Copy link
Contributor

The CoinbaseData field can only be constructed by the transaction parser, so we
can ensure that a coinbase input is always serializable, as CoinbaseData
instances can't be constructed outside of the parser that maintains the data
size invariant.

@hdevalence
Copy link
Contributor Author

Together with #240, closes #236.

pub struct CoinbaseData(
/// Invariant: this vec, together with the coinbase height, must be less than
/// 100 bytes. We enforce this by only constructing CoinbaseData fields by
/// parsing blocks with 100-byte data fields. When we implement block
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@dconnolly
Copy link
Contributor

image

@hdevalence
Copy link
Contributor Author

oops, that's on me for just running cargo check

The CoinbaseData field can only be constructed by the transaction parser, so we
can ensure that a coinbase input is always serializable, as CoinbaseData
instances can't be constructed outside of the parser that maintains the data
size invariant.
@hdevalence
Copy link
Contributor Author

fixed & amended

@dconnolly dconnolly merged commit 2d2603c into main Feb 19, 2020
@dconnolly dconnolly deleted the coinbase-data-type branch February 19, 2020 20:42
@dconnolly dconnolly added this to the Validate transactions. milestone Feb 19, 2020
skyl added a commit to skyl/zebra that referenced this pull request Sep 25, 2024
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