[4/N][zero serialization] Add fallback to the encoder client when it cannot tell chunk encoding format #738
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.
Why are these changes needed?
We need the batcher to fallback to Gob chunk encoding, when chunks returned from Encoder do not have encoding format specified.
The reason is this case:
So the Encoder will produce Gob chunks, and when Batcher tries to find out the format, it'll get ChunkEncodingFormat_UNKNOWN. So this shouldn't be treated as an error; instead, it should be treated as Gob.
Compatibility/correctness reasoning
Let's denote the versions of Encoder as:
ENCODER_ENABLE_GNARK_CHUNK_ENCODING
asfalse
ENCODER_ENABLE_GNARK_CHUNK_ENCODING
astrue
And versions of Bather as:
BATCHER_ENABLE_GNARK_CHUNK_ENCODING
asfalse
BATCHER_ENABLE_GNARK_CHUNK_ENCODING
astrue
The reasoning and testing of the compatibility of 9 combinations:
ChunkEncodingFormat_UNKNOWN
, but correctly falls back to Gobeigenda/disperser/batcher/grpc/dispatcher.go
Line 368 in cacdc21
chunk_encoding_format
set as GOB in the response; the Batcher doesn't care aboutchunk_encoding_format
and just get the chunks and treat them as Gob, which is correctchunk_encoding_format
to Dispatcher, which will send chunk to Node as it iseigenda/disperser/batcher/grpc/dispatcher.go
Line 368 in cacdc21
ENCODER_ENABLE_GNARK_CHUNK_ENCODING
astrue
chunk_encoding_format
set to GNARK; and then Batcher will understand it's GNARK, but it'll convert them from GNARK to GOB on the fly before sending to Node, ateigenda/disperser/batcher/grpc/dispatcher.go
Line 393 in cacdc21
Testing
All of the above combinations tested in preprod.
Checks