Skip to content

Commit

Permalink
Save
Browse files Browse the repository at this point in the history
  • Loading branch information
zivkovicmilos committed Sep 27, 2024
1 parent ea6d19a commit 38a446c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 162 deletions.
25 changes: 0 additions & 25 deletions tm2/pkg/p2p/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ type P2PConfig struct {
// Testing params.
// Force dial to fail
TestDialFail bool `json:"test_dial_fail" toml:"test_dial_fail"`
// FUzz connection
TestFuzz bool `json:"test_fuzz" toml:"test_fuzz"`
TestFuzzConfig *FuzzConnConfig `json:"test_fuzz_config" toml:"test_fuzz_config"`
}

// DefaultP2PConfig returns a default configuration for the peer-to-peer layer
Expand All @@ -99,8 +96,6 @@ func DefaultP2PConfig() *P2PConfig {
HandshakeTimeout: 20 * time.Second,
DialTimeout: 3 * time.Second,
TestDialFail: false,
TestFuzz: false,
TestFuzzConfig: DefaultFuzzConnConfig(),
}
}

Expand Down Expand Up @@ -136,23 +131,3 @@ func (cfg *P2PConfig) ValidateBasic() error {
}
return nil
}

// FuzzConnConfig is a FuzzedConnection configuration.
type FuzzConnConfig struct {
Mode int
MaxDelay time.Duration
ProbDropRW float64
ProbDropConn float64
ProbSleep float64
}

// DefaultFuzzConnConfig returns the default config.
func DefaultFuzzConnConfig() *FuzzConnConfig {
return &FuzzConnConfig{
Mode: FuzzModeDrop,
MaxDelay: 3 * time.Second,
ProbDropRW: 0.2,
ProbDropConn: 0.00,
ProbSleep: 0.00,
}
}
131 changes: 0 additions & 131 deletions tm2/pkg/p2p/fuzz.go

This file was deleted.

6 changes: 0 additions & 6 deletions tm2/pkg/p2p/test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,6 @@ func testPeerConn(
) (pc peerConn, err error) {
conn := rawConn

// Fuzz connection
if cfg.TestFuzz {
// so we have time to do peer handshakes and get set up
conn = FuzzConnAfterFromConfig(conn, 10*time.Second, cfg.TestFuzzConfig)
}

// Encrypt connection
conn, err = upgradeSecretConn(conn, cfg.HandshakeTimeout, ourNodePrivKey)
if err != nil {
Expand Down

0 comments on commit 38a446c

Please sign in to comment.