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
d7aa58a1
Unverified
Commit
d7aa58a1
authored
Apr 07, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-program: split into client and host packages
parent
cbb0bb5d
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
28 additions
and
25 deletions
+28
-25
l2_engine.go
op-e2e/actions/l2_engine.go
+1
-1
l2_engine_test.go
op-e2e/actions/l2_engine_test.go
+2
-2
driver.go
op-program/client/driver/driver.go
+3
-3
driver_test.go
op-program/client/driver/driver_test.go
+0
-0
db.go
op-program/client/l2/db.go
+0
-0
db_test.go
op-program/client/l2/db_test.go
+0
-0
engine.go
op-program/client/l2/engine.go
+1
-1
engine_backend.go
op-program/client/l2/engine_backend.go
+1
-1
engine_backend_test.go
op-program/client/l2/engine_backend_test.go
+2
-2
engine_test.go
op-program/client/l2/engine_test.go
+0
-0
block_processor.go
op-program/client/l2/engineapi/block_processor.go
+0
-0
l2_engine_api.go
op-program/client/l2/engineapi/l2_engine_api.go
+0
-0
l2_engine_api_tests.go
op-program/client/l2/engineapi/test/l2_engine_api_tests.go
+1
-1
oracle.go
op-program/client/l2/oracle.go
+0
-0
main.go
op-program/host/cmd/main.go
+7
-7
main_test.go
op-program/host/cmd/main_test.go
+1
-1
config.go
op-program/host/config/config.go
+1
-1
config_test.go
op-program/host/config/config_test.go
+0
-0
flags.go
op-program/host/flags/flags.go
+0
-0
flags_test.go
op-program/host/flags/flags_test.go
+0
-0
l1.go
op-program/host/l1/l1.go
+1
-1
fetcher.go
op-program/host/l2/fetcher.go
+0
-0
fetcher_test.go
op-program/host/l2/fetcher_test.go
+3
-1
l2.go
op-program/host/l2/l2.go
+4
-3
version.go
op-program/host/version/version.go
+0
-0
No files found.
op-e2e/actions/l2_engine.go
View file @
d7aa58a1
...
@@ -4,7 +4,7 @@ import (
...
@@ -4,7 +4,7 @@ import (
"errors"
"errors"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-program/l2/engineapi"
"github.com/ethereum-optimism/optimism/op-program/
client/
l2/engineapi"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
...
...
op-e2e/actions/l2_engine_test.go
View file @
d7aa58a1
...
@@ -4,8 +4,8 @@ import (
...
@@ -4,8 +4,8 @@ import (
"math/big"
"math/big"
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-program/l2/engineapi"
"github.com/ethereum-optimism/optimism/op-program/
client/
l2/engineapi"
"github.com/ethereum-optimism/optimism/op-program/l2/engineapi/test"
"github.com/ethereum-optimism/optimism/op-program/
client/
l2/engineapi/test"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/beacon"
"github.com/ethereum/go-ethereum/consensus/beacon"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/consensus/ethash"
...
...
op-program/driver/driver.go
→
op-program/
client/
driver/driver.go
View file @
d7aa58a1
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-program/config"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
)
)
...
@@ -23,8 +23,8 @@ type Driver struct {
...
@@ -23,8 +23,8 @@ type Driver struct {
pipeline
Derivation
pipeline
Derivation
}
}
func
NewDriver
(
logger
log
.
Logger
,
cfg
*
config
.
Config
,
l1Source
derive
.
L1Fetcher
,
l2Source
derive
.
Engine
)
*
Driver
{
func
NewDriver
(
logger
log
.
Logger
,
cfg
*
rollup
.
Config
,
l1Source
derive
.
L1Fetcher
,
l2Source
derive
.
Engine
)
*
Driver
{
pipeline
:=
derive
.
NewDerivationPipeline
(
logger
,
cfg
.
Rollup
,
l1Source
,
l2Source
,
metrics
.
NoopMetrics
)
pipeline
:=
derive
.
NewDerivationPipeline
(
logger
,
cfg
,
l1Source
,
l2Source
,
metrics
.
NoopMetrics
)
pipeline
.
Reset
()
pipeline
.
Reset
()
return
&
Driver
{
return
&
Driver
{
logger
:
logger
,
logger
:
logger
,
...
...
op-program/driver/driver_test.go
→
op-program/
client/
driver/driver_test.go
View file @
d7aa58a1
File moved
op-program/l2/db.go
→
op-program/
client/
l2/db.go
View file @
d7aa58a1
File moved
op-program/l2/db_test.go
→
op-program/
client/
l2/db_test.go
View file @
d7aa58a1
File moved
op-program/l2/engine.go
→
op-program/
client/
l2/engine.go
View file @
d7aa58a1
...
@@ -8,7 +8,7 @@ import (
...
@@ -8,7 +8,7 @@ import (
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-program/l2/engineapi"
"github.com/ethereum-optimism/optimism/op-program/
client/
l2/engineapi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
...
op-program/l2/engine_backend.go
→
op-program/
client/
l2/engine_backend.go
View file @
d7aa58a1
...
@@ -4,7 +4,7 @@ import (
...
@@ -4,7 +4,7 @@ import (
"fmt"
"fmt"
"math/big"
"math/big"
"github.com/ethereum-optimism/optimism/op-program/l2/engineapi"
"github.com/ethereum-optimism/optimism/op-program/
client/
l2/engineapi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/consensus/beacon"
"github.com/ethereum/go-ethereum/consensus/beacon"
...
...
op-program/l2/engine_backend_test.go
→
op-program/
client/
l2/engine_backend_test.go
View file @
d7aa58a1
...
@@ -6,8 +6,8 @@ import (
...
@@ -6,8 +6,8 @@ import (
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-program/l2/engineapi"
"github.com/ethereum-optimism/optimism/op-program/
client/
l2/engineapi"
"github.com/ethereum-optimism/optimism/op-program/l2/engineapi/test"
"github.com/ethereum-optimism/optimism/op-program/
client/
l2/engineapi/test"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/beacon"
"github.com/ethereum/go-ethereum/consensus/beacon"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
...
...
op-program/l2/engine_test.go
→
op-program/
client/
l2/engine_test.go
View file @
d7aa58a1
File moved
op-program/l2/engineapi/block_processor.go
→
op-program/
client/
l2/engineapi/block_processor.go
View file @
d7aa58a1
File moved
op-program/l2/engineapi/l2_engine_api.go
→
op-program/
client/
l2/engineapi/l2_engine_api.go
View file @
d7aa58a1
File moved
op-program/l2/engineapi/test/l2_engine_api_tests.go
→
op-program/
client/
l2/engineapi/test/l2_engine_api_tests.go
View file @
d7aa58a1
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-program/l2/engineapi"
"github.com/ethereum-optimism/optimism/op-program/
client/
l2/engineapi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
...
op-program/l2/oracle.go
→
op-program/
client/
l2/oracle.go
View file @
d7aa58a1
File moved
op-program/cmd/main.go
→
op-program/
host/
cmd/main.go
View file @
d7aa58a1
...
@@ -10,12 +10,12 @@ import (
...
@@ -10,12 +10,12 @@ import (
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-program/config
"
cldr
"github.com/ethereum-optimism/optimism/op-program/client/driver
"
"github.com/ethereum-optimism/optimism/op-program/
driver
"
"github.com/ethereum-optimism/optimism/op-program/
host/config
"
"github.com/ethereum-optimism/optimism/op-program/flags"
"github.com/ethereum-optimism/optimism/op-program/
host/
flags"
"github.com/ethereum-optimism/optimism/op-program/l1"
"github.com/ethereum-optimism/optimism/op-program/
host/
l1"
"github.com/ethereum-optimism/optimism/op-program/l2"
"github.com/ethereum-optimism/optimism/op-program/
host/
l2"
"github.com/ethereum-optimism/optimism/op-program/version"
"github.com/ethereum-optimism/optimism/op-program/
host/
version"
oplog
"github.com/ethereum-optimism/optimism/op-service/log"
oplog
"github.com/ethereum-optimism/optimism/op-service/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli"
"github.com/urfave/cli"
...
@@ -111,7 +111,7 @@ func FaultProofProgram(logger log.Logger, cfg *config.Config) error {
...
@@ -111,7 +111,7 @@ func FaultProofProgram(logger log.Logger, cfg *config.Config) error {
return
fmt
.
Errorf
(
"connect l2 oracle: %w"
,
err
)
return
fmt
.
Errorf
(
"connect l2 oracle: %w"
,
err
)
}
}
d
:=
driver
.
NewDriver
(
logger
,
cfg
,
l1Source
,
l2Source
)
d
:=
cldr
.
NewDriver
(
logger
,
cfg
.
Rollup
,
l1Source
,
l2Source
)
for
{
for
{
if
err
=
d
.
Step
(
ctx
);
errors
.
Is
(
err
,
io
.
EOF
)
{
if
err
=
d
.
Step
(
ctx
);
errors
.
Is
(
err
,
io
.
EOF
)
{
break
break
...
...
op-program/cmd/main_test.go
→
op-program/
host/
cmd/main_test.go
View file @
d7aa58a1
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-program/config"
"github.com/ethereum-optimism/optimism/op-program/
host/
config"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
...
op-program/config/config.go
→
op-program/
host/
config/config.go
View file @
d7aa58a1
...
@@ -6,7 +6,7 @@ import (
...
@@ -6,7 +6,7 @@ import (
opnode
"github.com/ethereum-optimism/optimism/op-node"
opnode
"github.com/ethereum-optimism/optimism/op-node"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-program/flags"
"github.com/ethereum-optimism/optimism/op-program/
host/
flags"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/urfave/cli"
"github.com/urfave/cli"
)
)
...
...
op-program/config/config_test.go
→
op-program/
host/
config/config_test.go
View file @
d7aa58a1
File moved
op-program/flags/flags.go
→
op-program/
host/
flags/flags.go
View file @
d7aa58a1
File moved
op-program/flags/flags_test.go
→
op-program/
host/
flags/flags_test.go
View file @
d7aa58a1
File moved
op-program/l1/l1.go
→
op-program/
host/
l1/l1.go
View file @
d7aa58a1
...
@@ -6,7 +6,7 @@ import (
...
@@ -6,7 +6,7 @@ import (
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-program/config"
"github.com/ethereum-optimism/optimism/op-program/
host/
config"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
)
)
...
...
op-program/l2/fetcher.go
→
op-program/
host/
l2/fetcher.go
View file @
d7aa58a1
File moved
op-program/l2/fetcher_test.go
→
op-program/
host/
l2/fetcher_test.go
View file @
d7aa58a1
...
@@ -10,6 +10,8 @@ import (
...
@@ -10,6 +10,8 @@ import (
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
cll2
"github.com/ethereum-optimism/optimism/op-program/client/l2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/rawdb"
...
@@ -19,7 +21,7 @@ import (
...
@@ -19,7 +21,7 @@ import (
)
)
// Require the fetching oracle to implement StateOracle
// Require the fetching oracle to implement StateOracle
var
_
StateOracle
=
(
*
FetchingL2Oracle
)(
nil
)
var
_
cll2
.
StateOracle
=
(
*
FetchingL2Oracle
)(
nil
)
type
callContextRequest
struct
{
type
callContextRequest
struct
{
ctx
context
.
Context
ctx
context
.
Context
...
...
op-program/l2/l2.go
→
op-program/
host/
l2/l2.go
View file @
d7aa58a1
...
@@ -7,7 +7,8 @@ import (
...
@@ -7,7 +7,8 @@ import (
"os"
"os"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-program/config"
cll2
"github.com/ethereum-optimism/optimism/op-program/client/l2"
"github.com/ethereum-optimism/optimism/op-program/host/config"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/params"
...
@@ -23,11 +24,11 @@ func NewFetchingEngine(ctx context.Context, logger log.Logger, cfg *config.Confi
...
@@ -23,11 +24,11 @@ func NewFetchingEngine(ctx context.Context, logger log.Logger, cfg *config.Confi
return
nil
,
fmt
.
Errorf
(
"connect l2 oracle: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"connect l2 oracle: %w"
,
err
)
}
}
engineBackend
,
err
:=
NewOracleBackedL2Chain
(
logger
,
oracle
,
genesis
,
cfg
.
L2Head
)
engineBackend
,
err
:=
cll2
.
NewOracleBackedL2Chain
(
logger
,
oracle
,
genesis
,
cfg
.
L2Head
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"create l2 chain: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"create l2 chain: %w"
,
err
)
}
}
return
NewOracleEngine
(
cfg
.
Rollup
,
logger
,
engineBackend
),
nil
return
cll2
.
NewOracleEngine
(
cfg
.
Rollup
,
logger
,
engineBackend
),
nil
}
}
func
loadL2Genesis
(
cfg
*
config
.
Config
)
(
*
params
.
ChainConfig
,
error
)
{
func
loadL2Genesis
(
cfg
*
config
.
Config
)
(
*
params
.
ChainConfig
,
error
)
{
...
...
op-program/version/version.go
→
op-program/
host/
version/version.go
View file @
d7aa58a1
File moved
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