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
babe99b4
Unverified
Commit
babe99b4
authored
Jun 20, 2023
by
mergify[bot]
Committed by
GitHub
Jun 20, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into aj/app-score-diffs
parents
8bec48bb
4dbbee29
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
247 additions
and
76 deletions
+247
-76
chilly-carrots-impress.md
.changeset/chilly-carrots-impress.md
+0
-5
fair-poems-give.md
.changeset/fair-poems-give.md
+0
-6
few-shoes-deny.md
.changeset/few-shoes-deny.md
+0
-5
moody-foxes-enjoy.md
.changeset/moody-foxes-enjoy.md
+0
-6
rotten-cheetahs-guess.md
.changeset/rotten-cheetahs-guess.md
+0
-5
smooth-bulldogs-hear.md
.changeset/smooth-bulldogs-hear.md
+0
-5
tasty-seahorses-add.md
.changeset/tasty-seahorses-add.md
+0
-5
host.go
op-program/host/host.go
+1
-1
retry.go
op-service/client/retry.go
+14
-2
retry_test.go
op-service/client/retry_test.go
+13
-11
CHANGELOG.md
packages/chain-mon/CHANGELOG.md
+18
-0
package.json
packages/chain-mon/package.json
+5
-5
CHANGELOG.md
packages/common-ts/CHANGELOG.md
+8
-0
package.json
packages/common-ts/package.json
+2
-2
CHANGELOG.md
packages/contracts-bedrock/CHANGELOG.md
+12
-0
OptimismPortal.t.sol
...ts-bedrock/contracts/test/invariants/OptimismPortal.t.sol
+103
-0
OptimismPortal.md
packages/contracts-bedrock/invariant-docs/OptimismPortal.md
+9
-3
package.json
packages/contracts-bedrock/package.json
+2
-2
package.json
packages/contracts-periphery/package.json
+2
-2
CHANGELOG.md
packages/core-utils/CHANGELOG.md
+7
-0
package.json
packages/core-utils/package.json
+1
-1
CHANGELOG.md
packages/fault-detector/CHANGELOG.md
+17
-0
package.json
packages/fault-detector/package.json
+4
-4
CHANGELOG.md
packages/replica-healthcheck/CHANGELOG.md
+9
-0
package.json
packages/replica-healthcheck/package.json
+3
-3
CHANGELOG.md
packages/sdk/CHANGELOG.md
+14
-0
package.json
packages/sdk/package.json
+3
-3
No files found.
.changeset/chilly-carrots-impress.md
deleted
100644 → 0
View file @
8bec48bb
---
'
@eth-optimism/core-utils'
:
patch
---
Delete legacy core-utils
.changeset/fair-poems-give.md
deleted
100644 → 0
View file @
8bec48bb
---
'
@eth-optimism/fault-detector'
:
major
'
@eth-optimism/sdk'
:
major
---
Make optimism/sdk default to bedrock mode
.changeset/few-shoes-deny.md
deleted
100644 → 0
View file @
8bec48bb
---
'
@eth-optimism/fault-detector'
:
patch
---
Fix false error to warning
.changeset/moody-foxes-enjoy.md
deleted
100644 → 0
View file @
8bec48bb
---
'
@eth-optimism/chain-mon'
:
minor
'
@eth-optimism/core-utils'
:
patch
---
Added a new service wallet-mon to identify unexpected transfers from key accounts
.changeset/rotten-cheetahs-guess.md
deleted
100644 → 0
View file @
8bec48bb
---
'
@eth-optimism/fault-detector'
:
patch
---
Add better source maps and developer support
.changeset/smooth-bulldogs-hear.md
deleted
100644 → 0
View file @
8bec48bb
---
'
@eth-optimism/chain-mon'
:
patch
---
Fixed an issue with logging the wrong timestamp.
.changeset/tasty-seahorses-add.md
deleted
100644 → 0
View file @
8bec48bb
---
'
@eth-optimism/contracts-bedrock'
:
minor
---
Fix issue with deposits running out of gas
op-program/host/host.go
View file @
babe99b4
...
...
@@ -224,7 +224,7 @@ func createRetryingRPC(ctx context.Context, logger log.Logger, url string) (clie
if
err
!=
nil
{
return
nil
,
err
}
return
opclient
.
NewRetryingClient
(
rpc
,
maxRPCRetries
),
nil
return
opclient
.
NewRetryingClient
(
logger
,
rpc
,
maxRPCRetries
),
nil
}
func
routeHints
(
logger
log
.
Logger
,
hHostRW
io
.
ReadWriter
,
hinter
preimage
.
HintHandler
)
chan
error
{
...
...
op-service/client/retry.go
View file @
babe99b4
...
...
@@ -5,6 +5,7 @@ import (
"time"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
"github.com/hashicorp/go-multierror"
...
...
@@ -19,6 +20,7 @@ var (
// retryingClient wraps a [client.RPC] with a backoff strategy.
type
retryingClient
struct
{
log
log
.
Logger
c
client
.
RPC
retryAttempts
int
strategy
backoff
.
Strategy
...
...
@@ -26,11 +28,12 @@ type retryingClient struct {
// NewRetryingClient creates a new retrying client.
// The backoff strategy is optional, if not provided, the default exponential backoff strategy is used.
func
NewRetryingClient
(
c
client
.
RPC
,
retries
int
,
strategy
...
backoff
.
Strategy
)
*
retryingClient
{
func
NewRetryingClient
(
logger
log
.
Logger
,
c
client
.
RPC
,
retries
int
,
strategy
...
backoff
.
Strategy
)
*
retryingClient
{
if
len
(
strategy
)
==
0
{
strategy
=
[]
backoff
.
Strategy
{
ExponentialBackoff
}
}
return
&
retryingClient
{
log
:
logger
,
c
:
c
,
retryAttempts
:
retries
,
strategy
:
strategy
[
0
],
...
...
@@ -50,7 +53,11 @@ func (b *retryingClient) CallContext(ctx context.Context, result any, method str
return
backoff
.
DoCtx
(
ctx
,
b
.
retryAttempts
,
b
.
strategy
,
func
()
error
{
cCtx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
10
*
time
.
Second
)
defer
cancel
()
return
b
.
c
.
CallContext
(
cCtx
,
result
,
method
,
args
...
)
err
:=
b
.
c
.
CallContext
(
cCtx
,
result
,
method
,
args
...
)
if
err
!=
nil
{
b
.
log
.
Warn
(
"RPC request failed"
,
"method"
,
method
,
"err"
,
err
)
}
return
err
})
}
...
...
@@ -85,6 +92,7 @@ func (b *retryingClient) BatchCallContext(ctx context.Context, input []rpc.Batch
}
err
:=
b
.
c
.
BatchCallContext
(
cCtx
,
batch
)
if
err
!=
nil
{
b
.
log
.
Warn
(
"Batch request failed"
,
"err"
,
err
)
// Whole call failed, retry all pending elems again
return
err
}
...
...
@@ -107,6 +115,7 @@ func (b *retryingClient) BatchCallContext(ctx context.Context, input []rpc.Batch
}
if
len
(
failed
)
>
0
{
pending
=
failed
b
.
log
.
Warn
(
"Batch request returned errors"
,
"err"
,
combinedErr
)
return
combinedErr
}
return
nil
...
...
@@ -118,6 +127,9 @@ func (b *retryingClient) EthSubscribe(ctx context.Context, channel any, args ...
err
:=
backoff
.
DoCtx
(
ctx
,
b
.
retryAttempts
,
b
.
strategy
,
func
()
error
{
var
err
error
sub
,
err
=
b
.
c
.
EthSubscribe
(
ctx
,
channel
,
args
...
)
if
err
!=
nil
{
b
.
log
.
Warn
(
"Subscription request failed"
,
"err"
,
err
)
}
return
err
})
return
sub
,
err
...
...
op-service/client/retry_test.go
View file @
babe99b4
...
...
@@ -5,6 +5,8 @@ import (
"errors"
"testing"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
...
...
@@ -66,18 +68,18 @@ var _ opclient.RPC = (*MockRPC)(nil)
func
TestClient_BackoffClient_Strategy
(
t
*
testing
.
T
)
{
mockRpc
:=
&
MockRPC
{}
backoffClient
:=
client
.
NewRetryingClient
(
mockRpc
,
0
)
backoffClient
:=
client
.
NewRetryingClient
(
testlog
.
Logger
(
t
,
log
.
LvlInfo
),
mockRpc
,
0
)
require
.
Equal
(
t
,
backoffClient
.
BackoffStrategy
(),
client
.
ExponentialBackoff
)
fixedStrategy
:=
&
backoff
.
FixedStrategy
{}
backoffClient
=
client
.
NewRetryingClient
(
mockRpc
,
0
,
fixedStrategy
)
backoffClient
=
client
.
NewRetryingClient
(
testlog
.
Logger
(
t
,
log
.
LvlInfo
),
mockRpc
,
0
,
fixedStrategy
)
require
.
Equal
(
t
,
backoffClient
.
BackoffStrategy
(),
fixedStrategy
)
}
func
TestClient_BackoffClient_Close
(
t
*
testing
.
T
)
{
mockRpc
:=
&
MockRPC
{}
mockRpc
.
On
(
"Close"
)
.
Return
()
backoffClient
:=
client
.
NewRetryingClient
(
mockRpc
,
0
)
backoffClient
:=
client
.
NewRetryingClient
(
testlog
.
Logger
(
t
,
log
.
LvlInfo
),
mockRpc
,
0
)
backoffClient
.
Close
()
require
.
True
(
t
,
mockRpc
.
AssertCalled
(
t
,
"Close"
))
}
...
...
@@ -85,7 +87,7 @@ func TestClient_BackoffClient_Close(t *testing.T) {
func
TestClient_BackoffClient_CallContext
(
t
*
testing
.
T
)
{
mockRpc
:=
&
MockRPC
{}
mockRpc
.
ExpectCallContext
(
nil
,
nil
,
"foo"
,
"bar"
)
backoffClient
:=
client
.
NewRetryingClient
(
mockRpc
,
1
)
backoffClient
:=
client
.
NewRetryingClient
(
testlog
.
Logger
(
t
,
log
.
LvlInfo
),
mockRpc
,
1
)
err
:=
backoffClient
.
CallContext
(
context
.
Background
(),
nil
,
"foo"
,
"bar"
)
require
.
NoError
(
t
,
err
)
require
.
True
(
t
,
mockRpc
.
AssertCalled
(
t
,
"CallContext"
,
mock
.
Anything
,
nil
,
"foo"
,
[]
interface
{}{
"bar"
}))
...
...
@@ -94,7 +96,7 @@ func TestClient_BackoffClient_CallContext(t *testing.T) {
func
TestClient_BackoffClient_CallContext_WithRetries
(
t
*
testing
.
T
)
{
mockRpc
:=
&
MockRPC
{}
mockRpc
.
ExpectCallContext
(
errors
.
New
(
"foo"
),
nil
,
"foo"
,
"bar"
)
backoffClient
:=
client
.
NewRetryingClient
(
mockRpc
,
2
,
backoff
.
Fixed
(
0
))
backoffClient
:=
client
.
NewRetryingClient
(
testlog
.
Logger
(
t
,
log
.
LvlInfo
),
mockRpc
,
2
,
backoff
.
Fixed
(
0
))
err
:=
backoffClient
.
CallContext
(
context
.
Background
(),
nil
,
"foo"
,
"bar"
)
require
.
Error
(
t
,
err
)
require
.
True
(
t
,
mockRpc
.
AssertNumberOfCalls
(
t
,
"CallContext"
,
2
))
...
...
@@ -103,7 +105,7 @@ func TestClient_BackoffClient_CallContext_WithRetries(t *testing.T) {
func
TestClient_BackoffClient_BatchCallContext
(
t
*
testing
.
T
)
{
mockRpc
:=
&
MockRPC
{}
mockRpc
.
ExpectBatchCallContext
(
nil
,
[]
rpc
.
BatchElem
{})
backoffClient
:=
client
.
NewRetryingClient
(
mockRpc
,
1
)
backoffClient
:=
client
.
NewRetryingClient
(
testlog
.
Logger
(
t
,
log
.
LvlInfo
),
mockRpc
,
1
)
err
:=
backoffClient
.
BatchCallContext
(
context
.
Background
(),
nil
)
require
.
NoError
(
t
,
err
)
require
.
True
(
t
,
mockRpc
.
AssertCalled
(
t
,
"BatchCallContext"
,
mock
.
Anything
,
[]
rpc
.
BatchElem
{}))
...
...
@@ -112,7 +114,7 @@ func TestClient_BackoffClient_BatchCallContext(t *testing.T) {
func
TestClient_BackoffClient_BatchCallContext_WithRetries
(
t
*
testing
.
T
)
{
mockRpc
:=
&
MockRPC
{}
mockRpc
.
ExpectBatchCallContext
(
errors
.
New
(
"foo"
),
[]
rpc
.
BatchElem
{})
backoffClient
:=
client
.
NewRetryingClient
(
mockRpc
,
2
,
backoff
.
Fixed
(
0
))
backoffClient
:=
client
.
NewRetryingClient
(
testlog
.
Logger
(
t
,
log
.
LvlInfo
),
mockRpc
,
2
,
backoff
.
Fixed
(
0
))
err
:=
backoffClient
.
BatchCallContext
(
context
.
Background
(),
nil
)
require
.
Error
(
t
,
err
)
require
.
True
(
t
,
mockRpc
.
AssertNumberOfCalls
(
t
,
"BatchCallContext"
,
2
))
...
...
@@ -134,7 +136,7 @@ func TestClient_BackoffClient_BatchCallContext_WithPartialRetries(t *testing.T)
batch
[
0
]
.
Error
=
errors
.
New
(
"boom again"
)
batch
[
1
]
.
Result
=
batch
[
1
]
.
Method
})
backoffClient
:=
client
.
NewRetryingClient
(
mockRpc
,
2
,
backoff
.
Fixed
(
0
))
backoffClient
:=
client
.
NewRetryingClient
(
testlog
.
Logger
(
t
,
log
.
LvlInfo
),
mockRpc
,
2
,
backoff
.
Fixed
(
0
))
err
:=
backoffClient
.
BatchCallContext
(
context
.
Background
(),
batches
)
require
.
Error
(
t
,
err
)
require
.
True
(
t
,
mockRpc
.
AssertNumberOfCalls
(
t
,
"BatchCallContext"
,
2
))
...
...
@@ -164,7 +166,7 @@ func TestClient_BackoffClient_BatchCallContext_WithPartialRetriesUntilSuccess(t
mockRpc
.
OnBatchCallContext
(
nil
,
[]
rpc
.
BatchElem
{
batches
[
1
]},
func
(
batch
[]
rpc
.
BatchElem
)
{
batch
[
0
]
.
Result
=
batch
[
0
]
.
Method
})
backoffClient
:=
client
.
NewRetryingClient
(
mockRpc
,
4
,
backoff
.
Fixed
(
0
))
backoffClient
:=
client
.
NewRetryingClient
(
testlog
.
Logger
(
t
,
log
.
LvlInfo
),
mockRpc
,
4
,
backoff
.
Fixed
(
0
))
err
:=
backoffClient
.
BatchCallContext
(
context
.
Background
(),
batches
)
require
.
NoError
(
t
,
err
)
require
.
True
(
t
,
mockRpc
.
AssertNumberOfCalls
(
t
,
"BatchCallContext"
,
3
))
...
...
@@ -178,7 +180,7 @@ func TestClient_BackoffClient_BatchCallContext_WithPartialRetriesUntilSuccess(t
func
TestClient_BackoffClient_EthSubscribe
(
t
*
testing
.
T
)
{
mockRpc
:=
&
MockRPC
{}
mockRpc
.
ExpectEthSubscribe
(
ethereum
.
Subscription
(
nil
),
nil
,
nil
,
"foo"
,
"bar"
)
backoffClient
:=
client
.
NewRetryingClient
(
mockRpc
,
1
)
backoffClient
:=
client
.
NewRetryingClient
(
testlog
.
Logger
(
t
,
log
.
LvlInfo
),
mockRpc
,
1
)
_
,
err
:=
backoffClient
.
EthSubscribe
(
context
.
Background
(),
nil
,
"foo"
,
"bar"
)
require
.
NoError
(
t
,
err
)
require
.
True
(
t
,
mockRpc
.
AssertCalled
(
t
,
"EthSubscribe"
,
mock
.
Anything
,
nil
,
[]
interface
{}{
"foo"
,
"bar"
}))
...
...
@@ -187,7 +189,7 @@ func TestClient_BackoffClient_EthSubscribe(t *testing.T) {
func
TestClient_BackoffClient_EthSubscribe_WithRetries
(
t
*
testing
.
T
)
{
mockRpc
:=
&
MockRPC
{}
mockRpc
.
ExpectEthSubscribe
(
ethereum
.
Subscription
(
nil
),
errors
.
New
(
"foo"
),
nil
,
"foo"
,
"bar"
)
backoffClient
:=
client
.
NewRetryingClient
(
mockRpc
,
2
,
backoff
.
Fixed
(
0
))
backoffClient
:=
client
.
NewRetryingClient
(
testlog
.
Logger
(
t
,
log
.
LvlInfo
),
mockRpc
,
2
,
backoff
.
Fixed
(
0
))
_
,
err
:=
backoffClient
.
EthSubscribe
(
context
.
Background
(),
nil
,
"foo"
,
"bar"
)
require
.
Error
(
t
,
err
)
require
.
True
(
t
,
mockRpc
.
AssertNumberOfCalls
(
t
,
"EthSubscribe"
,
2
))
...
...
packages/chain-mon/CHANGELOG.md
View file @
babe99b4
# @eth-optimism/drippie-mon
## 0.4.0
### Minor Changes
-
d6388be4a: Added a new service wallet-mon to identify unexpected transfers from key accounts
### Patch Changes
-
287d317d3: Fixed an issue with logging the wrong timestamp.
-
Updated dependencies
[
8d7dcc70c
]
-
Updated dependencies
[
119754c2f
]
-
Updated dependencies
[
d6388be4a
]
-
Updated dependencies
[
af292562f
]
-
@eth-optimism/core-utils@0.12.1
-
@eth-optimism/sdk@3.0.0
-
@eth-optimism/contracts-bedrock@0.15.0
-
@eth-optimism/common-ts@0.8.2
## 0.3.1
### Patch Changes
...
...
packages/chain-mon/package.json
View file @
babe99b4
{
"private"
:
true
,
"name"
:
"@eth-optimism/chain-mon"
,
"version"
:
"0.
3.1
"
,
"version"
:
"0.
4.0
"
,
"description"
:
"[Optimism] Chain monitoring services"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -34,11 +34,11 @@
"url"
:
"https://github.com/ethereum-optimism/optimism.git"
},
"dependencies"
:
{
"@eth-optimism/common-ts"
:
"0.8.
1
"
,
"@eth-optimism/common-ts"
:
"0.8.
2
"
,
"@eth-optimism/contracts-periphery"
:
"1.0.8"
,
"@eth-optimism/contracts-bedrock"
:
"0.1
4
.0"
,
"@eth-optimism/core-utils"
:
"0.12.
0
"
,
"@eth-optimism/sdk"
:
"
2.1
.0"
,
"@eth-optimism/contracts-bedrock"
:
"0.1
5
.0"
,
"@eth-optimism/core-utils"
:
"0.12.
1
"
,
"@eth-optimism/sdk"
:
"
3.0
.0"
,
"ethers"
:
"^5.7.0"
,
"@types/dateformat"
:
"^5.0.0"
,
"chai-as-promised"
:
"^7.1.1"
,
...
...
packages/common-ts/CHANGELOG.md
View file @
babe99b4
# @eth-optimism/common-ts
## 0.8.2
### Patch Changes
-
Updated dependencies
[
8d7dcc70c
]
-
Updated dependencies
[
d6388be4a
]
-
@eth-optimism/core-utils@0.12.1
## 0.8.1
### Patch Changes
...
...
packages/common-ts/package.json
View file @
babe99b4
{
"name"
:
"@eth-optimism/common-ts"
,
"version"
:
"0.8.
1
"
,
"version"
:
"0.8.
2
"
,
"description"
:
"[Optimism] Advanced typescript tooling used by various services"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -33,7 +33,7 @@
"url"
:
"https://github.com/ethereum-optimism/optimism.git"
},
"dependencies"
:
{
"@eth-optimism/core-utils"
:
"0.12.
0
"
,
"@eth-optimism/core-utils"
:
"0.12.
1
"
,
"@sentry/node"
:
"^6.3.1"
,
"bcfg"
:
"^0.1.7"
,
"body-parser"
:
"^1.20.0"
,
...
...
packages/contracts-bedrock/CHANGELOG.md
View file @
babe99b4
# @eth-optimism/contracts-bedrock
## 0.15.0
### Minor Changes
-
af292562f: Fix issue with deposits running out of gas
### Patch Changes
-
Updated dependencies
[
8d7dcc70c
]
-
Updated dependencies
[
d6388be4a
]
-
@eth-optimism/core-utils@0.12.1
## 0.14.0
### Minor Changes
...
...
packages/contracts-bedrock/contracts/test/invariants/OptimismPortal.t.sol
View file @
babe99b4
pragma solidity 0.8.15;
import { StdUtils } from "forge-std/Test.sol";
import { Vm } from "forge-std/Vm.sol";
import { OptimismPortal } from "../../L1/OptimismPortal.sol";
import { L2OutputOracle } from "../../L1/L2OutputOracle.sol";
import { AddressAliasHelper } from "../../vendor/AddressAliasHelper.sol";
import { SystemConfig } from "../../L1/SystemConfig.sol";
import { ResourceMetering } from "../../L1/ResourceMetering.sol";
import { Constants } from "../../libraries/Constants.sol";
import { Portal_Initializer } from "../CommonTest.t.sol";
import { Types } from "../../libraries/Types.sol";
contract OptimismPortal_Depositor is StdUtils, ResourceMetering {
Vm internal vm;
OptimismPortal internal portal;
bool public failedToComplete;
constructor(Vm _vm, OptimismPortal _portal) {
vm = _vm;
portal = _portal;
initialize();
}
function initialize() internal initializer {
__ResourceMetering_init();
}
function resourceConfig() public pure returns (ResourceMetering.ResourceConfig memory) {
return _resourceConfig();
}
function _resourceConfig()
internal
pure
override
returns (ResourceMetering.ResourceConfig memory)
{
ResourceMetering.ResourceConfig memory rcfg = Constants.DEFAULT_RESOURCE_CONFIG();
return rcfg;
}
// A test intended to identify any unexpected halting conditions
function depositTransactionCompletes(
address _to,
uint256 _value,
uint64 _gasLimit,
bool _isCreation,
bytes memory _data
) public payable {
vm.assume((!_isCreation || _to == address(0)) && _data.length <= 120_000);
uint256 preDepositvalue = bound(_value, 0, type(uint128).max);
// Give the depositor some ether
vm.deal(address(this), preDepositvalue);
// cache the contract's eth balance
uint256 preDepositBalance = address(this).balance;
uint256 value = bound(preDepositvalue, 0, preDepositBalance);
(, uint64 cachedPrevBoughtGas, ) = ResourceMetering(address(portal)).params();
ResourceMetering.ResourceConfig memory rcfg = resourceConfig();
uint256 maxResourceLimit = uint64(rcfg.maxResourceLimit);
uint64 gasLimit = uint64(
bound(
_gasLimit,
portal.minimumGasLimit(uint64(_data.length)),
maxResourceLimit - cachedPrevBoughtGas
)
);
try portal.depositTransaction{ value: value }(_to, value, gasLimit, _isCreation, _data) {
// Do nothing; Call succeeded
} catch {
failedToComplete = true;
}
}
}
contract OptimismPortal_Invariant_Harness is Portal_Initializer {
// Reusable default values for a test withdrawal
Types.WithdrawalTransaction _defaultTx;
...
...
@@ -57,6 +132,34 @@ contract OptimismPortal_Invariant_Harness is Portal_Initializer {
}
}
contract OptimismPortal_Deposit_Invariant is Portal_Initializer {
OptimismPortal_Depositor internal actor;
function setUp() public override {
super.setUp();
// Create a deposit actor.
actor = new OptimismPortal_Depositor(vm, op);
targetContract(address(actor));
bytes4[] memory selectors = new bytes4[](1);
selectors[0] = actor.depositTransactionCompletes.selector;
FuzzSelector memory selector = FuzzSelector({ addr: address(actor), selectors: selectors });
targetSelector(selector);
}
/**
* @custom:invariant Deposits of any value should always succeed unless
* `_to` = `address(0)` or `_isCreation` = `true`.
*
* All deposits, barring creation transactions and transactions sent to `address(0)`,
* should always succeed.
*/
function invariant_deposit_completes() external {
assertEq(actor.failedToComplete(), false);
}
}
contract OptimismPortal_CannotTimeTravel is OptimismPortal_Invariant_Harness {
function setUp() public override {
super.setUp();
...
...
packages/contracts-bedrock/invariant-docs/OptimismPortal.md
View file @
babe99b4
# `OptimismPortal` Invariants
## Deposits of any value should always succeed unless `_to` = `address(0)` or `_isCreation` = `true`.
**Test:**
[
`OptimismPortal.t.sol#L158`
](
../contracts/test/invariants/OptimismPortal.t.sol#L158
)
All deposits, barring creation transactions and transactions sent to
`address(0)`
, should always succeed.
## `finalizeWithdrawalTransaction` should revert if the finalization period has not elapsed.
**Test:**
[
`OptimismPortal.t.sol#L
85`
](
../contracts/test/invariants/OptimismPortal.t.sol#L85
)
**Test:**
[
`OptimismPortal.t.sol#L
188`
](
../contracts/test/invariants/OptimismPortal.t.sol#L188
)
A withdrawal that has been proven should not be able to be finalized until after the finalization period has elapsed.
## `finalizeWithdrawalTransaction` should revert if the withdrawal has already been finalized.
**Test:**
[
`OptimismPortal.t.sol#L
122`
](
../contracts/test/invariants/OptimismPortal.t.sol#L122
)
**Test:**
[
`OptimismPortal.t.sol#L
225`
](
../contracts/test/invariants/OptimismPortal.t.sol#L225
)
Ensures that there is no chain of calls that can be made that allows a withdrawal to be finalized twice.
## A withdrawal should **always** be able to be finalized `FINALIZATION_PERIOD_SECONDS` after it was successfully proven.
**Test:**
[
`OptimismPortal.t.sol#L
157`
](
../contracts/test/invariants/OptimismPortal.t.sol#L157
)
**Test:**
[
`OptimismPortal.t.sol#L
260`
](
../contracts/test/invariants/OptimismPortal.t.sol#L260
)
This invariant asserts that there is no chain of calls that can be made that will prevent a withdrawal from being finalized exactly
`FINALIZATION_PERIOD_SECONDS`
after it was successfully proven.
...
...
packages/contracts-bedrock/package.json
View file @
babe99b4
{
"name"
:
"@eth-optimism/contracts-bedrock"
,
"version"
:
"0.1
4
.0"
,
"version"
:
"0.1
5
.0"
,
"description"
:
"Contracts for Optimism Specs"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -53,7 +53,7 @@
"echidna:metering"
:
"echidna-test --contract EchidnaFuzzResourceMetering --config ./echidna.yaml ."
},
"dependencies"
:
{
"@eth-optimism/core-utils"
:
"^0.12.
0
"
,
"@eth-optimism/core-utils"
:
"^0.12.
1
"
,
"@openzeppelin/contracts"
:
"4.7.3"
,
"@openzeppelin/contracts-upgradeable"
:
"4.7.3"
,
"ethers"
:
"^5.7.0"
...
...
packages/contracts-periphery/package.json
View file @
babe99b4
...
...
@@ -53,8 +53,8 @@
"url"
:
"https://github.com/ethereum-optimism/optimism.git"
},
"devDependencies"
:
{
"@eth-optimism/contracts-bedrock"
:
"0.1
4
.0"
,
"@eth-optimism/core-utils"
:
"^0.12.
0
"
,
"@eth-optimism/contracts-bedrock"
:
"0.1
5
.0"
,
"@eth-optimism/core-utils"
:
"^0.12.
1
"
,
"@eth-optimism/hardhat-deploy-config"
:
"^0.2.6"
,
"@ethersproject/hardware-wallets"
:
"^5.7.0"
,
"@nomiclabs/hardhat-ethers"
:
"^2.0.2"
,
...
...
packages/core-utils/CHANGELOG.md
View file @
babe99b4
# @eth-optimism/core-utils
## 0.12.1
### Patch Changes
-
8d7dcc70c: Delete legacy core-utils
-
d6388be4a: Added a new service wallet-mon to identify unexpected transfers from key accounts
## 0.12.0
### Minor Changes
...
...
packages/core-utils/package.json
View file @
babe99b4
{
"name"
:
"@eth-optimism/core-utils"
,
"version"
:
"0.12.
0
"
,
"version"
:
"0.12.
1
"
,
"description"
:
"[Optimism] Core typescript utilities"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
packages/fault-detector/CHANGELOG.md
View file @
babe99b4
# @eth-optimism/fault-detector
## 1.0.0
### Major Changes
-
119754c2f: Make optimism/sdk default to bedrock mode
### Patch Changes
-
16ccbee24: Fix false error to warning
-
685addec2: Add better source maps and developer support
-
Updated dependencies
[
8d7dcc70c
]
-
Updated dependencies
[
119754c2f
]
-
Updated dependencies
[
d6388be4a
]
-
@eth-optimism/core-utils@0.12.1
-
@eth-optimism/sdk@3.0.0
-
@eth-optimism/common-ts@0.8.2
## 0.6.4
### Patch Changes
...
...
packages/fault-detector/package.json
View file @
babe99b4
{
"private"
:
true
,
"name"
:
"@eth-optimism/fault-detector"
,
"version"
:
"
0.6.4
"
,
"version"
:
"
1.0.0
"
,
"description"
:
"[Optimism] Service for detecting faulty L2 output proposals"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -50,10 +50,10 @@
"tsx"
:
"^3.12.7"
},
"dependencies"
:
{
"@eth-optimism/common-ts"
:
"^0.8.
1
"
,
"@eth-optimism/common-ts"
:
"^0.8.
2
"
,
"@eth-optimism/contracts"
:
"^0.6.0"
,
"@eth-optimism/core-utils"
:
"^0.12.
0
"
,
"@eth-optimism/sdk"
:
"^
2.1
.0"
,
"@eth-optimism/core-utils"
:
"^0.12.
1
"
,
"@eth-optimism/sdk"
:
"^
3.0
.0"
,
"@ethersproject/abstract-provider"
:
"^5.7.0"
}
}
packages/replica-healthcheck/CHANGELOG.md
View file @
babe99b4
# @eth-optimism/replica-healthcheck
## 1.2.5
### Patch Changes
-
Updated dependencies
[
8d7dcc70c
]
-
Updated dependencies
[
d6388be4a
]
-
@eth-optimism/core-utils@0.12.1
-
@eth-optimism/common-ts@0.8.2
## 1.2.4
### Patch Changes
...
...
packages/replica-healthcheck/package.json
View file @
babe99b4
{
"private"
:
true
,
"name"
:
"@eth-optimism/replica-healthcheck"
,
"version"
:
"1.2.
4
"
,
"version"
:
"1.2.
5
"
,
"description"
:
"[Optimism] Service for monitoring the health of replica nodes"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -32,8 +32,8 @@
"url"
:
"https://github.com/ethereum-optimism/optimism.git"
},
"dependencies"
:
{
"@eth-optimism/common-ts"
:
"0.8.
1
"
,
"@eth-optimism/core-utils"
:
"0.12.
0
"
,
"@eth-optimism/common-ts"
:
"0.8.
2
"
,
"@eth-optimism/core-utils"
:
"0.12.
1
"
,
"@ethersproject/abstract-provider"
:
"^5.7.0"
},
"devDependencies"
:
{
...
...
packages/sdk/CHANGELOG.md
View file @
babe99b4
# @eth-optimism/sdk
## 3.0.0
### Major Changes
-
119754c2f: Make optimism/sdk default to bedrock mode
### Patch Changes
-
Updated dependencies
[
8d7dcc70c
]
-
Updated dependencies
[
d6388be4a
]
-
Updated dependencies
[
af292562f
]
-
@eth-optimism/core-utils@0.12.1
-
@eth-optimism/contracts-bedrock@0.15.0
## 2.1.0
### Minor Changes
...
...
packages/sdk/package.json
View file @
babe99b4
{
"name"
:
"@eth-optimism/sdk"
,
"version"
:
"
2.1
.0"
,
"version"
:
"
3.0
.0"
,
"description"
:
"[Optimism] Tools for working with Optimism"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -55,8 +55,8 @@
},
"dependencies"
:
{
"@eth-optimism/contracts"
:
"0.6.0"
,
"@eth-optimism/core-utils"
:
"0.12.
0
"
,
"@eth-optimism/contracts-bedrock"
:
"0.1
4
.0"
,
"@eth-optimism/core-utils"
:
"0.12.
1
"
,
"@eth-optimism/contracts-bedrock"
:
"0.1
5
.0"
,
"lodash"
:
"^4.17.21"
,
"merkletreejs"
:
"^0.2.27"
,
"rlp"
:
"^2.2.7"
...
...
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