diff --git a/node/store/clock.go b/node/store/clock.go index dbc4347..9d20847 100644 --- a/node/store/clock.go +++ b/node/store/clock.go @@ -678,24 +678,6 @@ func (p *PebbleClockStore) fillAggregateProofs( frame.Filter, commit, frame.FrameNumber, - func(typeUrl string, data [][]byte) ([]byte, error) { - if typeUrl == protobufs.IntrinsicExecutionOutputType { - o := &protobufs.IntrinsicExecutionOutput{} - copiedLeft := make([]byte, len(data[0])) - copiedRight := make([]byte, len(data[1])) - copy(copiedLeft, data[0]) - copy(copiedRight, data[1]) - - o.Address = copiedLeft[:32] - o.Output = copiedLeft[32:] - o.Proof = copiedRight - return proto.Marshal(o) - } - - copied := make([]byte, len(data[0])) - copy(copied, data[0]) - return copied, nil - }, ) if err != nil { return err diff --git a/node/store/data_proof.go b/node/store/data_proof.go index 0952fc2..3b93133 100644 --- a/node/store/data_proof.go +++ b/node/store/data_proof.go @@ -7,6 +7,7 @@ import ( "github.com/pkg/errors" "go.uber.org/zap" "golang.org/x/crypto/sha3" + "google.golang.org/protobuf/proto" "source.quilibrium.com/quilibrium/monorepo/node/protobufs" ) @@ -89,7 +90,6 @@ func internalGetAggregateProof( filter []byte, commitment []byte, frameNumber uint64, - inclusionReassembler func(typeUrl string, data [][]byte) ([]byte, error), ) (*protobufs.InclusionAggregateProof, error) { value, closer, err := db.Get(dataProofMetadataKey(filter, commitment)) if err != nil { @@ -169,9 +169,24 @@ func internalGetAggregateProof( } } - inclusionCommitment.Data, err = inclusionReassembler(string(url), chunks) - if err != nil { - return nil, errors.Wrap(err, "get aggregate proof") + if string(url) == protobufs.IntrinsicExecutionOutputType { + o := &protobufs.IntrinsicExecutionOutput{} + copiedLeft := make([]byte, len(chunks[0])) + copiedRight := make([]byte, len(chunks[1])) + copy(copiedLeft, chunks[0]) + copy(copiedRight, chunks[1]) + + o.Address = copiedLeft[:32] + o.Output = copiedLeft[32:] + o.Proof = copiedRight + inclusionCommitment.Data, err = proto.Marshal(o) + if err != nil { + return nil, errors.Wrap(err, "get aggregate proof") + } + } else { + copied := make([]byte, len(chunks[0])) + copy(copied, chunks[0]) + inclusionCommitment.Data = copied } aggregate.InclusionCommitments = append( @@ -192,14 +207,12 @@ func (p *PebbleDataProofStore) GetAggregateProof( filter []byte, commitment []byte, frameNumber uint64, - inclusionReassembler func(typeUrl string, data [][]byte) ([]byte, error), ) (*protobufs.InclusionAggregateProof, error) { return internalGetAggregateProof( p.db, filter, commitment, frameNumber, - inclusionReassembler, ) }