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

remove subSlotCount function #2621

Merged
merged 1 commit into from Jan 24, 2022
Merged

remove subSlotCount function #2621

merged 1 commit into from Jan 24, 2022

Conversation

JaredCorduan
Copy link
Contributor

The subSlotCount function is dangerous and can be replaced by addSlotCount everywhere in the consensus and ledger repositories.

closes #1698

Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Overall looks great just couple of minor caveats

@JaredCorduan JaredCorduan force-pushed the jc/remove_subSlotCount branch 2 times, most recently from f94f601 to a091591 Compare January 20, 2022 21:03
@JaredCorduan
Copy link
Contributor Author

ha ha, fun failure :)

This function is dangerous and could be replaced by addSlotCount
everywhere in the consensus and ledger repositories.
addSlotCount sc fs
=== if unSlotNumber fs <= maxBound - (unSlotCount sc)
then added
else SlotNumber maxBound
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test feels pretty silly, it's the same logic as the function it is testing... and in general I feel like addSlotCount is only a bit less of a footgun than subSlotCount (the ordering on subSlotCount was pretty wacky).

@JaredCorduan JaredCorduan merged commit c8c588d into master Jan 24, 2022
@iohk-bors iohk-bors bot deleted the jc/remove_subSlotCount branch January 24, 2022 16:08
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.

RemovesubSlotCount
2 participants