Skip to content

Commit

Permalink
fix: Commitment decoding bug && svr handler tests - rm false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
EthenNotEthan committed Sep 5, 2024
1 parent b278c5e commit 3c0cada
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions store/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ func (e *MemStore) Put(_ context.Context, value []byte) ([]byte, error) {
mockBatchRoot := crypto.Keccak256Hash(entropy)
blockNum, _ := rand.Int(rand.Reader, big.NewInt(1000))

num := uint32(blockNum.Uint64())
num := uint32(blockNum.Uint64()) // #nosec G115

cert := &verify.Certificate{
BlobHeader: &disperser.BlobHeader{
Commitment: &common.G1Commitment{
X: commitment.X.Marshal(),
Y: commitment.Y.Marshal(),
},
DataLength: uint32(len(encodedVal)),
DataLength: uint32(len(encodedVal)), // #nosec G115
BlobQuorumParams: []*disperser.BlobQuorumParam{
{
QuorumNumber: 1,
Expand Down
2 changes: 1 addition & 1 deletion verify/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (cv *CertVerifier) getContextBlock() (*big.Int, error) {
}

blockNumber = new(big.Int)
blockNumber.Sub(blockHeader.Number(), big.NewInt(int64(cv.ethConfirmationDepth-1)))
blockNumber.Sub(blockHeader.Number(), big.NewInt(int64(cv.ethConfirmationDepth-1))) // #nosec G115

return blockNumber, nil
}
6 changes: 3 additions & 3 deletions verify/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ func (c *Certificate) ReadBlobHeader() BlobHeader {
qps := make([]QuorumBlobParam, len(c.BlobHeader.BlobQuorumParams))
for i, qp := range c.BlobHeader.BlobQuorumParams {
qps[i] = QuorumBlobParam{
QuorumNumber: uint8(qp.QuorumNumber),
AdversaryThresholdPercentage: uint8(qp.AdversaryThresholdPercentage),
ConfirmationThresholdPercentage: uint8(qp.ConfirmationThresholdPercentage),
QuorumNumber: uint8(qp.QuorumNumber), // #nosec G115
AdversaryThresholdPercentage: uint8(qp.AdversaryThresholdPercentage), // #nosec G115
ConfirmationThresholdPercentage: uint8(qp.ConfirmationThresholdPercentage), // #nosec G115
ChunkLength: qp.ChunkLength,
}
}
Expand Down

0 comments on commit 3c0cada

Please sign in to comment.