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
1 change: 0 additions & 1 deletion apps/grpc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ require (
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions apps/grpc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,6 @@ github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8Ie
github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
Expand Down
1 change: 0 additions & 1 deletion apps/testapp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ require (
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions apps/testapp/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,6 @@ github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8Ie
github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
Expand Down
3 changes: 2 additions & 1 deletion block/internal/syncing/assert.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package syncing

import (
"bytes"
"errors"
"fmt"

Expand All @@ -9,7 +10,7 @@ import (
)

func assertExpectedProposer(genesis genesis.Genesis, proposerAddr []byte) error {
if string(proposerAddr) != string(genesis.ProposerAddress) {
if !bytes.Equal(proposerAddr, genesis.ProposerAddress) {
return fmt.Errorf("unexpected proposer: got %x, expected %x",
proposerAddr, genesis.ProposerAddress)
}
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
github.com/evstack/ev-node/core v1.0.0
github.com/filecoin-project/go-jsonrpc v0.10.1
github.com/go-kit/kit v0.13.0
github.com/go-viper/mapstructure/v2 v2.4.0
github.com/goccy/go-yaml v1.19.2
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/hashicorp/raft v1.7.3
Expand All @@ -24,7 +25,6 @@ require (
github.com/libp2p/go-libp2p v0.47.0
github.com/libp2p/go-libp2p-kad-dht v0.38.0
github.com/libp2p/go-libp2p-pubsub v0.15.0
github.com/mitchellh/mapstructure v1.5.0
github.com/multiformats/go-multiaddr v0.16.1
github.com/prometheus/client_golang v1.23.2
github.com/rs/zerolog v1.34.0
Expand Down Expand Up @@ -64,7 +64,6 @@ require (
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/google/flatbuffers v25.1.24+incompatible // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8Rv
github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/celestiaorg/go-square/v3/share"
"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
Expand Down
104 changes: 104 additions & 0 deletions types/serialization_fuzz_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
package types

import (
"testing"

"google.golang.org/protobuf/proto"

pb "github.com/evstack/ev-node/types/pb/evnode/v1"
)

func FuzzHeaderUnmarshalBinary(f *testing.F) {
// Seed with a valid marshalled header
h := Header{}
h.BaseHeader.Height = 1
h.BaseHeader.ChainID = "test"
h.BaseHeader.Time = 1000
if data, err := h.MarshalBinary(); err == nil {
f.Add(data)
}
f.Add([]byte{})
f.Add([]byte{0xff, 0xff, 0xff})

f.Fuzz(func(t *testing.T, data []byte) {
var h Header
if err := h.UnmarshalBinary(data); err != nil {
return
}
// Round-trip: if unmarshal succeeds, marshal should not panic
_, _ = h.MarshalBinary()
})
}

func FuzzDataUnmarshalBinary(f *testing.F) {
d := Data{Txs: Txs{[]byte("tx1"), []byte("tx2")}}
if data, err := d.MarshalBinary(); err == nil {
f.Add(data)
}
f.Add([]byte{})

f.Fuzz(func(t *testing.T, data []byte) {
var d Data
if err := d.UnmarshalBinary(data); err != nil {
return
}
_, _ = d.MarshalBinary()
})
}

func FuzzSignedHeaderUnmarshalBinary(f *testing.F) {
f.Add([]byte{})
f.Add([]byte{0x0a, 0x00})

f.Fuzz(func(t *testing.T, data []byte) {
var sh SignedHeader
if err := sh.UnmarshalBinary(data); err != nil {
return
}
_, _ = sh.MarshalBinary()
})
}

func FuzzSignedDataUnmarshalBinary(f *testing.F) {
f.Add([]byte{})
f.Add([]byte{0x0a, 0x00})

f.Fuzz(func(t *testing.T, data []byte) {
var sd SignedData
if err := sd.UnmarshalBinary(data); err != nil {
return
}
_, _ = sd.MarshalBinary()
})
}

func FuzzDAEnvelopeUnmarshalBinary(f *testing.F) {
f.Add([]byte{})

f.Fuzz(func(t *testing.T, data []byte) {
var sh SignedHeader
if _, err := sh.UnmarshalDAEnvelope(data); err != nil {
return
}
_, _ = sh.MarshalDAEnvelope(nil)
})
}

func FuzzStateFromProto(f *testing.F) {
s := State{ChainID: "test", LastBlockHeight: 1}
if p, err := s.ToProto(); err == nil {
if data, err := proto.Marshal(p); err == nil {
f.Add(data)
}
}
f.Add([]byte{})

f.Fuzz(func(t *testing.T, data []byte) {
var ps pb.State
if err := proto.Unmarshal(data, &ps); err != nil {
return
}
var s State
_ = s.FromProto(&ps)
})
}
Loading