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

Guard against overflows in Shelley TxIns #4956

Merged
merged 1 commit into from
Mar 29, 2023
Merged

Conversation

newhoggy
Copy link
Contributor

@newhoggy newhoggy commented Mar 8, 2023

makeByronTransactionBody guard against overflows in the transaction indices, but makeShelleyTransactionBody does not.

Add appropriate guards to makeShelleyTransactionBody.

Supersedes #3478

- makeByronTransactionBody guards against overflows in the transaction indices,
but makeShelleyTransactionBody does not.
- Add appropriate guards to makeShelleyTransactionBody.
Copy link
Contributor

@erikd erikd left a comment

Choose a reason for hiding this comment

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

Seems legit

Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

LGTM, but why not just change TxIx to newtype TxIx = TxIx Word16?

@newhoggy
Copy link
Contributor Author

LGTM, but why not just change TxIx to newtype TxIx = TxIx Word16?

Shelley bounds TxIx to Word16:

https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/TxBody.hs/#L2570

But Byron bounds TxIx to Word32:

https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/TxBody.hs#L3288

I believe changing the type would mean a change in behaviour for Byron.

@newhoggy newhoggy added this pull request to the merge queue Mar 29, 2023
Merged via the queue into master with commit 0ac69d4 Mar 29, 2023
@iohk-bors iohk-bors bot deleted the sevanspowell/txin-overflow branch March 29, 2023 00:42
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.

4 participants