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.
This is an experiment to provide
runAnnotatedPeer
, which is likerunPeer' but allows us to run a decoder which has access to bytes used when decoding a message. This allows one to record ByteString from which a piece of data was decoded, e.g. for each
txinside
MsgReplyTxs`.The
Codec
type intyped-protocols
was generalised for this purpose. The core functionality is implemented inrunAnnotatedDecoderWithChannel
which runsAnnotatedCodec
against aChannel
which does incremental decoding & recording bytes used so far. We also exposerunAnnotatedPeer
which runs aPeer
againstChannel
using anAnnotatedCodec
(usingannotatedDriverSimple
).TODO:
runAnnotatedPeerWithLimits
runAnnotatedPipelinedPeerWithLimits
It's actually the last one that we will need in
tx-submission
.and generalise
codecTxSubmission2
so that it can be used to used with annotator and without it - it might require two separate function, but I think it can be generated from one more general function (so we don't need to maintain two codecs).TODO: design & implement quickcheck properties
Description
reasonably detailed description of the pull request
Checklist
Quality
Maintenance
ouroboros-network
project.