From b8a625f2c1326b3ed79727411c93e9ef0d09e8f9 Mon Sep 17 00:00:00 2001 From: Bowen Xue <93296844+bxue-l2@users.noreply.github.com> Date: Fri, 3 Jan 2025 13:25:20 -0800 Subject: [PATCH] fix: memstore returns data_length in number of symbols instead of bytes (#223) * make memstore return data_lenght in number of symbols * fix lint * lint --- store/generated_key/memstore/memstore.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/store/generated_key/memstore/memstore.go b/store/generated_key/memstore/memstore.go index 3707029d..dce04571 100644 --- a/store/generated_key/memstore/memstore.go +++ b/store/generated_key/memstore/memstore.go @@ -21,6 +21,7 @@ import ( const ( DefaultPruneInterval = 500 * time.Millisecond + BytesPerFieldElement = 32 ) type Config struct { @@ -168,7 +169,7 @@ func (e *MemStore) Put(_ context.Context, value []byte) ([]byte, error) { X: commitment.X.Marshal(), Y: commitment.Y.Marshal(), }, - DataLength: uint32(len(encodedVal)), // #nosec G115 + DataLength: uint32((len(encodedVal) + BytesPerFieldElement - 1) / BytesPerFieldElement), // #nosec G115 BlobQuorumParams: []*disperser.BlobQuorumParam{ { QuorumNumber: 1,