Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dajuguan committed Nov 2, 2024
1 parent 7217728 commit e4d11d5
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion op-challenger2/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func applyValidConfigForAsterisc(cfg *Config) {
}

func validConfig(traceType TraceType) Config {
cfg := NewConfig(validGameFactoryAddress, validL1EthRpc, validL1BeaconUrl, validRollupRpc, validL2Rpc, validDatadir, 0, traceType)
cfg := NewConfig(validGameFactoryAddress, validL1EthRpc, validL1BeaconUrl, validRollupRpc, validL2Rpc, validDatadir, DACalldata, traceType)
if traceType == TraceTypeCannon || traceType == TraceTypePermissioned {
applyValidConfigForCannon(&cfg)
}
Expand Down
2 changes: 0 additions & 2 deletions op-challenger2/game/fault/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ type Agent struct {
responder Responder
selective bool
claimants []common.Address
maxDepth types.Depth
maxClockDuration time.Duration
log log.Logger
}
Expand Down Expand Up @@ -74,7 +73,6 @@ func NewAgent(
responder: responder,
selective: selective,
claimants: claimants,
maxDepth: maxDepth,
maxClockDuration: maxClockDuration,
log: log,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ func TestFaultDisputeGame_UpdateOracleTx(t *testing.T) {
t.Run(version.version, func(t *testing.T) {
t.Run("Local", func(t *testing.T) {
stubRpc, game := setupFaultDisputeGameTest(t, version)
data := faultTypes.NewPreimageOracleDAData(common.Hash{0x01, 0xbc}.Bytes(), []byte{1, 2, 3, 4, 5, 6, 7}, 16, vmStateDA, outputRootDAItem)
data := faultTypes.NewPreimageOracleDataWithDA(common.Hash{0x01, 0xbc}.Bytes(), []byte{1, 2, 3, 4, 5, 6, 7}, 16, vmStateDA, outputRootDAItem)
claimIdx := uint64(6)
stubRpc.SetResponse(fdgAddr, methodAddLocalData, rpcblock.Latest, []interface{}{
data.GetIdent(),
Expand Down
2 changes: 1 addition & 1 deletion op-challenger2/game/fault/trace/asterisc/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestGenerateProof(t *testing.T) {
input := "starting.json"
tempDir := t.TempDir()
dir := filepath.Join(tempDir, "gameDir")
datype := int64(0)
datype := config.DACalldata
cfg := config.NewConfig(common.Address{0xbb}, "http://localhost:8888", "http://localhost:9000", "http://localhost:9096", "http://localhost:9095", tempDir, datype, config.TraceTypeAsterisc)
cfg.L2Rpc = "http://localhost:9999"
prestate := "pre.json"
Expand Down
2 changes: 1 addition & 1 deletion op-challenger2/game/fault/trace/cannon/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestGenerateProof(t *testing.T) {
input := "starting.json"
tempDir := t.TempDir()
dir := filepath.Join(tempDir, "gameDir")
datype := int64(0)
datype := config.DACalldata
cfg := config.NewConfig(common.Address{0xbb}, "http://localhost:8888", "http://localhost:9000", "http://localhost:9096", "http://localhost:9095", tempDir, datype, config.TraceTypeCannon)
cfg.L2Rpc = "http://localhost:9999"
prestate := "pre.json"
Expand Down
15 changes: 7 additions & 8 deletions op-challenger2/game/fault/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"math/big"
"time"

"github.com/ethereum-optimism/optimism/op-challenger2/config"
preimage "github.com/ethereum-optimism/optimism/op-preimage"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -41,17 +42,17 @@ type PreimageOracleData struct {
BlobFieldIndex uint64
BlobCommitment []byte
BlobProof []byte
// multi-sec proof for VM step
// multi-sec proof for VM stepV2 func
VMStateDA DAData
// daitem for addLocalData
// daitem for addLocalData func
OutputRootDAItem DAItem
}

type DAType *big.Int

var (
CallDataType = big.NewInt(0)
BlobDataType = big.NewInt(1)
CallDataType = big.NewInt(config.DACalldata)
BlobDataType = big.NewInt(config.DABlob)
)

type DAItem struct {
Expand Down Expand Up @@ -95,10 +96,8 @@ func (p *PreimageOracleData) GetPrecompileInput() []byte {
return p.oracleData[28:]
}

// Param:
// - datype: 0 for calldata; >=1 for blob
func NewDaType(datype int64) DAType {
if datype == 0 {
if datype == config.DACalldata {
return CallDataType
} else {
return BlobDataType
Expand All @@ -115,7 +114,7 @@ func NewPreimageOracleData(key []byte, data []byte, offset uint32) *PreimageOrac
}
}

func NewPreimageOracleDAData(key []byte, data []byte, offset uint32, vmStateDA DAData, outputRootDAItem DAItem) *PreimageOracleData {
func NewPreimageOracleDataWithDA(key []byte, data []byte, offset uint32, vmStateDA DAData, outputRootDAItem DAItem) *PreimageOracleData {
return &PreimageOracleData{
IsLocal: len(key) > 0 && key[0] == byte(preimage.LocalKeyType),
OracleKey: key,
Expand Down
1 change: 1 addition & 0 deletions packages/contracts-bedrock/lib/automate
Submodule automate added at 011758
1 change: 1 addition & 0 deletions packages/contracts-bedrock/lib/openzeppelin-contracts-v5
Submodule openzeppelin-contracts-v5 added at dbb610
1 change: 1 addition & 0 deletions packages/contracts-bedrock/lib/solady-v0.0.245
Submodule solady-v0.0.245 added at e0ef35

0 comments on commit e4d11d5

Please sign in to comment.