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
31 changes: 18 additions & 13 deletions internal/orchestration/orchestration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

func TestOrchestration(t *testing.T) {
run := func(consensusImpl string, crypto string, mods []string) {
run := func(consensusImpl string, crypto string, mods []string, byzantine string) {
controllerStream, workerStream := net.Pipe()

workerProxy := orchestration.NewRemoteWorker(protostream.NewWriter(controllerStream), protostream.NewReader(controllerStream))
Expand All @@ -50,6 +50,7 @@ func TestOrchestration(t *testing.T) {
Crypto: crypto,
LeaderRotation: "round-robin",
Modules: mods,
ByzantineStrategy: byzantine,
},
Duration: 5 * time.Second,
Hosts: map[string]orchestration.RemoteWorker{"127.0.0.1": workerProxy},
Expand All @@ -71,21 +72,25 @@ func TestOrchestration(t *testing.T) {
}
}

t.Run("ChainedHotStuff+ECDSA", func(t *testing.T) { run("chainedhotstuff", "ecdsa", nil) })
t.Run("ChainedHotStuff+BLS12", func(t *testing.T) { run("chainedhotstuff", "bls12", nil) })
t.Run("Fast-HotStuff+ECDSA", func(t *testing.T) { run("fasthotstuff", "ecdsa", nil) })
t.Run("Fast-HotStuff+BLS12", func(t *testing.T) { run("fasthotstuff", "bls12", nil) })
t.Run("Simple-HotStuff+ECDSA", func(t *testing.T) { run("simplehotstuff", "ecdsa", nil) })
t.Run("Simple-HotStuff+BLS12", func(t *testing.T) { run("simplehotstuff", "bls12", nil) })
t.Run("ChainedHotStuff+ECDSA", func(t *testing.T) { run("chainedhotstuff", "ecdsa", nil, "") })
t.Run("ChainedHotStuff+BLS12", func(t *testing.T) { run("chainedhotstuff", "bls12", nil, "") })
t.Run("Fast-HotStuff+ECDSA", func(t *testing.T) { run("fasthotstuff", "ecdsa", nil, "") })
t.Run("Fast-HotStuff+BLS12", func(t *testing.T) { run("fasthotstuff", "bls12", nil, "") })
t.Run("Simple-HotStuff+ECDSA", func(t *testing.T) { run("simplehotstuff", "ecdsa", nil, "") })
t.Run("Simple-HotStuff+BLS12", func(t *testing.T) { run("simplehotstuff", "bls12", nil, "") })

// handel
mods := []string{"handel"}
t.Run("ChainedHotStuff+ECDSA+Handel", func(t *testing.T) { run("chainedhotstuff", "ecdsa", mods) })
t.Run("ChainedHotStuff+BLS12+Handel", func(t *testing.T) { run("chainedhotstuff", "bls12", mods) })
t.Run("Fast-HotStuff+ECDSA+Handel", func(t *testing.T) { run("fasthotstuff", "ecdsa", mods) })
t.Run("Fast-HotStuff+BLS12+Handel", func(t *testing.T) { run("fasthotstuff", "bls12", mods) })
t.Run("Simple-HotStuff+ECDSA+Handel", func(t *testing.T) { run("simplehotstuff", "ecdsa", mods) })
t.Run("Simple-HotStuff+BLS12+Handel", func(t *testing.T) { run("simplehotstuff", "bls12", mods) })
t.Run("ChainedHotStuff+ECDSA+Handel", func(t *testing.T) { run("chainedhotstuff", "ecdsa", mods, "") })
t.Run("ChainedHotStuff+BLS12+Handel", func(t *testing.T) { run("chainedhotstuff", "bls12", mods, "") })
t.Run("Fast-HotStuff+ECDSA+Handel", func(t *testing.T) { run("fasthotstuff", "ecdsa", mods, "") })
t.Run("Fast-HotStuff+BLS12+Handel", func(t *testing.T) { run("fasthotstuff", "bls12", mods, "") })
t.Run("Simple-HotStuff+ECDSA+Handel", func(t *testing.T) { run("simplehotstuff", "ecdsa", mods, "") })
t.Run("Simple-HotStuff+BLS12+Handel", func(t *testing.T) { run("simplehotstuff", "bls12", mods, "") })

// byzantine
t.Run("ChainedHotStuff+Fork", func(t *testing.T) { run("chainedhotstuff", "ecdsa", nil, "fork:1") })
t.Run("ChainedHotStuff+Silence", func(t *testing.T) { run("chainedhotstuff", "ecdsa", nil, "silence:1") })
}

func TestDeployment(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions synchronizer/synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ func New(viewDuration ViewDuration) modules.Synchronizer {
}

func (s *Synchronizer) startTimeoutTimer() {
view := s.View()
s.timer = time.AfterFunc(s.duration.Duration(), func() {
// The event loop will execute onLocalTimeout for us.
s.eventLoop.AddEvent(TimeoutEvent{view})
s.eventLoop.AddEvent(TimeoutEvent{s.View()})
})
}

Expand Down