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
5926f623
Unverified
Commit
5926f623
authored
Oct 15, 2022
by
mergify[bot]
Committed by
GitHub
Oct 15, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into jg/types_updates
parents
b0e20d71
f4faa44c
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
445 additions
and
2 deletions
+445
-2
wet-cameras-cover.md
.changeset/wet-cameras-cover.md
+5
-0
l1_miner.go
op-e2e/actions/l1_miner.go
+1
-0
l2_engine.go
op-e2e/actions/l2_engine.go
+1
-0
user.go
op-e2e/actions/user.go
+336
-0
user_test.go
op-e2e/actions/user_test.go
+82
-0
rpc.go
op-node/client/rpc.go
+1
-1
sequencer.go
op-node/rollup/driver/sequencer.go
+1
-1
main.go
proxyd/cmd/proxyd/main.go
+15
-0
config.go
proxyd/config.go
+1
-0
example.config.toml
proxyd/example.config.toml
+2
-0
No files found.
.changeset/wet-cameras-cover.md
0 → 100644
View file @
5926f623
---
'
@eth-optimism/proxyd'
:
minor
---
adds server.log_level config
op-e2e/actions/l1_miner.go
View file @
5926f623
...
...
@@ -106,6 +106,7 @@ func (s *L1Miner) ActL1IncludeTx(from common.Address) Action {
return
}
s
.
pendingIndices
[
from
]
=
i
+
1
// won't retry the tx
s
.
l1BuildingState
.
Prepare
(
tx
.
Hash
(),
len
(
s
.
l1Transactions
))
receipt
,
err
:=
core
.
ApplyTransaction
(
s
.
l1Cfg
.
Config
,
s
.
l1Chain
,
&
s
.
l1BuildingHeader
.
Coinbase
,
s
.
l1GasPool
,
s
.
l1BuildingState
,
s
.
l1BuildingHeader
,
tx
,
&
s
.
l1BuildingHeader
.
GasUsed
,
*
s
.
l1Chain
.
GetVMConfig
())
if
err
!=
nil
{
...
...
op-e2e/actions/l2_engine.go
View file @
5926f623
...
...
@@ -174,6 +174,7 @@ func (e *L2Engine) ActL2IncludeTx(from common.Address) Action {
return
}
e
.
pendingIndices
[
from
]
=
i
+
1
// won't retry the tx
e
.
l2BuildingState
.
Prepare
(
tx
.
Hash
(),
len
(
e
.
l2Transactions
))
receipt
,
err
:=
core
.
ApplyTransaction
(
e
.
l2Cfg
.
Config
,
e
.
l2Chain
,
&
e
.
l2BuildingHeader
.
Coinbase
,
e
.
l2GasPool
,
e
.
l2BuildingState
,
e
.
l2BuildingHeader
,
tx
,
&
e
.
l2BuildingHeader
.
GasUsed
,
*
e
.
l2Chain
.
GetVMConfig
())
if
err
!=
nil
{
...
...
op-e2e/actions/user.go
0 → 100644
View file @
5926f623
This diff is collapsed.
Click to expand it.
op-e2e/actions/user_test.go
0 → 100644
View file @
5926f623
package
actions
import
(
"math/rand"
"testing"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/withdrawals"
)
func
TestCrossLayerUser
(
gt
*
testing
.
T
)
{
t
:=
NewDefaultTesting
(
gt
)
dp
:=
e2eutils
.
MakeDeployParams
(
t
,
defaultRollupTestParams
)
sd
:=
e2eutils
.
Setup
(
t
,
dp
,
defaultAlloc
)
log
:=
testlog
.
Logger
(
t
,
log
.
LvlDebug
)
miner
,
seqEngine
,
seq
:=
setupSequencerTest
(
t
,
sd
,
log
)
// need to start derivation before we can make L2 blocks
seq
.
ActL2PipelineFull
(
t
)
l1Cl
:=
miner
.
EthClient
()
l2Cl
:=
seqEngine
.
EthClient
()
withdrawalsCl
:=
&
withdrawals
.
Client
{}
// TODO: need a rollup node actor to wrap for output root proof RPC
addresses
:=
e2eutils
.
CollectAddresses
(
sd
,
dp
)
l1UserEnv
:=
&
BasicUserEnv
[
*
L1Bindings
]{
EthCl
:
l1Cl
,
Signer
:
types
.
LatestSigner
(
sd
.
L1Cfg
.
Config
),
AddressCorpora
:
addresses
,
Bindings
:
NewL1Bindings
(
t
,
l1Cl
,
&
sd
.
DeploymentsL1
),
}
l2UserEnv
:=
&
BasicUserEnv
[
*
L2Bindings
]{
EthCl
:
l2Cl
,
Signer
:
types
.
LatestSigner
(
sd
.
L2Cfg
.
Config
),
AddressCorpora
:
addresses
,
Bindings
:
NewL2Bindings
(
t
,
l2Cl
,
withdrawalsCl
),
}
alice
:=
NewCrossLayerUser
(
log
,
dp
.
Secrets
.
Alice
,
rand
.
New
(
rand
.
NewSource
(
1234
)))
alice
.
L1
.
SetUserEnv
(
l1UserEnv
)
alice
.
L2
.
SetUserEnv
(
l2UserEnv
)
// regular L2 tx, in new L2 block
alice
.
L2
.
ActResetTxOpts
(
t
)
alice
.
L2
.
ActSetTxToAddr
(
&
dp
.
Addresses
.
Bob
)(
t
)
alice
.
L2
.
ActMakeTx
(
t
)
seq
.
ActL2StartBlock
(
t
)
seqEngine
.
ActL2IncludeTx
(
alice
.
Address
())(
t
)
seq
.
ActL2EndBlock
(
t
)
alice
.
L2
.
ActCheckReceiptStatusOfLastTx
(
true
)(
t
)
// regular L1 tx, in new L1 block
alice
.
L1
.
ActResetTxOpts
(
t
)
alice
.
L1
.
ActSetTxToAddr
(
&
dp
.
Addresses
.
Bob
)(
t
)
alice
.
L1
.
ActMakeTx
(
t
)
miner
.
ActL1StartBlock
(
12
)(
t
)
miner
.
ActL1IncludeTx
(
alice
.
Address
())(
t
)
miner
.
ActL1EndBlock
(
t
)
alice
.
L1
.
ActCheckReceiptStatusOfLastTx
(
true
)(
t
)
// regular Deposit, in new L1 block
alice
.
ActDeposit
(
t
)
miner
.
ActL1StartBlock
(
12
)(
t
)
miner
.
ActL1IncludeTx
(
alice
.
Address
())(
t
)
miner
.
ActL1EndBlock
(
t
)
seq
.
ActL1HeadSignal
(
t
)
// sync sequencer build enough blocks to adopt latest L1 origin
for
seq
.
SyncStatus
()
.
UnsafeL2
.
L1Origin
.
Number
<
miner
.
l1Chain
.
CurrentBlock
()
.
NumberU64
()
{
seq
.
ActL2StartBlock
(
t
)
seq
.
ActL2EndBlock
(
t
)
}
// Now that the L2 chain adopted the latest L1 block, check that we processed the deposit
alice
.
ActCheckDepositStatus
(
true
,
true
)(
t
)
}
op-node/client/rpc.go
View file @
5926f623
...
...
@@ -43,7 +43,7 @@ func NewRPC(ctx context.Context, lgr log.Logger, addr string, opts ...rpc.Client
func
DialRPCClientWithBackoff
(
ctx
context
.
Context
,
log
log
.
Logger
,
addr
string
,
opts
...
rpc
.
ClientOption
)
(
*
rpc
.
Client
,
error
)
{
bOff
:=
backoff
.
Exponential
()
var
ret
*
rpc
.
Client
err
:=
backoff
.
Do
(
10
,
bOff
,
func
()
error
{
err
:=
backoff
.
Do
Ctx
(
ctx
,
10
,
bOff
,
func
()
error
{
client
,
err
:=
rpc
.
DialOptions
(
ctx
,
addr
,
opts
...
)
if
err
!=
nil
{
if
client
==
nil
{
...
...
op-node/rollup/driver/sequencer.go
View file @
5926f623
...
...
@@ -91,6 +91,7 @@ func (d *Sequencer) CompleteBuildingBlock(ctx context.Context) (*eth.ExecutionPa
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to complete building on top of L2 chain %s, error (%d): %w"
,
d
.
buildingOnto
.
HeadBlockHash
,
errTyp
,
err
)
}
d
.
buildingID
=
eth
.
PayloadID
{}
return
payload
,
nil
}
...
...
@@ -103,7 +104,6 @@ func (d *Sequencer) CreateNewBlock(ctx context.Context, l2Head eth.L2BlockRef, l
if
err
!=
nil
{
return
l2Head
,
nil
,
err
}
d
.
buildingID
=
eth
.
PayloadID
{}
// Generate an L2 block ref from the payload.
ref
,
err
:=
derive
.
PayloadToBlockRef
(
payload
,
&
d
.
config
.
Genesis
)
...
...
proxyd/cmd/proxyd/main.go
View file @
5926f623
...
...
@@ -37,6 +37,21 @@ func main() {
log
.
Crit
(
"error reading config file"
,
"err"
,
err
)
}
// update log level from config
logLevel
,
err
:=
log
.
LvlFromString
(
config
.
Server
.
LogLevel
)
if
err
!=
nil
{
logLevel
=
log
.
LvlInfo
if
config
.
Server
.
LogLevel
!=
""
{
log
.
Warn
(
"invalid server.log_level set: "
+
config
.
Server
.
LogLevel
)
}
}
log
.
Root
()
.
SetHandler
(
log
.
LvlFilterHandler
(
logLevel
,
log
.
StreamHandler
(
os
.
Stdout
,
log
.
JSONFormat
()),
),
)
shutdown
,
err
:=
proxyd
.
Start
(
config
)
if
err
!=
nil
{
log
.
Crit
(
"error starting proxyd"
,
"err"
,
err
)
...
...
proxyd/config.go
View file @
5926f623
...
...
@@ -14,6 +14,7 @@ type ServerConfig struct {
WSPort
int
`toml:"ws_port"`
MaxBodySizeBytes
int64
`toml:"max_body_size_bytes"`
MaxConcurrentRPCs
int64
`toml:"max_concurrent_rpcs"`
LogLevel
string
`toml:"log_level"`
// TimeoutSeconds specifies the maximum time spent serving an HTTP request. Note that isn't used for websocket connections
TimeoutSeconds
int
`toml:"timeout_seconds"`
...
...
proxyd/example.config.toml
View file @
5926f623
...
...
@@ -19,6 +19,8 @@ ws_port = 8085
# Maximum client body size, in bytes, that the server will accept.
max_body_size_bytes
=
10485760
max_concurrent_rpcs
=
1000
# Server log level
log_level
=
"info"
[redis]
# URL to a Redis instance.
...
...
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