Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const acceptedWorkflows = [
'.github/workflows/qa-txpool-performance-test.yml',
'.github/workflows/test-all-erigon-race.yml',
//'.github/workflows/test-all-erigon.yml',
//'.github/workflows/test-erigon-is-library.yml',
'.github/workflows/test-hive-eest.yml',
'.github/workflows/test-hive.yml',
'.github/workflows/test-integration-caplin.yml',
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/test-erigon-is-library.yml

This file was deleted.

3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ db-tools:
rm -rf vendor
@echo "Run \"$(GOBIN)/mdbx_stat -h\" to get info about mdbx db file."

test-erigon-ext:
@cd tests/erigon-ext-test && ./test.sh $(GIT_COMMIT)

## test-short: run short tests with a 10m timeout
test-short:
@{ \
Expand Down
61 changes: 51 additions & 10 deletions common/bitutil/compress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ package bitutil
import (
"bytes"
"errors"
"fmt"
"math/rand"
"testing"

"github.com/erigontech/erigon/common/hexutil"

"github.com/erigontech/erigon/common/log/v3"
)

Expand Down Expand Up @@ -54,19 +54,23 @@ func TestEncodingCycle(t *testing.T) {
"0xdf7070533534333636313639343638373532313536346c1bc333393438373130707063363430353639343638373532313536346c1bc333393438336336346c65fe",
}
for i, tt := range tests {
data := hexutil.MustDecode(tt)

proc, err := bitsetDecodeBytes(bitsetEncodeBytes(data), len(data))
if err != nil {
t.Errorf("test %d: failed to decompress compressed data: %v", i, err)
continue
}
if !bytes.Equal(data, proc) {
t.Errorf("test %d: compress/decompress mismatch: have %x, want %x", i, proc, data)
if err := testEncodingCycle(hexutil.MustDecode(tt)); err != nil {
t.Errorf("test %d: %v", i, err)
}
}
}

func testEncodingCycle(data []byte) error {
proc, err := bitsetDecodeBytes(bitsetEncodeBytes(data), len(data))
if err != nil {
return fmt.Errorf("failed to decompress compressed data: %v", err)
}
if !bytes.Equal(data, proc) {
return fmt.Errorf("compress/decompress mismatch: have %x, want %x", proc, data)
}
return nil
}

// Tests that data bitset decoding and rencoding works and is bijective.
func TestDecodingCycle(t *testing.T) {
tests := []struct {
Expand Down Expand Up @@ -189,3 +193,40 @@ func benchmarkEncoding(b *testing.B, bytes int, fill float64) {
}
}
}

func FuzzEncoder(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
if err := testEncodingCycle(data); err != nil {
t.Fatal(err)
}
})
}
func FuzzDecoder(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
fuzzDecode(data)
})
}

// fuzzDecode implements a go-fuzz fuzzer method to test the bit decoding and
// reencoding algorithm.
func fuzzDecode(data []byte) {
blob, err := DecompressBytes(data, 1024)
if err != nil {
return
}
// re-compress it (it's OK if the re-compressed differs from the
// original - the first input may not have been compressed at all)
comp := CompressBytes(blob)
if len(comp) > len(blob) {
// After compression, it must be smaller or equal
panic("bad compression")
}
// But decompressing it once again should work
decomp, err := DecompressBytes(data, 1024)
if err != nil {
panic(err)
}
if !bytes.Equal(decomp, blob) {
panic("content mismatch")
}
}
28 changes: 0 additions & 28 deletions common/crypto/bn254/LICENSE

This file was deleted.

25 changes: 0 additions & 25 deletions common/crypto/bn254/bn254_fast.go

This file was deleted.

23 changes: 0 additions & 23 deletions common/crypto/bn254/bn254_slow.go

This file was deleted.

27 changes: 0 additions & 27 deletions common/crypto/bn254/cloudflare/LICENSE

This file was deleted.

Loading
Loading