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

Improve nodeBlockFetchSize estimates and test them #2481

Merged
merged 1 commit into from
Jul 30, 2020

Conversation

mrBliss
Copy link
Contributor

@mrBliss mrBliss commented Jul 30, 2020

Fixes #2480.

Return the block size instead of the body size for Shelley.

Take CBOR-in-CBOR and the EBB tag into account for Byron.

Include a test in the serialisation roundtrip test skeleton.

@mrBliss mrBliss added the consensus issues related to ouroboros-consensus label Jul 30, 2020
@mrBliss mrBliss requested a review from edsko July 30, 2020 11:28
@mrBliss mrBliss force-pushed the mrBliss/fix-shelley-nodeblockfetchsize branch from 9ac12d9 to abac6e5 Compare July 30, 2020 11:50
@mrBliss
Copy link
Contributor Author

mrBliss commented Jul 30, 2020

bors merge

iohk-bors bot added a commit that referenced this pull request Jul 30, 2020
2481: Improve nodeBlockFetchSize estimates and test them r=mrBliss a=mrBliss

Fixes #2480.

Return the block size instead of the body size for Shelley.

Take CBOR-in-CBOR and the EBB tag into account for Byron.

Include a test in the serialisation roundtrip test skeleton.

Co-authored-by: Thomas Winant <thomas@well-typed.com>
@mrBliss mrBliss force-pushed the mrBliss/fix-shelley-nodeblockfetchsize branch from abac6e5 to e9ee584 Compare July 30, 2020 13:18
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 30, 2020

Canceled

Comment on lines +117 to +127
instance (SimpleCrypto c, Serialise ext') => Serialise (SimpleBlock' c ext ext') where
encode (SimpleBlock hdr body) = mconcat [
CBOR.encodeListLen 2
, encode hdr
, encode body
]
decode = do
CBOR.decodeListLenOf 2
hdr <- decode
body <- decode
return (SimpleBlock hdr body)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went for this instead of the generic instance so it's easier to estimate the size of the block.

@mrBliss
Copy link
Contributor Author

mrBliss commented Jul 30, 2020

bors merge

iohk-bors bot added a commit that referenced this pull request Jul 30, 2020
2481: Improve nodeBlockFetchSize estimates and test them r=mrBliss a=mrBliss

Fixes #2480.

Return the block size instead of the body size for Shelley.

Take CBOR-in-CBOR and the EBB tag into account for Byron.

Include a test in the serialisation roundtrip test skeleton.

Co-authored-by: Thomas Winant <thomas@well-typed.com>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 30, 2020

Build failed

@mrBliss mrBliss force-pushed the mrBliss/fix-shelley-nodeblockfetchsize branch from e9ee584 to 4c096d6 Compare July 30, 2020 13:43
@mrBliss
Copy link
Contributor Author

mrBliss commented Jul 30, 2020

bors merge

iohk-bors bot added a commit that referenced this pull request Jul 30, 2020
2481: Improve nodeBlockFetchSize estimates and test them r=mrBliss a=mrBliss

Fixes #2480.

Return the block size instead of the body size for Shelley.

Take CBOR-in-CBOR and the EBB tag into account for Byron.

Include a test in the serialisation roundtrip test skeleton.

Co-authored-by: Thomas Winant <thomas@well-typed.com>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 30, 2020

Build failed

Fixes #2480.

Return the block size instead of the body size for Shelley.

Take CBOR-in-CBOR and the EBB tag into account for Byron.

Include a test in the serialisation roundtrip test skeleton.
@mrBliss mrBliss force-pushed the mrBliss/fix-shelley-nodeblockfetchsize branch from 4c096d6 to ae0170a Compare July 30, 2020 14:07
@mrBliss
Copy link
Contributor Author

mrBliss commented Jul 30, 2020

(Yes, I'm using CI to run my testsuites. I compiled locally with -O0 which is too slow to run all the tests.)

@mrBliss
Copy link
Contributor Author

mrBliss commented Jul 30, 2020

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 30, 2020

@iohk-bors iohk-bors bot merged commit 1e40ad1 into master Jul 30, 2020
@iohk-bors iohk-bors bot deleted the mrBliss/fix-shelley-nodeblockfetchsize branch July 30, 2020 14:51
mrBliss added a commit that referenced this pull request Jul 31, 2020
Apparently we sometimes generate blocks that are 65536 bytes large or more,
requiring a 7 byte CBOR-in-CBOR tag (65535 would only require 5 bytes), failing
the test added in #2481, as our upper bound assumed 5 bytes.
mrBliss added a commit that referenced this pull request Jul 31, 2020
Apparently we sometimes generate blocks that are 65536 bytes large or more,
requiring a 7 byte CBOR-in-CBOR tag (65535 would only require 5 bytes), failing
the test added in #2481, as our upper bound assumed 5 bytes.
iohk-bors bot added a commit that referenced this pull request Jul 31, 2020
2484: Upper bound for CBOR-in-CBOR tag is 7 instead of 5 bytes r=mrBliss a=mrBliss

Apparently we sometimes generate blocks that are 65536 bytes large or more,
requiring a 7 byte CBOR-in-CBOR tag (65535 would only require 5 bytes), failing
the test added in #2481, as our upper bound assumed 5 bytes.

Co-authored-by: Thomas Winant <thomas@well-typed.com>
nc6 pushed a commit that referenced this pull request Aug 3, 2020
Apparently we sometimes generate blocks that are 65536 bytes large or more,
requiring a 7 byte CBOR-in-CBOR tag (65535 would only require 5 bytes), failing
the test added in #2481, as our upper bound assumed 5 bytes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus issues related to ouroboros-consensus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shelley: incorrect nodeBlockFetchSize
2 participants