Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MSFDG): adapt AttackV2 and StepV2 functions in op-challenger2 #94

Closed
wants to merge 21 commits into from

Conversation

JustXxx
Copy link

@JustXxx JustXxx commented Nov 23, 2024

Description

Adapt AttackV2 and StepV2 functions in op-challenger2

Tests

  • Tests passed in this PR:
go test -run ^TestCalculateNextActions$ github.com/ethereum-optimism/optimism/op-challenger2/game/fault/solver
go test -run ^TestCalculateNextActions_ChallengeL2BlockNumber$ github.com/ethereum-optimism/optimism/op-challenger2/game/fault/solver
go test -run ^TestMultipleRoundsWithNbits1$ github.com/ethereum-optimism/optimism/op-challenger2/game/fault/solver
go test -run ^TestMultipleRoundsWithNbits2$ github.com/ethereum-optimism/optimism/op-challenger2/game/fault/solver
  • Tests in op-challengers all passed
cd op-challenger2
go test ./...

@JustXxx JustXxx requested review from qizhou and dajuguan November 23, 2024 15:19
op-challenger2/game/fault/agent.go Show resolved Hide resolved
op-challenger2/game/fault/solver/game_solver.go Outdated Show resolved Hide resolved
op-challenger2/game/fault/solver/game_solver_test.go Outdated Show resolved Hide resolved
@@ -208,7 +202,7 @@ func detectFailedStep(game types.Game, action types.Action, correctTrace types.T
if err != nil {
return fmt.Errorf("failed to get correct trace at position %v: %w", poststateClaim.Position, err)
}
validStep := correctValue == poststateClaim.Value
validStep := correctValue == (*poststateClaim.SubValues)[0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If poststateClaim is attacked by the non-0 branch, it might not be (*poststateClaim.SubValues)[0]

op-challenger2/game/fault/solver/solver.go Show resolved Hide resolved

preState, proofData, oracleData, err := s.trace.GetStepData(ctx, game, claim, position)
if branch == game.MaxAttackBranch()-1 {
// If we are at the max attack branch, we need to step on the next branch

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we agree subValues in [0, maxAttackBranch-1], the max attack branch should be stepped. might be more clear?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find this code. Has it been modified?

op-challenger2/game/fault/solver/solver.go Outdated Show resolved Hide resolved
op-challenger2/game/fault/test/claim_builder.go Outdated Show resolved Hide resolved
@dajuguan
Copy link

Deprecated in #105

@dajuguan dajuguan closed this Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants