You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dataBinaryInfoblob=BinaryInfo{binaryBlob::!blob
, headerOffset::!Word16--^ The offset within the 'binaryBlob' at which the header starts.
, headerSize::!Word16--^ How many bytes the header is long. Extracting the 'headerSize' bytes-- from 'binaryBlob' starting from 'headerOffset' should yield the header.-- In the future, i.e. Shelley, we might want to extend this to include a-- field to tell where the transaction body ends and where the transaction-- witnesses begin so we can only extract the transaction body.}
but that feels wrong: there is no way that a Functor instance could preserve any kind of internal invariants of this type, and even if this isn't true in general, I suspect even for specific use cases of fmap those invariants are very unlikely to be preserved.
The text was updated successfully, but these errors were encountered:
2187: Decouple BinaryInfo from the block encoder r=edsko a=mrBliss
Closes#2145.
Split
nodeEncodeBlockWithInfo :: CodecConfig blk -> blk -> BinaryInfo Encoding
Up into
nodeGetBinaryBlockInfo :: blk -> BinaryBlockInfo
nodeEncodeBlock :: CodecConfig blk -> blk -> Encoding
where `BinaryBlockInfo` is the former `BinaryInfo` without its `blob`
argument. This also means `Binary(Block)Info` is no longer a functor, closing
issue #2145.
The reason both were coupled is that we thought that the information would be
computed during encoding, making it more efficient to do both at the same
time. However, for all real ledgers, we use annotations, making it cheap to
compute the `BinaryBlockInfo` without any real encoding work to be done.
Splitting them up will make later refactorings of the encoders/decoders
easier.
Co-authored-by: Thomas Winant <thomas@well-typed.com>
Co-authored-by: Edsko de Vries <edsko@well-typed.com>
At the moment we have
but that feels wrong: there is no way that a
Functor
instance could preserve any kind of internal invariants of this type, and even if this isn't true in general, I suspect even for specific use cases offmap
those invariants are very unlikely to be preserved.The text was updated successfully, but these errors were encountered: