-
Notifications
You must be signed in to change notification settings - Fork 87
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
Update ledger one commit and resolve golden test failure #1899
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mrBliss
reviewed
Apr 3, 2020
ouroboros-consensus-byron/test/Test/Consensus/Byron/Ledger/Golden.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-byron/test/Test/Consensus/Byron/Ledger/Golden.hs
Outdated
Show resolved
Hide resolved
Comment on lines
3
to
4
{-# LANGUAGE TypeApplications #-} | ||
{-# LANGUAGE DataKinds #-} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you sort this list? Otherwise, stylish-haskell
will reorder it the next time we touch this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😞
nc6
approved these changes
Apr 3, 2020
intricate
reviewed
Apr 3, 2020
ouroboros-consensus-byron/test/Test/Consensus/Byron/Ledger/Golden.hs
Outdated
Show resolved
Hide resolved
The ledger patch 512c26a66a6a63278846646b81bf8eadcd4ae99c intoduced a change in the representation of one field in TxSizeLinear, to resolve an important bug with fee calculations. It did not change the CBOR representation of the TxSizeLinear, but it did change an example lovelace-per-byte fee value from (44 :: Lovelace) to (43.946 :: Rational). This example value is in the byron consensus golden tests so this of course changes the serialised reference values in the tests. It is slightly hard to see the change clearly because the TxSizeLinear gets double-serialised, so the change is -"\130\ESC\NUL\NUL\141QuOR\NUL\ESC\NUL\NUL\NUL\n>\154\184\NUL" +"\130\ESC\NUL\NUL\141QuOR\NUL\ESC\NUL\NUL\NUL\n;b\190\128" The difference without the double-serialisation is more instructive: -[TkListLen 2,TkInt 155381000000000,TkInt 44000000000] +[TkListLen 2,TkInt 155381000000000,TkInt 43946000000] This is then completely obvious given the change in the example from 44 to 43.946. Also added a specific golden test for the TxSizeLinear to make this all a bit clearer, to explain the magic bytes.
dcoutts
force-pushed
the
dcoutts/ledger-golden-fee-fix
branch
from
April 3, 2020 16:51
08e1262
to
fa62d29
Compare
bors merge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The ledger patch 512c26a66a6a63278846646b81bf8eadcd4ae99c introduced a change in the representation of one field in TxSizeLinear, to resolve an important bug with fee calculations.
It did not change the CBOR representation of the TxSizeLinear, but it did change an example lovelace-per-byte fee value from (44 :: Lovelace) to (43.946 :: Rational).
This example value is in the byron consensus golden tests so this of course changes the serialised reference values in the tests.
It is slightly hard to see the change clearly because the TxSizeLinear gets double-serialised, so the change is
The difference without the double-serialisation is more instructive:
This is then completely obvious given the change in the example from 44 to 43.946.
Also added a specific golden test for the TxSizeLinear to make this all a bit clearer, to explain the magic bytes.