Open
Description
Is your feature request related to a problem? Please describe.
- Block decoding is so inefficient that doing something like this actually notably improve era import/export.
int sequenceLength = decoderContext.ReadSequenceLength();
if (!decoderContext.ShouldSliceMemory)
{
byte[] memory = new byte[sequenceLength];
decoderContext = new Rlp.ValueDecoderContext(memory, sliceMemory: true);
}
int blockCheck = decoderContext.Position + sequenceLength;
Describe the solution you'd like
- There should be a class that completely skip decoding the tx's which as far as sync and era/import is concern only need to be re-hashed to calculate tx root.
- This class should use pooled memory and implement
IDisposable
and replaceOwnedBlockBodies
. - Additionally, serving/downloading probably could be better done by using the bodies's byte array directly.
- Note:
BlockStore
currently storeBlock
, notBlockBody
, although it should be relatively easy to decode just the body.
Describe alternatives you've considered
- Do nothing.
Additional context
- Era import although local is actually slightly slower than downloading on a fast internet.