mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-26 00:25:17 +00:00
v1.2.10 (#55)
This commit is contained in:
parent
c96a3b7538
commit
f8726882de
@ -678,24 +678,6 @@ func (p *PebbleClockStore) fillAggregateProofs(
|
|||||||
frame.Filter,
|
frame.Filter,
|
||||||
commit,
|
commit,
|
||||||
frame.FrameNumber,
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"golang.org/x/crypto/sha3"
|
"golang.org/x/crypto/sha3"
|
||||||
|
"google.golang.org/protobuf/proto"
|
||||||
"source.quilibrium.com/quilibrium/monorepo/node/protobufs"
|
"source.quilibrium.com/quilibrium/monorepo/node/protobufs"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -89,7 +90,6 @@ func internalGetAggregateProof(
|
|||||||
filter []byte,
|
filter []byte,
|
||||||
commitment []byte,
|
commitment []byte,
|
||||||
frameNumber uint64,
|
frameNumber uint64,
|
||||||
inclusionReassembler func(typeUrl string, data [][]byte) ([]byte, error),
|
|
||||||
) (*protobufs.InclusionAggregateProof, error) {
|
) (*protobufs.InclusionAggregateProof, error) {
|
||||||
value, closer, err := db.Get(dataProofMetadataKey(filter, commitment))
|
value, closer, err := db.Get(dataProofMetadataKey(filter, commitment))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -169,10 +169,25 @@ func internalGetAggregateProof(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inclusionCommitment.Data, err = inclusionReassembler(string(url), chunks)
|
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 {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "get aggregate proof")
|
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(
|
aggregate.InclusionCommitments = append(
|
||||||
aggregate.InclusionCommitments,
|
aggregate.InclusionCommitments,
|
||||||
@ -192,14 +207,12 @@ func (p *PebbleDataProofStore) GetAggregateProof(
|
|||||||
filter []byte,
|
filter []byte,
|
||||||
commitment []byte,
|
commitment []byte,
|
||||||
frameNumber uint64,
|
frameNumber uint64,
|
||||||
inclusionReassembler func(typeUrl string, data [][]byte) ([]byte, error),
|
|
||||||
) (*protobufs.InclusionAggregateProof, error) {
|
) (*protobufs.InclusionAggregateProof, error) {
|
||||||
return internalGetAggregateProof(
|
return internalGetAggregateProof(
|
||||||
p.db,
|
p.db,
|
||||||
filter,
|
filter,
|
||||||
commitment,
|
commitment,
|
||||||
frameNumber,
|
frameNumber,
|
||||||
inclusionReassembler,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user