Skip to content

Commit

Permalink
remove dbug stmts
Browse files Browse the repository at this point in the history
  • Loading branch information
epociask committed Sep 9, 2024
1 parent 042a7bc commit 8799b62
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 50 deletions.
2 changes: 1 addition & 1 deletion cmd/replay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ func main() {
if dasEnabled {
// DAS batch and keysets are all together in the same preimage binary.
dasReader = &PreimageDASReader{}
dasKeysetFetcher = &PreimageDASReader{}
} else if eigenDAEnabled {
eigenDAReader = &EigenDAPreimageReader{}
dasKeysetFetcher = &PreimageDASReader{}
}
backend := WavmInbox{}
var keysetValidationMode = daprovider.KeysetPanicIfInvalid
Expand Down
91 changes: 46 additions & 45 deletions staker/challenge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/offchainlabs/nitro/solgen/go/mocksgen"
"github.com/offchainlabs/nitro/solgen/go/ospgen"
"github.com/offchainlabs/nitro/validator"
"github.com/offchainlabs/nitro/validator/server_arb"
)

Expand Down Expand Up @@ -255,48 +256,48 @@ func createBaseMachine(t *testing.T, wasmname string, wasmModules []string) *ser
return machine
}

// func TestChallengeToOSP(t *testing.T) {
// machine := createBaseMachine(t, "global-state.wasm", []string{"global-state-wrapper.wasm"})
// IncorrectMachine := server_arb.NewIncorrectMachine(machine, 200)
// runChallengeTest(t, machine, IncorrectMachine, false, false, 0)
// }

// func TestChallengeToFailedOSP(t *testing.T) {
// machine := createBaseMachine(t, "global-state.wasm", []string{"global-state-wrapper.wasm"})
// IncorrectMachine := server_arb.NewIncorrectMachine(machine, 200)
// runChallengeTest(t, machine, IncorrectMachine, true, false, 0)
// }

// func TestChallengeToErroredOSP(t *testing.T) {
// machine := createBaseMachine(t, "const.wasm", nil)
// IncorrectMachine := server_arb.NewIncorrectMachine(machine, 10)
// runChallengeTest(t, machine, IncorrectMachine, false, false, 0)
// }

// func TestChallengeToFailedErroredOSP(t *testing.T) {
// machine := createBaseMachine(t, "const.wasm", nil)
// IncorrectMachine := server_arb.NewIncorrectMachine(machine, 10)
// runChallengeTest(t, machine, IncorrectMachine, true, false, 0)
// }

// func TestChallengeToTimeout(t *testing.T) {
// machine := createBaseMachine(t, "global-state.wasm", []string{"global-state-wrapper.wasm"})
// IncorrectMachine := server_arb.NewIncorrectMachine(machine, 200)
// runChallengeTest(t, machine, IncorrectMachine, false, true, 0)
// }

// func TestChallengeToTooFar(t *testing.T) {
// machine := createBaseMachine(t, "read-inboxmsg-10.wasm", []string{"global-state-wrapper.wasm"})
// Require(t, machine.SetGlobalState(validator.GoGlobalState{PosInBatch: 10}))
// incorrectMachine := machine.Clone()
// Require(t, incorrectMachine.AddSequencerInboxMessage(10, []byte{0, 1, 2, 3}))
// runChallengeTest(t, machine, incorrectMachine, false, false, 9)
// }

// func TestChallengeToFailedTooFar(t *testing.T) {
// machine := createBaseMachine(t, "read-inboxmsg-10.wasm", []string{"global-state-wrapper.wasm"})
// Require(t, machine.SetGlobalState(validator.GoGlobalState{PosInBatch: 10}))
// incorrectMachine := machine.Clone()
// Require(t, machine.AddSequencerInboxMessage(10, []byte{0, 1, 2, 3}))
// runChallengeTest(t, machine, incorrectMachine, true, false, 11)
// }
func TestChallengeToOSP(t *testing.T) {
machine := createBaseMachine(t, "global-state.wasm", []string{"global-state-wrapper.wasm"})
IncorrectMachine := server_arb.NewIncorrectMachine(machine, 200)
runChallengeTest(t, machine, IncorrectMachine, false, false, 0)
}

func TestChallengeToFailedOSP(t *testing.T) {
machine := createBaseMachine(t, "global-state.wasm", []string{"global-state-wrapper.wasm"})
IncorrectMachine := server_arb.NewIncorrectMachine(machine, 200)
runChallengeTest(t, machine, IncorrectMachine, true, false, 0)
}

func TestChallengeToErroredOSP(t *testing.T) {
machine := createBaseMachine(t, "const.wasm", nil)
IncorrectMachine := server_arb.NewIncorrectMachine(machine, 10)
runChallengeTest(t, machine, IncorrectMachine, false, false, 0)
}

func TestChallengeToFailedErroredOSP(t *testing.T) {
machine := createBaseMachine(t, "const.wasm", nil)
IncorrectMachine := server_arb.NewIncorrectMachine(machine, 10)
runChallengeTest(t, machine, IncorrectMachine, true, false, 0)
}

func TestChallengeToTimeout(t *testing.T) {
machine := createBaseMachine(t, "global-state.wasm", []string{"global-state-wrapper.wasm"})
IncorrectMachine := server_arb.NewIncorrectMachine(machine, 200)
runChallengeTest(t, machine, IncorrectMachine, false, true, 0)
}

func TestChallengeToTooFar(t *testing.T) {
machine := createBaseMachine(t, "read-inboxmsg-10.wasm", []string{"global-state-wrapper.wasm"})
Require(t, machine.SetGlobalState(validator.GoGlobalState{PosInBatch: 10}))
incorrectMachine := machine.Clone()
Require(t, incorrectMachine.AddSequencerInboxMessage(10, []byte{0, 1, 2, 3}))
runChallengeTest(t, machine, incorrectMachine, false, false, 9)
}

func TestChallengeToFailedTooFar(t *testing.T) {
machine := createBaseMachine(t, "read-inboxmsg-10.wasm", []string{"global-state-wrapper.wasm"})
Require(t, machine.SetGlobalState(validator.GoGlobalState{PosInBatch: 10}))
incorrectMachine := machine.Clone()
Require(t, machine.AddSequencerInboxMessage(10, []byte{0, 1, 2, 3}))
runChallengeTest(t, machine, incorrectMachine, true, false, 11)
}
3 changes: 0 additions & 3 deletions system_tests/full_challenge_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,6 @@ func RunChallengeTest(t *testing.T, asserterIsCorrect bool, useStubs bool, chall
}
}

t.Log("WASM MODULE ROOT:", wasmModuleRoot.Hex())

asserterGenesis := asserterExec.ArbInterface.BlockChain().Genesis()
challengerGenesis := challengerExec.ArbInterface.BlockChain().Genesis()
if asserterGenesis.Hash() != challengerGenesis.Hash() {
Expand All @@ -509,7 +507,6 @@ func RunChallengeTest(t *testing.T, asserterIsCorrect bool, useStubs bool, chall
}
numBlocks := asserterLatestBlock.Number.Uint64() - asserterGenesis.NumberU64()

println("CREATING CHALLENGE")
resultReceiver, challengeManagerAddr := CreateChallenge(
t,
ctx,
Expand Down
1 change: 0 additions & 1 deletion system_tests/full_challenge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ func TestChallengeManagerFullAsserterIncorrect(t *testing.T) {
RunChallengeTest(t, false, false, makeBatch_MsgsPerBatch+1, true, defaultWasmRootDir)
}


func TestChallengeManagerFullAsserterIncorrectWithPublishedMachine(t *testing.T) {
t.Parallel()
cr, err := github.LatestConsensusRelease(context.Background())
Expand Down
Empty file removed txt
Empty file.

0 comments on commit 8799b62

Please sign in to comment.