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
358f3ad5
Unverified
Commit
358f3ad5
authored
Oct 17, 2022
by
Mark Tyneway
Committed by
GitHub
Oct 17, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into e2e/set-calldata
parents
457cdd3b
39e1d598
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
58 additions
and
22 deletions
+58
-22
flat-windows-trade.md
.changeset/flat-windows-trade.md
+0
-5
shy-trainers-sneeze.md
.changeset/shy-trainers-sneeze.md
+0
-5
wet-cameras-cover.md
.changeset/wet-cameras-cover.md
+0
-5
dev_addresses.go
op-bindings/predeploys/dev_addresses.go
+3
-0
layer_one.go
op-chain-ops/genesis/layer_one.go
+19
-0
layer_one_test.go
op-chain-ops/genesis/layer_one_test.go
+12
-0
user.go
op-e2e/actions/user.go
+6
-0
engine_queue.go
op-node/rollup/derive/engine_queue.go
+1
-1
state.go
op-node/rollup/driver/state.go
+1
-3
start.go
op-node/rollup/sync/start.go
+4
-1
start_test.go
op-node/rollup/sync/start_test.go
+3
-1
CHANGELOG.md
proxyd/CHANGELOG.md
+8
-0
package.json
proxyd/package.json
+1
-1
No files found.
.changeset/flat-windows-trade.md
deleted
100644 → 0
View file @
457cdd3b
---
'
@eth-optimism/proxyd'
:
minor
---
Allow disabling backend rate limiter
.changeset/shy-trainers-sneeze.md
deleted
100644 → 0
View file @
457cdd3b
---
'
@eth-optimism/proxyd'
:
minor
---
Support pattern matching in exempt origins/user agents
.changeset/wet-cameras-cover.md
deleted
100644 → 0
View file @
457cdd3b
---
'
@eth-optimism/proxyd'
:
minor
---
adds server.log_level config
op-bindings/predeploys/dev_addresses.go
View file @
358f3ad5
...
@@ -10,6 +10,7 @@ const (
...
@@ -10,6 +10,7 @@ const (
DevOptimismMintableERC20Factory
=
"0x6900000000000000000000000000000000000004"
DevOptimismMintableERC20Factory
=
"0x6900000000000000000000000000000000000004"
DevAddressManager
=
"0x6900000000000000000000000000000000000005"
DevAddressManager
=
"0x6900000000000000000000000000000000000005"
DevProxyAdmin
=
"0x6900000000000000000000000000000000000006"
DevProxyAdmin
=
"0x6900000000000000000000000000000000000006"
DevWETH9
=
"0x6900000000000000000000000000000000000007"
)
)
var
(
var
(
...
@@ -20,6 +21,7 @@ var (
...
@@ -20,6 +21,7 @@ var (
DevOptimismMintableERC20FactoryAddr
=
common
.
HexToAddress
(
DevOptimismMintableERC20Factory
)
DevOptimismMintableERC20FactoryAddr
=
common
.
HexToAddress
(
DevOptimismMintableERC20Factory
)
DevAddressManagerAddr
=
common
.
HexToAddress
(
DevAddressManager
)
DevAddressManagerAddr
=
common
.
HexToAddress
(
DevAddressManager
)
DevProxyAdminAddr
=
common
.
HexToAddress
(
DevProxyAdmin
)
DevProxyAdminAddr
=
common
.
HexToAddress
(
DevProxyAdmin
)
DevWETH9Addr
=
common
.
HexToAddress
(
DevWETH9
)
DevPredeploys
=
make
(
map
[
string
]
*
common
.
Address
)
DevPredeploys
=
make
(
map
[
string
]
*
common
.
Address
)
)
)
...
@@ -32,4 +34,5 @@ func init() {
...
@@ -32,4 +34,5 @@ func init() {
DevPredeploys
[
"OptimismMintableERC20Factory"
]
=
&
DevOptimismMintableERC20FactoryAddr
DevPredeploys
[
"OptimismMintableERC20Factory"
]
=
&
DevOptimismMintableERC20FactoryAddr
DevPredeploys
[
"AddressManager"
]
=
&
DevAddressManagerAddr
DevPredeploys
[
"AddressManager"
]
=
&
DevAddressManagerAddr
DevPredeploys
[
"Admin"
]
=
&
DevProxyAdminAddr
DevPredeploys
[
"Admin"
]
=
&
DevProxyAdminAddr
DevPredeploys
[
"WETH9"
]
=
&
DevWETH9Addr
}
}
op-chain-ops/genesis/layer_one.go
View file @
358f3ad5
...
@@ -165,6 +165,16 @@ func BuildL1DeveloperGenesis(config *DeployConfig) (*core.Genesis, error) {
...
@@ -165,6 +165,16 @@ func BuildL1DeveloperGenesis(config *DeployConfig) (*core.Genesis, error) {
for
name
,
proxyAddr
:=
range
predeploys
.
DevPredeploys
{
for
name
,
proxyAddr
:=
range
predeploys
.
DevPredeploys
{
memDB
.
SetState
(
*
proxyAddr
,
ImplementationSlot
,
depsByName
[
name
]
.
Address
.
Hash
())
memDB
.
SetState
(
*
proxyAddr
,
ImplementationSlot
,
depsByName
[
name
]
.
Address
.
Hash
())
// Special case for WETH since it was not designed to be behind a proxy
if
name
==
"WETH9"
{
name
,
_
:=
state
.
EncodeStringValue
(
"Wrapped Ether"
,
0
)
symbol
,
_
:=
state
.
EncodeStringValue
(
"WETH"
,
0
)
decimals
,
_
:=
state
.
EncodeUintValue
(
18
,
0
)
memDB
.
SetState
(
*
proxyAddr
,
common
.
Hash
{},
name
)
memDB
.
SetState
(
*
proxyAddr
,
common
.
Hash
{
31
:
0x01
},
symbol
)
memDB
.
SetState
(
*
proxyAddr
,
common
.
Hash
{
31
:
0x02
},
decimals
)
}
}
}
stateDB
,
err
:=
backend
.
Blockchain
()
.
State
()
stateDB
,
err
:=
backend
.
Blockchain
()
.
State
()
...
@@ -183,6 +193,7 @@ func BuildL1DeveloperGenesis(config *DeployConfig) (*core.Genesis, error) {
...
@@ -183,6 +193,7 @@ func BuildL1DeveloperGenesis(config *DeployConfig) (*core.Genesis, error) {
memDB
.
CreateAccount
(
depAddr
)
memDB
.
CreateAccount
(
depAddr
)
memDB
.
SetCode
(
depAddr
,
dep
.
Bytecode
)
memDB
.
SetCode
(
depAddr
,
dep
.
Bytecode
)
for
iter
.
Next
()
{
for
iter
.
Next
()
{
_
,
data
,
_
,
err
:=
rlp
.
Split
(
iter
.
Value
)
_
,
data
,
_
,
err
:=
rlp
.
Split
(
iter
.
Value
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -250,6 +261,9 @@ func deployL1Contracts(config *DeployConfig, backend *backends.SimulatedBackend)
...
@@ -250,6 +261,9 @@ func deployL1Contracts(config *DeployConfig, backend *backends.SimulatedBackend)
common
.
Address
{
19
:
0x01
},
common
.
Address
{
19
:
0x01
},
},
},
},
},
{
Name
:
"WETH9"
,
},
}
...
)
}
...
)
return
deployer
.
Deploy
(
backend
,
constructors
,
l1Deployer
)
return
deployer
.
Deploy
(
backend
,
constructors
,
l1Deployer
)
}
}
...
@@ -308,6 +322,11 @@ func l1Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep
...
@@ -308,6 +322,11 @@ func l1Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep
backend
,
backend
,
common
.
Address
{},
common
.
Address
{},
)
)
case
"WETH9"
:
_
,
tx
,
_
,
err
=
bindings
.
DeployWETH9
(
opts
,
backend
,
)
default
:
default
:
if
strings
.
HasSuffix
(
deployment
.
Name
,
"Proxy"
)
{
if
strings
.
HasSuffix
(
deployment
.
Name
,
"Proxy"
)
{
_
,
tx
,
_
,
err
=
bindings
.
DeployProxy
(
opts
,
backend
,
deployer
.
TestAddress
)
_
,
tx
,
_
,
err
=
bindings
.
DeployProxy
(
opts
,
backend
,
deployer
.
TestAddress
)
...
...
op-chain-ops/genesis/layer_one_test.go
View file @
358f3ad5
...
@@ -92,6 +92,18 @@ func TestBuildL1DeveloperGenesis(t *testing.T) {
...
@@ -92,6 +92,18 @@ func TestBuildL1DeveloperGenesis(t *testing.T) {
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
predeploys
.
DevL1StandardBridgeAddr
,
bridgeAddr
)
require
.
Equal
(
t
,
predeploys
.
DevL1StandardBridgeAddr
,
bridgeAddr
)
weth9
,
err
:=
bindings
.
NewWETH9
(
predeploys
.
DevWETH9Addr
,
sim
)
require
.
NoError
(
t
,
err
)
decimals
,
err
:=
weth9
.
Decimals
(
callOpts
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
uint8
(
18
),
decimals
)
symbol
,
err
:=
weth9
.
Symbol
(
callOpts
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
"WETH"
,
symbol
)
name
,
err
:=
weth9
.
Name
(
callOpts
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
"Wrapped Ether"
,
name
)
// test that we can do deposits, etc.
// test that we can do deposits, etc.
priv
,
err
:=
crypto
.
HexToECDSA
(
"ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
)
priv
,
err
:=
crypto
.
HexToECDSA
(
"ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
)
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
...
...
op-e2e/actions/user.go
View file @
358f3ad5
...
@@ -172,6 +172,12 @@ func (s *BasicUser[B]) ActRandomTxValue(t Testing) {
...
@@ -172,6 +172,12 @@ func (s *BasicUser[B]) ActRandomTxValue(t Testing) {
s
.
txOpts
.
Value
=
big
.
NewInt
(
s
.
rng
.
Int63
())
s
.
txOpts
.
Value
=
big
.
NewInt
(
s
.
rng
.
Int63
())
}
}
func
(
s
*
BasicUser
[
B
])
ActSetTxValue
(
value
*
big
.
Int
)
Action
{
return
func
(
t
Testing
)
{
s
.
txOpts
.
Value
=
value
}
}
func
(
s
*
BasicUser
[
B
])
ActRandomTxData
(
t
Testing
)
{
func
(
s
*
BasicUser
[
B
])
ActRandomTxData
(
t
Testing
)
{
dataLen
:=
s
.
rng
.
Intn
(
128
_000
)
dataLen
:=
s
.
rng
.
Intn
(
128
_000
)
out
:=
make
([]
byte
,
dataLen
)
out
:=
make
([]
byte
,
dataLen
)
...
...
op-node/rollup/derive/engine_queue.go
View file @
358f3ad5
...
@@ -405,7 +405,7 @@ func (eq *EngineQueue) forceNextSafeAttributes(ctx context.Context) error {
...
@@ -405,7 +405,7 @@ func (eq *EngineQueue) forceNextSafeAttributes(ctx context.Context) error {
// ResetStep Walks the L2 chain backwards until it finds an L2 block whose L1 origin is canonical.
// ResetStep Walks the L2 chain backwards until it finds an L2 block whose L1 origin is canonical.
// The unsafe head is set to the head of the L2 chain, unless the existing safe head is not canonical.
// The unsafe head is set to the head of the L2 chain, unless the existing safe head is not canonical.
func
(
eq
*
EngineQueue
)
Reset
(
ctx
context
.
Context
,
_
eth
.
L1BlockRef
)
error
{
func
(
eq
*
EngineQueue
)
Reset
(
ctx
context
.
Context
,
_
eth
.
L1BlockRef
)
error
{
result
,
err
:=
sync
.
FindL2Heads
(
ctx
,
eq
.
cfg
,
eq
.
l1Fetcher
,
eq
.
engine
)
result
,
err
:=
sync
.
FindL2Heads
(
ctx
,
eq
.
cfg
,
eq
.
l1Fetcher
,
eq
.
engine
,
eq
.
log
)
if
err
!=
nil
{
if
err
!=
nil
{
return
NewTemporaryError
(
fmt
.
Errorf
(
"failed to find the L2 Heads to start from: %w"
,
err
))
return
NewTemporaryError
(
fmt
.
Errorf
(
"failed to find the L2 Heads to start from: %w"
,
err
))
}
}
...
...
op-node/rollup/driver/state.go
View file @
358f3ad5
...
@@ -309,9 +309,7 @@ func (s *Driver) eventLoop() {
...
@@ -309,9 +309,7 @@ func (s *Driver) eventLoop() {
s
.
metrics
.
SetDerivationIdle
(
false
)
s
.
metrics
.
SetDerivationIdle
(
false
)
s
.
idleDerivation
=
false
s
.
idleDerivation
=
false
s
.
log
.
Debug
(
"Derivation process step"
,
"onto_origin"
,
s
.
derivation
.
Origin
(),
"attempts"
,
stepAttempts
)
s
.
log
.
Debug
(
"Derivation process step"
,
"onto_origin"
,
s
.
derivation
.
Origin
(),
"attempts"
,
stepAttempts
)
stepCtx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
20
*
time
.
Minute
)
// TODO pick a timeout for executing a single step
err
:=
s
.
derivation
.
Step
(
context
.
Background
())
err
:=
s
.
derivation
.
Step
(
stepCtx
)
cancel
()
stepAttempts
+=
1
// count as attempt by default. We reset to 0 if we are making healthy progress.
stepAttempts
+=
1
// count as attempt by default. We reset to 0 if we are making healthy progress.
if
err
==
io
.
EOF
{
if
err
==
io
.
EOF
{
s
.
log
.
Debug
(
"Derivation process went idle"
,
"progress"
,
s
.
derivation
.
Origin
())
s
.
log
.
Debug
(
"Derivation process went idle"
,
"progress"
,
s
.
derivation
.
Origin
())
...
...
op-node/rollup/sync/start.go
View file @
358f3ad5
...
@@ -32,6 +32,7 @@ import (
...
@@ -32,6 +32,7 @@ import (
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
)
)
type
L1Chain
interface
{
type
L1Chain
interface
{
...
@@ -101,7 +102,7 @@ func currentHeads(ctx context.Context, cfg *rollup.Config, l2 L2Chain) (*FindHea
...
@@ -101,7 +102,7 @@ func currentHeads(ctx context.Context, cfg *rollup.Config, l2 L2Chain) (*FindHea
// Plausible: meaning that the blockhash of the L2 block's L1 origin
// Plausible: meaning that the blockhash of the L2 block's L1 origin
// (as reported in the L1 Attributes deposit within the L2 block) is not canonical at another height in the L1 chain,
// (as reported in the L1 Attributes deposit within the L2 block) is not canonical at another height in the L1 chain,
// and the same holds for all its ancestors.
// and the same holds for all its ancestors.
func
FindL2Heads
(
ctx
context
.
Context
,
cfg
*
rollup
.
Config
,
l1
L1Chain
,
l2
L2Chain
)
(
result
*
FindHeadsResult
,
err
error
)
{
func
FindL2Heads
(
ctx
context
.
Context
,
cfg
*
rollup
.
Config
,
l1
L1Chain
,
l2
L2Chain
,
lgr
log
.
Logger
)
(
result
*
FindHeadsResult
,
err
error
)
{
// Fetch current L2 forkchoice state
// Fetch current L2 forkchoice state
result
,
err
=
currentHeads
(
ctx
,
cfg
,
l2
)
result
,
err
=
currentHeads
(
ctx
,
cfg
,
l2
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -137,6 +138,8 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
...
@@ -137,6 +138,8 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
ahead
=
notFound
ahead
=
notFound
}
}
lgr
.
Trace
(
"walking sync start"
,
"number"
,
n
.
Number
)
// Don't walk past genesis. If we were at the L2 genesis, but could not find its L1 origin,
// Don't walk past genesis. If we were at the L2 genesis, but could not find its L1 origin,
// the L2 chain is building on the wrong L1 branch.
// the L2 chain is building on the wrong L1 branch.
if
n
.
Number
==
cfg
.
Genesis
.
L2
.
Number
{
if
n
.
Number
==
cfg
.
Genesis
.
L2
.
Number
{
...
...
op-node/rollup/sync/start_test.go
View file @
358f3ad5
...
@@ -73,7 +73,9 @@ func (c *syncStartTestCase) Run(t *testing.T) {
...
@@ -73,7 +73,9 @@ func (c *syncStartTestCase) Run(t *testing.T) {
Genesis
:
genesis
,
Genesis
:
genesis
,
SeqWindowSize
:
c
.
SeqWindowSize
,
SeqWindowSize
:
c
.
SeqWindowSize
,
}
}
result
,
err
:=
FindL2Heads
(
context
.
Background
(),
cfg
,
chain
,
chain
)
lgr
:=
log
.
New
()
lgr
.
SetHandler
(
log
.
DiscardHandler
())
result
,
err
:=
FindL2Heads
(
context
.
Background
(),
cfg
,
chain
,
chain
,
lgr
)
if
c
.
ExpectedErr
!=
nil
{
if
c
.
ExpectedErr
!=
nil
{
require
.
ErrorIs
(
t
,
err
,
c
.
ExpectedErr
,
"expected error"
)
require
.
ErrorIs
(
t
,
err
,
c
.
ExpectedErr
,
"expected error"
)
return
return
...
...
proxyd/CHANGELOG.md
View file @
358f3ad5
# @eth-optimism/proxyd
# @eth-optimism/proxyd
## 3.12.0
### Minor Changes
-
e9f2c701: Allow disabling backend rate limiter
-
ca45a85e: Support pattern matching in exempt origins/user agents
-
f4faa44c: adds server.log_level config
## 3.11.0
## 3.11.0
### Minor Changes
### Minor Changes
...
...
proxyd/package.json
View file @
358f3ad5
{
{
"name"
:
"@eth-optimism/proxyd"
,
"name"
:
"@eth-optimism/proxyd"
,
"version"
:
"3.1
1
.0"
,
"version"
:
"3.1
2
.0"
,
"private"
:
true
,
"private"
:
true
,
"dependencies"
:
{}
"dependencies"
:
{}
}
}
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