Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
40bf36a5
Commit
40bf36a5
authored
Nov 20, 2023
by
Adrian Sutton
Committed by
refcell
Nov 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-challenger: Change local context to be a hash and use reorg safe calculation.
parent
8b234577
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
111 additions
and
35 deletions
+111
-35
faultdisputegame.go
op-challenger/game/fault/contracts/faultdisputegame.go
+1
-1
faultdisputegame_test.go
op-challenger/game/fault/contracts/faultdisputegame_test.go
+2
-2
register.go
op-challenger/game/fault/register.go
+1
-1
responder_test.go
op-challenger/game/fault/responder/responder_test.go
+1
-1
alphabet.go
op-challenger/game/fault/test/alphabet.go
+1
-1
provider.go
op-challenger/game/fault/trace/cannon/provider.go
+3
-7
provider_test.go
op-challenger/game/fault/trace/cannon/provider_test.go
+1
-1
output_cannon.go
op-challenger/game/fault/trace/outputs/output_cannon.go
+2
-1
split_adapter.go
op-challenger/game/fault/trace/outputs/split_adapter.go
+23
-7
split_adapter_test.go
op-challenger/game/fault/trace/outputs/split_adapter_test.go
+64
-7
types.go
op-challenger/game/fault/types/types.go
+6
-2
types_test.go
op-challenger/game/fault/types/types_test.go
+3
-2
cannon_helper.go
op-e2e/e2eutils/disputegame/cannon_helper.go
+2
-1
helper.go
op-e2e/e2eutils/disputegame/helper.go
+1
-1
No files found.
op-challenger/game/fault/contracts/faultdisputegame.go
View file @
40bf36a5
...
...
@@ -232,7 +232,7 @@ func (f *FaultDisputeGameContract) addLocalDataTx(data *types.PreimageOracleData
call
:=
f
.
contract
.
Call
(
methodAddLocalData
,
data
.
GetIdent
(),
new
(
big
.
Int
)
.
Set
Uint64
(
data
.
LocalContext
),
new
(
big
.
Int
)
.
Set
Bytes
(
data
.
LocalContext
.
Bytes
()
),
new
(
big
.
Int
)
.
SetUint64
(
uint64
(
data
.
OracleOffset
)),
)
return
call
.
ToTxCandidate
()
...
...
op-challenger/game/fault/contracts/faultdisputegame_test.go
View file @
40bf36a5
...
...
@@ -253,14 +253,14 @@ func TestUpdateOracleTx(t *testing.T) {
stubRpc
,
game
:=
setup
(
t
)
data
:=
&
faultTypes
.
PreimageOracleData
{
IsLocal
:
true
,
LocalContext
:
2
,
LocalContext
:
common
.
Hash
{
0x02
}
,
OracleKey
:
common
.
Hash
{
0xbc
}
.
Bytes
(),
OracleData
:
[]
byte
{
1
,
2
,
3
,
4
,
5
,
6
,
7
},
OracleOffset
:
16
,
}
stubRpc
.
SetResponse
(
fdgAddr
,
methodAddLocalData
,
batching
.
BlockLatest
,
[]
interface
{}{
data
.
GetIdent
(),
new
(
big
.
Int
)
.
Set
Uint64
(
data
.
LocalContext
),
new
(
big
.
Int
)
.
Set
Bytes
(
data
.
LocalContext
.
Bytes
()
),
new
(
big
.
Int
)
.
SetUint64
(
uint64
(
data
.
OracleOffset
)),
},
nil
)
tx
,
err
:=
game
.
UpdateOracleTx
(
context
.
Background
(),
data
)
...
...
op-challenger/game/fault/register.go
View file @
40bf36a5
...
...
@@ -91,7 +91,7 @@ func registerCannon(
client
*
ethclient
.
Client
)
{
resourceCreator
:=
func
(
addr
common
.
Address
,
contract
*
contracts
.
FaultDisputeGameContract
,
gameDepth
uint64
,
dir
string
)
(
faultTypes
.
TraceAccessor
,
gameValidator
,
error
)
{
logger
:=
logger
.
New
(
"game"
,
addr
)
provider
,
err
:=
cannon
.
NewTraceProvider
(
ctx
,
logger
,
m
,
cfg
,
contract
,
cannon
.
NoLocalContext
,
dir
,
gameDepth
)
provider
,
err
:=
cannon
.
NewTraceProvider
(
ctx
,
logger
,
m
,
cfg
,
contract
,
faultTypes
.
NoLocalContext
,
dir
,
gameDepth
)
if
err
!=
nil
{
return
nil
,
nil
,
fmt
.
Errorf
(
"create cannon trace provider: %w"
,
err
)
}
...
...
op-challenger/game/fault/responder/responder_test.go
View file @
40bf36a5
...
...
@@ -180,7 +180,7 @@ func TestPerformAction(t *testing.T) {
ProofData
:
[]
byte
{
4
,
5
,
6
},
OracleData
:
&
types
.
PreimageOracleData
{
IsLocal
:
true
,
LocalContext
:
6
,
LocalContext
:
common
.
Hash
{
0x06
}
,
},
}
err
:=
responder
.
PerformAction
(
context
.
Background
(),
action
)
...
...
op-challenger/game/fault/test/alphabet.go
View file @
40bf36a5
...
...
@@ -33,6 +33,6 @@ func (a *alphabetWithProofProvider) GetStepData(ctx context.Context, i types.Pos
return
nil
,
nil
,
nil
,
err
}
traceIndex
:=
i
.
TraceIndex
(
int
(
a
.
depth
))
.
Uint64
()
data
:=
types
.
NewPreimageOracleData
(
0
,
[]
byte
{
byte
(
traceIndex
)},
[]
byte
{
byte
(
traceIndex
-
1
)},
uint32
(
traceIndex
-
1
))
data
:=
types
.
NewPreimageOracleData
(
types
.
NoLocalContext
,
[]
byte
{
byte
(
traceIndex
)},
[]
byte
{
byte
(
traceIndex
-
1
)},
uint32
(
traceIndex
-
1
))
return
preimage
,
[]
byte
{
byte
(
traceIndex
-
1
)},
data
,
nil
}
op-challenger/game/fault/trace/cannon/provider.go
View file @
40bf36a5
...
...
@@ -23,10 +23,6 @@ import (
const
(
proofsDir
=
"proofs"
diskStateCache
=
"state.json.gz"
// NoLocalContext is the LocalContext value used when the cannon trace provider is used alone instead of as part
// of a split game.
NoLocalContext
=
0
)
type
proofData
struct
{
...
...
@@ -53,14 +49,14 @@ type CannonTraceProvider struct {
prestate
string
generator
ProofGenerator
gameDepth
uint64
localContext
uint64
localContext
common
.
Hash
// lastStep stores the last step in the actual trace if known. 0 indicates unknown.
// Cached as an optimisation to avoid repeatedly attempting to execute beyond the end of the trace.
lastStep
uint64
}
func
NewTraceProvider
(
ctx
context
.
Context
,
logger
log
.
Logger
,
m
CannonMetricer
,
cfg
*
config
.
Config
,
gameContract
*
contracts
.
FaultDisputeGameContract
,
localContext
uint64
,
dir
string
,
gameDepth
uint64
)
(
*
CannonTraceProvider
,
error
)
{
func
NewTraceProvider
(
ctx
context
.
Context
,
logger
log
.
Logger
,
m
CannonMetricer
,
cfg
*
config
.
Config
,
gameContract
*
contracts
.
FaultDisputeGameContract
,
localContext
common
.
Hash
,
dir
string
,
gameDepth
uint64
)
(
*
CannonTraceProvider
,
error
)
{
l2Client
,
err
:=
ethclient
.
DialContext
(
ctx
,
cfg
.
CannonL2
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"dial l2 client %v: %w"
,
cfg
.
CannonL2
,
err
)
...
...
@@ -73,7 +69,7 @@ func NewTraceProvider(ctx context.Context, logger log.Logger, m CannonMetricer,
return
NewTraceProviderFromInputs
(
logger
,
m
,
cfg
,
localContext
,
localInputs
,
dir
,
gameDepth
),
nil
}
func
NewTraceProviderFromInputs
(
logger
log
.
Logger
,
m
CannonMetricer
,
cfg
*
config
.
Config
,
localContext
uint64
,
localInputs
LocalGameInputs
,
dir
string
,
gameDepth
uint64
)
*
CannonTraceProvider
{
func
NewTraceProviderFromInputs
(
logger
log
.
Logger
,
m
CannonMetricer
,
cfg
*
config
.
Config
,
localContext
common
.
Hash
,
localInputs
LocalGameInputs
,
dir
string
,
gameDepth
uint64
)
*
CannonTraceProvider
{
return
&
CannonTraceProvider
{
logger
:
logger
,
dir
:
dir
,
...
...
op-challenger/game/fault/trace/cannon/provider_test.go
View file @
40bf36a5
...
...
@@ -124,7 +124,7 @@ func TestGetStepData(t *testing.T) {
require
.
EqualValues
(
t
,
generator
.
proof
.
StateData
,
preimage
)
require
.
EqualValues
(
t
,
generator
.
proof
.
ProofData
,
proof
)
expectedData
:=
types
.
NewPreimageOracleData
(
0
,
generator
.
proof
.
OracleKey
,
generator
.
proof
.
OracleValue
,
generator
.
proof
.
OracleOffset
)
expectedData
:=
types
.
NewPreimageOracleData
(
common
.
Hash
{}
,
generator
.
proof
.
OracleKey
,
generator
.
proof
.
OracleValue
,
generator
.
proof
.
OracleOffset
)
require
.
EqualValues
(
t
,
expectedData
,
data
)
})
...
...
op-challenger/game/fault/trace/outputs/output_cannon.go
View file @
40bf36a5
...
...
@@ -8,6 +8,7 @@ import (
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/split"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
)
...
...
@@ -18,7 +19,7 @@ func NewOutputCannonTraceAccessor(ctx context.Context, logger log.Logger, rollup
return
nil
,
err
}
cannonCreator
:=
func
(
ctx
context
.
Context
,
localContext
uint64
,
agreed
contracts
.
Proposal
,
claimed
contracts
.
Proposal
)
(
types
.
TraceProvider
,
error
)
{
cannonCreator
:=
func
(
ctx
context
.
Context
,
localContext
common
.
Hash
,
agreed
contracts
.
Proposal
,
claimed
contracts
.
Proposal
)
(
types
.
TraceProvider
,
error
)
{
// TODO(client-pod#43): Actually create the cannon trace provider for the trace between the given claims.
return
nil
,
errors
.
New
(
"not implemented"
)
}
...
...
op-challenger/game/fault/trace/outputs/split_adapter.go
View file @
40bf36a5
...
...
@@ -3,24 +3,21 @@ package outputs
import
(
"context"
"fmt"
"math"
"math/big"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/contracts"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/split"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
type
ProposalTraceProviderCreator
func
(
ctx
context
.
Context
,
localContext
uint64
,
agreed
contracts
.
Proposal
,
claimed
contracts
.
Proposal
)
(
types
.
TraceProvider
,
error
)
type
ProposalTraceProviderCreator
func
(
ctx
context
.
Context
,
localContext
common
.
Hash
,
agreed
contracts
.
Proposal
,
claimed
contracts
.
Proposal
)
(
types
.
TraceProvider
,
error
)
func
OutputRootSplitAdapter
(
topProvider
*
OutputTraceProvider
,
creator
ProposalTraceProviderCreator
)
split
.
ProviderCreator
{
return
func
(
ctx
context
.
Context
,
pre
types
.
Claim
,
post
types
.
Claim
)
(
types
.
TraceProvider
,
error
)
{
localContext
:=
createLocalContext
(
pre
,
post
)
usePrestateBlock
:=
pre
==
(
types
.
Claim
{})
preContractIndex
:=
pre
.
ContractIndex
if
usePrestateBlock
{
preContractIndex
=
math
.
MaxUint32
}
localContext
:=
uint64
(
preContractIndex
)
<<
32
+
uint64
(
post
.
ContractIndex
)
var
agreed
contracts
.
Proposal
if
usePrestateBlock
{
prestateRoot
,
err
:=
topProvider
.
AbsolutePreStateCommitment
(
ctx
)
...
...
@@ -53,3 +50,22 @@ func OutputRootSplitAdapter(topProvider *OutputTraceProvider, creator ProposalTr
return
creator
(
ctx
,
localContext
,
agreed
,
claimed
)
}
}
func
createLocalContext
(
pre
types
.
Claim
,
post
types
.
Claim
)
common
.
Hash
{
return
crypto
.
Keccak256Hash
(
localContextPreimage
(
pre
,
post
))
}
func
localContextPreimage
(
pre
types
.
Claim
,
post
types
.
Claim
)
[]
byte
{
encodeClaim
:=
func
(
c
types
.
Claim
)
[]
byte
{
data
:=
make
([]
byte
,
64
)
copy
(
data
[
0
:
32
],
c
.
Value
.
Bytes
())
c
.
Position
.
ToGIndex
()
.
FillBytes
(
data
[
32
:
])
return
data
}
var
data
[]
byte
if
pre
!=
(
types
.
Claim
{})
{
data
=
encodeClaim
(
pre
)
}
data
=
append
(
data
,
encodeClaim
(
post
)
...
)
return
data
}
op-challenger/game/fault/trace/outputs/split_adapter_test.go
View file @
40bf36a5
...
...
@@ -3,6 +3,7 @@ package outputs
import
(
"context"
"errors"
"math"
"math/big"
"testing"
...
...
@@ -12,6 +13,7 @@ import (
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
)
...
...
@@ -71,7 +73,6 @@ func TestOutputRootSplitAdapter(t *testing.T) {
ParentContractIndex
:
1
,
}
expectedLocalContext
:=
uint64
(
0x300000007
)
expectedAgreed
:=
contracts
.
Proposal
{
L2BlockNumber
:
big
.
NewInt
(
test
.
expectedAgreedBlockNum
),
OutputRoot
:
preClaim
.
Value
,
...
...
@@ -83,7 +84,7 @@ func TestOutputRootSplitAdapter(t *testing.T) {
_
,
err
:=
adapter
(
context
.
Background
(),
preClaim
,
postClaim
)
require
.
ErrorIs
(
t
,
err
,
creatorError
)
require
.
Equal
(
t
,
expectedLocalContext
,
creator
.
localContext
)
require
.
Equal
(
t
,
createLocalContext
(
preClaim
,
postClaim
)
,
creator
.
localContext
)
require
.
Equal
(
t
,
expectedAgreed
,
creator
.
agreed
)
require
.
Equal
(
t
,
expectedClaimed
,
creator
.
claimed
)
})
...
...
@@ -103,8 +104,6 @@ func TestOutputRootSplitAdapter_FromAbsolutePrestate(t *testing.T) {
ParentContractIndex
:
1
,
}
// Use MaxUint32 for the pre-state block contract index.
expectedLocalContext
:=
uint64
(
0xffffffff00000007
)
expectedAgreed
:=
contracts
.
Proposal
{
L2BlockNumber
:
big
.
NewInt
(
20
),
OutputRoot
:
prestateOutputRoot
,
// Absolute prestate output root
...
...
@@ -116,7 +115,7 @@ func TestOutputRootSplitAdapter_FromAbsolutePrestate(t *testing.T) {
_
,
err
:=
adapter
(
context
.
Background
(),
types
.
Claim
{},
postClaim
)
require
.
ErrorIs
(
t
,
err
,
creatorError
)
require
.
Equal
(
t
,
expectedLocalContext
,
creator
.
localContext
)
require
.
Equal
(
t
,
createLocalContext
(
types
.
Claim
{},
postClaim
)
,
creator
.
localContext
)
require
.
Equal
(
t
,
expectedAgreed
,
creator
.
agreed
)
require
.
Equal
(
t
,
expectedClaimed
,
creator
.
claimed
)
}
...
...
@@ -138,14 +137,72 @@ func setupAdapterTest(t *testing.T, topDepth int) (split.ProviderCreator, *captu
}
type
capturingCreator
struct
{
localContext
uint64
localContext
common
.
Hash
agreed
contracts
.
Proposal
claimed
contracts
.
Proposal
}
func
(
c
*
capturingCreator
)
Create
(
_
context
.
Context
,
localContext
uint64
,
agreed
contracts
.
Proposal
,
claimed
contracts
.
Proposal
)
(
types
.
TraceProvider
,
error
)
{
func
(
c
*
capturingCreator
)
Create
(
_
context
.
Context
,
localContext
common
.
Hash
,
agreed
contracts
.
Proposal
,
claimed
contracts
.
Proposal
)
(
types
.
TraceProvider
,
error
)
{
c
.
localContext
=
localContext
c
.
agreed
=
agreed
c
.
claimed
=
claimed
return
nil
,
creatorError
}
func
TestCreateLocalContext
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
name
string
preValue
common
.
Hash
prePosition
types
.
Position
postValue
common
.
Hash
postPosition
types
.
Position
expected
[]
byte
}{
{
name
:
"PreAndPost"
,
preValue
:
common
.
HexToHash
(
"abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789"
),
prePosition
:
types
.
NewPositionFromGIndex
(
big
.
NewInt
(
2
)),
postValue
:
common
.
HexToHash
(
"cc00000000000000000000000000000000000000000000000000000000000000"
),
postPosition
:
types
.
NewPositionFromGIndex
(
big
.
NewInt
(
3
)),
expected
:
common
.
Hex2Bytes
(
"abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567890000000000000000000000000000000000000000000000000000000000000002cc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003"
),
},
{
name
:
"LargePositions"
,
preValue
:
common
.
HexToHash
(
"abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789"
),
prePosition
:
types
.
NewPositionFromGIndex
(
new
(
big
.
Int
)
.
SetBytes
(
common
.
Hex2Bytes
(
"cbcdef0123456789abcdef0123456789abcdef0123456789abcdef012345678c"
))),
postValue
:
common
.
HexToHash
(
"dd00000000000000000000000000000000000000000000000000000000000000"
),
postPosition
:
types
.
NewPositionFromGIndex
(
new
(
big
.
Int
)
.
SetUint64
(
math
.
MaxUint64
)),
expected
:
common
.
Hex2Bytes
(
"abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789cbcdef0123456789abcdef0123456789abcdef0123456789abcdef012345678cdd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff"
),
},
{
name
:
"AbsolutePreState"
,
preValue
:
common
.
Hash
{},
prePosition
:
types
.
Position
{},
postValue
:
common
.
HexToHash
(
"cc00000000000000000000000000000000000000000000000000000000000000"
),
postPosition
:
types
.
NewPositionFromGIndex
(
big
.
NewInt
(
3
)),
expected
:
common
.
Hex2Bytes
(
"cc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003"
),
},
}
for
_
,
test
:=
range
tests
{
test
:=
test
t
.
Run
(
test
.
name
,
func
(
t
*
testing
.
T
)
{
pre
:=
types
.
Claim
{
ClaimData
:
types
.
ClaimData
{
Value
:
test
.
preValue
,
Position
:
test
.
prePosition
,
},
}
post
:=
types
.
Claim
{
ClaimData
:
types
.
ClaimData
{
Value
:
test
.
postValue
,
Position
:
test
.
postPosition
,
},
}
actualPreimage
:=
localContextPreimage
(
pre
,
post
)
require
.
Equal
(
t
,
test
.
expected
,
actualPreimage
)
localContext
:=
createLocalContext
(
pre
,
post
)
require
.
Equal
(
t
,
crypto
.
Keccak256Hash
(
test
.
expected
),
localContext
)
})
}
}
op-challenger/game/fault/types/types.go
View file @
40bf36a5
...
...
@@ -10,13 +10,17 @@ import (
var
(
ErrGameDepthReached
=
errors
.
New
(
"game depth reached"
)
// NoLocalContext is the LocalContext value used when the cannon trace provider is used alone instead of as part
// of a split game.
NoLocalContext
=
common
.
Hash
{}
)
// PreimageOracleData encapsulates the preimage oracle data
// to load into the onchain oracle.
type
PreimageOracleData
struct
{
IsLocal
bool
LocalContext
uint64
LocalContext
common
.
Hash
OracleKey
[]
byte
OracleData
[]
byte
OracleOffset
uint32
...
...
@@ -33,7 +37,7 @@ func (p *PreimageOracleData) GetPreimageWithoutSize() []byte {
}
// NewPreimageOracleData creates a new [PreimageOracleData] instance.
func
NewPreimageOracleData
(
lctx
uint64
,
key
[]
byte
,
data
[]
byte
,
offset
uint32
)
*
PreimageOracleData
{
func
NewPreimageOracleData
(
lctx
common
.
Hash
,
key
[]
byte
,
data
[]
byte
,
offset
uint32
)
*
PreimageOracleData
{
return
&
PreimageOracleData
{
IsLocal
:
len
(
key
)
>
0
&&
key
[
0
]
==
byte
(
1
),
LocalContext
:
lctx
,
...
...
op-challenger/game/fault/types/types_test.go
View file @
40bf36a5
...
...
@@ -4,12 +4,13 @@ import (
"math/big"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
)
func
TestNewPreimageOracleData
(
t
*
testing
.
T
)
{
t
.
Run
(
"LocalData"
,
func
(
t
*
testing
.
T
)
{
data
:=
NewPreimageOracleData
(
1
,
[]
byte
{
1
,
2
,
3
},
[]
byte
{
4
,
5
,
6
},
7
)
data
:=
NewPreimageOracleData
(
common
.
Hash
{
0x01
}
,
[]
byte
{
1
,
2
,
3
},
[]
byte
{
4
,
5
,
6
},
7
)
require
.
True
(
t
,
data
.
IsLocal
)
require
.
Equal
(
t
,
uint64
(
1
),
data
.
LocalContext
)
require
.
Equal
(
t
,
[]
byte
{
1
,
2
,
3
},
data
.
OracleKey
)
...
...
@@ -18,7 +19,7 @@ func TestNewPreimageOracleData(t *testing.T) {
})
t
.
Run
(
"GlobalData"
,
func
(
t
*
testing
.
T
)
{
data
:=
NewPreimageOracleData
(
1
,
[]
byte
{
0
,
2
,
3
},
[]
byte
{
4
,
5
,
6
},
7
)
data
:=
NewPreimageOracleData
(
common
.
Hash
{
0x01
}
,
[]
byte
{
0
,
2
,
3
},
[]
byte
{
4
,
5
,
6
},
7
)
require
.
False
(
t
,
data
.
IsLocal
)
require
.
Equal
(
t
,
uint64
(
1
),
data
.
LocalContext
)
require
.
Equal
(
t
,
[]
byte
{
0
,
2
,
3
},
data
.
OracleKey
)
...
...
op-e2e/e2eutils/disputegame/cannon_helper.go
View file @
40bf36a5
...
...
@@ -6,6 +6,7 @@ import (
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/contracts"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/cannon"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
"github.com/ethereum-optimism/optimism/op-node/rollup"
...
...
@@ -46,7 +47,7 @@ func (g *CannonGameHelper) CreateHonestActor(ctx context.Context, rollupCfg *rol
maxDepth
:=
g
.
MaxDepth
(
ctx
)
gameContract
,
err
:=
contracts
.
NewFaultDisputeGameContract
(
g
.
addr
,
batching
.
NewMultiCaller
(
l1Client
.
Client
(),
batching
.
DefaultBatchSize
))
g
.
require
.
NoError
(
err
,
"Create game contract bindings"
)
provider
,
err
:=
cannon
.
NewTraceProvider
(
ctx
,
logger
,
metrics
.
NoopMetrics
,
cfg
,
gameContract
,
cannon
.
NoLocalContext
,
filepath
.
Join
(
cfg
.
Datadir
,
"honest"
),
uint64
(
maxDepth
))
provider
,
err
:=
cannon
.
NewTraceProvider
(
ctx
,
logger
,
metrics
.
NoopMetrics
,
cfg
,
gameContract
,
types
.
NoLocalContext
,
filepath
.
Join
(
cfg
.
Datadir
,
"honest"
),
uint64
(
maxDepth
))
g
.
require
.
NoError
(
err
,
"create cannon trace provider"
)
return
&
HonestHelper
{
...
...
op-e2e/e2eutils/disputegame/helper.go
View file @
40bf36a5
...
...
@@ -225,7 +225,7 @@ func (h *FactoryHelper) StartCannonGameWithCorrectRoot(ctx context.Context, roll
testlog
.
Logger
(
h
.
t
,
log
.
LvlInfo
)
.
New
(
"role"
,
"CorrectTrace"
),
metrics
.
NoopMetrics
,
cfg
,
cannon
.
NoLocalContext
,
faultTypes
.
NoLocalContext
,
inputs
,
cfg
.
Datadir
,
maxDepth
.
Uint64
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment