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
42e92639
Unverified
Commit
42e92639
authored
Mar 05, 2023
by
mergify[bot]
Committed by
GitHub
Mar 05, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into michael/fix-address-comparison
parents
96f365b5
55230429
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
262 additions
and
19 deletions
+262
-19
fluffy-geese-yell.md
.changeset/fluffy-geese-yell.md
+5
-0
channel_manager.go
op-batcher/batcher/channel_manager.go
+1
-1
blocktime_test.go
op-e2e/actions/blocktime_test.go
+1
-1
txmgr.go
op-service/txmgr/txmgr.go
+11
-0
txmgr_test.go
op-service/txmgr/txmgr_test.go
+43
-0
README.md
packages/atst/README.md
+1
-1
README.md
packages/atst/assets/README.md
+33
-0
preview.gif
packages/atst/assets/preview.gif
+0
-0
preview.tape
packages/atst/assets/preview.tape
+68
-0
cli.md
packages/atst/docs/cli.md
+2
-0
sdk.md
packages/atst/docs/sdk.md
+0
-5
cli.ts
packages/atst/src/cli.ts
+6
-6
readAttestations.ts
packages/atst/src/lib/readAttestations.ts
+0
-4
AttestationReadParams.ts
packages/atst/src/types/AttestationReadParams.ts
+0
-1
README.md
specs/README.md
+4
-0
network-upgrades.md
specs/network-upgrades.md
+87
-0
No files found.
.changeset/fluffy-geese-yell.md
0 → 100644
View file @
42e92639
---
'
@eth-optimism/atst'
:
minor
---
Remove broken allowFailures as option
op-batcher/batcher/channel_manager.go
View file @
42e92639
...
...
@@ -87,7 +87,7 @@ func (s *channelManager) Clear() {
func
(
s
*
channelManager
)
TxFailed
(
id
txID
)
{
if
data
,
ok
:=
s
.
pendingTransactions
[
id
];
ok
{
s
.
log
.
Trace
(
"marked transaction as failed"
,
"id"
,
id
)
s
.
pendingChannel
.
PushFrame
(
id
,
data
)
s
.
pendingChannel
.
PushFrame
(
id
,
data
[
1
:
])
// strip the version byte
delete
(
s
.
pendingTransactions
,
id
)
}
else
{
s
.
log
.
Warn
(
"unknown transaction marked as failed"
,
"id"
,
id
)
...
...
op-e2e/actions/blocktime_test.go
View file @
42e92639
...
...
@@ -77,7 +77,7 @@ func TestBatchInLastPossibleBlocks(gt *testing.T) {
}
// 8 L1 blocks with 17 L2 blocks is the unsafe state.
// Because we
w
consistently batch submitted we are one epoch behind the unsafe head with the safe head
// Because we consistently batch submitted we are one epoch behind the unsafe head with the safe head
verifyChainStateOnSequencer
(
8
,
17
,
8
,
15
,
7
)
// Create the batch for L2 blocks 16 & 17
...
...
op-service/txmgr/txmgr.go
View file @
42e92639
...
...
@@ -122,6 +122,11 @@ func (m *SimpleTxManager) IncreaseGasPrice(ctx context.Context, tx *types.Transa
gasTipCap
=
tip
}
// Return the same transaction if we don't update any fields.
// We do this because ethereum signatures are not deterministic and therefore the transaction hash will change
// when we re-sign the tx. We don't want to do that because we want to see ErrAlreadyKnown instead of ErrReplacementUnderpriced
var
reusedTip
,
reusedFeeCap
bool
// new = old * (100 + priceBump) / 100
// Enforce a min priceBump on the tip. Do this before the feeCap is calculated
thresholdTip
:=
new
(
big
.
Int
)
.
Mul
(
priceBumpPercent
,
tx
.
GasTipCap
())
...
...
@@ -129,6 +134,7 @@ func (m *SimpleTxManager) IncreaseGasPrice(ctx context.Context, tx *types.Transa
if
tx
.
GasTipCapIntCmp
(
gasTipCap
)
>=
0
{
m
.
l
.
Debug
(
"Reusing the previous tip"
,
"previous"
,
tx
.
GasTipCap
(),
"suggested"
,
gasTipCap
)
gasTipCap
=
tx
.
GasTipCap
()
reusedTip
=
true
}
else
if
thresholdTip
.
Cmp
(
gasTipCap
)
>
0
{
m
.
l
.
Debug
(
"Overriding the tip to enforce a price bump"
,
"previous"
,
tx
.
GasTipCap
(),
"suggested"
,
gasTipCap
,
"new"
,
thresholdTip
)
gasTipCap
=
thresholdTip
...
...
@@ -150,11 +156,16 @@ func (m *SimpleTxManager) IncreaseGasPrice(ctx context.Context, tx *types.Transa
if
tx
.
GasFeeCapIntCmp
(
gasFeeCap
)
>=
0
{
m
.
l
.
Debug
(
"Reusing the previous fee cap"
,
"previous"
,
tx
.
GasFeeCap
(),
"suggested"
,
gasFeeCap
)
gasFeeCap
=
tx
.
GasFeeCap
()
reusedFeeCap
=
true
}
else
if
thresholdFeeCap
.
Cmp
(
gasFeeCap
)
>
0
{
m
.
l
.
Debug
(
"Overriding the fee cap to enforce a price bump"
,
"previous"
,
tx
.
GasFeeCap
(),
"suggested"
,
gasFeeCap
,
"new"
,
thresholdFeeCap
)
gasFeeCap
=
thresholdFeeCap
}
if
reusedTip
&&
reusedFeeCap
{
return
tx
,
nil
}
rawTx
:=
&
types
.
DynamicFeeTx
{
ChainID
:
tx
.
ChainId
(),
Nonce
:
tx
.
Nonce
(),
...
...
op-service/txmgr/txmgr_test.go
View file @
42e92639
...
...
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"math/big"
"math/rand"
"sync"
"testing"
"time"
...
...
@@ -11,9 +12,12 @@ import (
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
opcrypto
"github.com/ethereum-optimism/optimism/op-service/crypto"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
)
...
...
@@ -727,3 +731,42 @@ func TestIncreaseGasPriceUseLargeIncrease(t *testing.T) {
require
.
True
(
t
,
newTx
.
GasFeeCap
()
.
Cmp
(
feeCap
)
==
0
,
"new tx fee cap must be equal L1"
)
require
.
True
(
t
,
newTx
.
GasTipCap
()
.
Cmp
(
borkedBackend
.
gasTip
)
==
0
,
"new tx tip must be equal L1"
)
}
// TestIncreaseGasPriceReusesTransaction asserts that if the L1 basefee & tip remain the
// same, the transaction is returned with the same signature values. The means that the error
// when submitting the transaction to the network is ErrAlreadyKnown instead of ErrReplacementUnderpriced
func
TestIncreaseGasPriceReusesTransaction
(
t
*
testing
.
T
)
{
t
.
Parallel
()
borkedBackend
:=
failingBackend
{
gasTip
:
big
.
NewInt
(
10
),
baseFee
:
big
.
NewInt
(
45
),
}
pk
:=
testutils
.
InsecureRandomKey
(
rand
.
New
(
rand
.
NewSource
(
123
)))
signer
:=
opcrypto
.
PrivateKeySignerFn
(
pk
,
big
.
NewInt
(
10
))
mgr
:=
&
SimpleTxManager
{
Config
:
Config
{
ResubmissionTimeout
:
time
.
Second
,
ReceiptQueryInterval
:
50
*
time
.
Millisecond
,
NumConfirmations
:
1
,
SafeAbortNonceTooLowCount
:
3
,
Signer
:
func
(
ctx
context
.
Context
,
from
common
.
Address
,
tx
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
{
return
signer
(
from
,
tx
)
},
From
:
crypto
.
PubkeyToAddress
(
pk
.
PublicKey
),
},
name
:
"TEST"
,
backend
:
&
borkedBackend
,
l
:
testlog
.
Logger
(
t
,
log
.
LvlCrit
),
}
tx
:=
types
.
NewTx
(
&
types
.
DynamicFeeTx
{
GasTipCap
:
big
.
NewInt
(
10
),
GasFeeCap
:
big
.
NewInt
(
100
),
})
ctx
:=
context
.
Background
()
newTx
,
err
:=
mgr
.
IncreaseGasPrice
(
ctx
,
tx
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
tx
.
Hash
(),
newTx
.
Hash
())
}
packages/atst/README.md
View file @
42e92639
...
...
@@ -38,7 +38,7 @@ The typescript sdk provides a clean [wagmi](https://wagmi.sh/) based interface f
The cli provides a convenient cli for interacting with the attestation station contract
TODO put a gif here of using it

## React API
...
...
packages/atst/assets/README.md
0 → 100644
View file @
42e92639
# Assets
## preview.gif
A gif preview of using the cli
## preview.tape
The script to record the preview.gif with
[
vhs
](
https://github.com/charmbracelet/vhs
)
To execute:
1.
[
Download vhs
](
https://github.com/charmbracelet/vhs
)
2.
Install the local version of atst
```
bash
npm uninstall @eth-optimism/atst
-g
&&
npm i
.
-g
&&
atst
--version
```
3.
Start anvil
```
bash
anvil
--fork-url
https://mainnet.optimism.io
```
4.
Record tape vhs < assets/preview.tape
```
bash
vhs < assets/preview.tape
```
5.
The tape will be outputted to
`assets/preview.gif`
packages/atst/assets/preview.gif
0 → 100644
View file @
42e92639
281 KB
packages/atst/assets/preview.tape
0 → 100644
View file @
42e92639
# VHS File source
# https://github.com/charmbracelet/vhs
#
# Output:
# Output <path>.gif Create a GIF output at the given <path>
# Output <path>.mp4 Create an MP4 output at the given <path>
# Output <path>.webm Create a WebM output at the given <path>
#
# Settings:
# Set FontSize <number> Set the font size of the terminal
# Set FontFamily <string> Set the font family of the terminal
# Set Height <number> Set the height of the terminal
# Set Width <number> Set the width of the terminal
# Set LetterSpacing <float> Set the font letter spacing (tracking)
# Set LineHeight <float> Set the font line height
# Set Theme <string> Set the theme of the terminal (JSON)
# Set Padding <number> Set the padding of the terminal
# Set Framerate <number> Set the framerate of the recording
# Set PlaybackSpeed <float> Set the playback speed of the recording
#
# Sleep:
# Sleep <time> Sleep for a set amount of <time> in seconds
#
# Type:
# Type[@<time>] "<characters>" Type <characters> into the terminal with a
# <time> delay between each character
#
# Keys:
# Backspace[@<time>] [number] Press the Backspace key
# Down[@<time>] [number] Press the Down key
# Enter[@<time>] [number] Press the Enter key
# Space[@<time>] [number] Press the Space key
# Tab[@<time>] [number] Press the Tab key
# Left[@<time>] [number] Press the Left Arrow key
# Right[@<time>] [number] Press the Right Arrow key
# Up[@<time>] [number] Press the Up Arrow key
# Down[@<time>] [number] Press the Down Arrow key
# Ctrl+<key> Press the Control key + <key> (e.g. Ctrl+C)
#
# Display:
# Hide Hide the subsequent commands from the output
# Show Show the subsequent commands in the output
Output assets/preview.gif
Set FontSize 16
Set Width 1920
Set Height 1080
Type "atst write --key attitude --about 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --value 'feeling very optimistic' --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url http://localhost:8545"
Enter
Sleep 2000ms
Type "atst read --key attitude --about 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --creator 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://localhost:8545"
Enter
Sleep 2000ms
Type "atst write --key impress-level --about 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --value 10 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url http://localhost:8545"
Enter
Sleep 2000ms
Type "atst read --key impress-level --about 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --creator 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://localhost:8545"
Enter
Sleep 2000ms
Type "atst --help"
Enter
Sleep 2000ms
packages/atst/docs/cli.md
View file @
42e92639
# atst cli docs

## Installation
```
bash
...
...
packages/atst/docs/sdk.md
View file @
42e92639
...
...
@@ -171,11 +171,6 @@ const attestation = await readAttestations({
* @defaults defaults to the create2 address
*/
contractAddress
,
/**
* Boolean: Whether to allow some of the calls to fail
* Defaults to false
*/
allowFailures
,
})
```
...
...
packages/atst/src/cli.ts
View file @
42e92639
...
...
@@ -15,13 +15,13 @@ cli
.
option
(
'
--creator <string>
'
,
readOptionsValidators
.
creator
.
description
!
)
.
option
(
'
--about <string>
'
,
readOptionsValidators
.
about
.
description
!
)
.
option
(
'
--key <string>
'
,
readOptionsValidators
.
key
.
description
!
)
.
option
(
'
--data-type
[string]
'
,
readOptionsValidators
.
dataType
.
description
!
,
{
.
option
(
'
--data-type
<string>
'
,
readOptionsValidators
.
dataType
.
description
!
,
{
default
:
readOptionsValidators
.
dataType
.
parse
(
undefined
),
})
.
option
(
'
--rpc-url
[url]
'
,
readOptionsValidators
.
rpcUrl
.
description
!
,
{
.
option
(
'
--rpc-url
<url>
'
,
readOptionsValidators
.
rpcUrl
.
description
!
,
{
default
:
readOptionsValidators
.
rpcUrl
.
parse
(
undefined
),
})
.
option
(
'
--contract
[address]
'
,
readOptionsValidators
.
contract
.
description
!
,
{
.
option
(
'
--contract
<address>
'
,
readOptionsValidators
.
contract
.
description
!
,
{
default
:
readOptionsValidators
.
contract
.
parse
(
undefined
),
})
.
example
(
...
...
@@ -52,17 +52,17 @@ cli
'
--private-key <string>
'
,
writeOptionsValidators
.
privateKey
.
description
!
)
.
option
(
'
--data-type
[string]
'
,
readOptionsValidators
.
dataType
.
description
!
,
{
.
option
(
'
--data-type
<string>
'
,
readOptionsValidators
.
dataType
.
description
!
,
{
default
:
writeOptionsValidators
.
dataType
.
parse
(
undefined
),
})
.
option
(
'
--about <string>
'
,
writeOptionsValidators
.
about
.
description
!
)
.
option
(
'
--key <string>
'
,
writeOptionsValidators
.
key
.
description
!
)
.
option
(
'
--value <string>
'
,
writeOptionsValidators
.
value
.
description
!
)
.
option
(
'
--rpc-url
[url]
'
,
writeOptionsValidators
.
rpcUrl
.
description
!
,
{
.
option
(
'
--rpc-url
<url>
'
,
writeOptionsValidators
.
rpcUrl
.
description
!
,
{
default
:
writeOptionsValidators
.
rpcUrl
.
parse
(
undefined
),
})
.
option
(
'
--contract
[address]
'
,
'
--contract
<address>
'
,
writeOptionsValidators
.
contract
.
description
!
,
{
default
:
writeOptionsValidators
.
contract
.
parse
(
undefined
),
...
...
packages/atst/src/lib/readAttestations.ts
View file @
42e92639
...
...
@@ -19,7 +19,6 @@ import { parseAttestationBytes } from './parseAttestationBytes'
* creator: creatorAddress,
* about: aboutAddress,
* key: 'my_key',
* allowFailure: false,
* },
* {
* creator: creatorAddress2,
...
...
@@ -27,7 +26,6 @@ import { parseAttestationBytes } from './parseAttestationBytes'
* key: 'my_key',
* dataType: 'number',
* contractAddress: '0x1234',
* allowFailure: false,
* },
* )
*/
...
...
@@ -40,7 +38,6 @@ export const readAttestations = async (
about
,
key
,
contractAddress
=
ATTESTATION_STATION_ADDRESS
,
allowFailure
=
false
,
}
=
attestation
if
(
key
.
length
>
32
)
{
throw
new
Error
(
...
...
@@ -52,7 +49,6 @@ export const readAttestations = async (
abi
,
functionName
:
'
attestations
'
,
args
:
[
creator
,
about
,
formatBytes32String
(
key
)
as
WagmiBytes
],
allowFailure
,
}
as
const
})
...
...
packages/atst/src/types/AttestationReadParams.ts
View file @
42e92639
...
...
@@ -11,5 +11,4 @@ export interface AttestationReadParams {
key
:
string
dataType
?:
DataTypeOption
contractAddress
?:
Address
allowFailure
?:
boolean
}
specs/README.md
View file @
42e92639
...
...
@@ -14,6 +14,10 @@ that maintains 1:1 compatibility with Ethereum.
-
[
L2 Output Root Proposals
](
proposals.md
)
-
[
Rollup Node
](
rollup-node.md
)
-
[
Rollup Node P2p
](
rollup-node-p2p.md
)
-
[
L2 Chain Derivation
](
derivation.md
)
-
[
Network Upgrades
](
network-upgrades.md
)
-
[
System Config
](
system_config.md
)
-
[
Batch Submitter
](
batcher.md
)
-
[
Guaranteed Gas Market
](
guaranteed-gas-market.md
)
-
[
Messengers
](
messengers.md
)
-
[
Bridges
](
bridges.md
)
...
...
specs/network-upgrades.md
0 → 100644
View file @
42e92639
# Network Upgrades
Network upgrades, also known as forks or hardforks, implement consensus-breaking changes.
These changes are transitioned into deterministically across all nodes through an activation rule.
This document lists the network upgrades of the OP Stack, starting after the Bedrock upgrade.
Prospective upgrades may be listed as proposals, but are not governed through these specifications.
Activation rule parameters of network upgrades are configured in respective chain configurations,
and not part of this specification.
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**
-
[
Activation rules
](
#activation-rules
)
-
[
L2 Block-number based activation
](
#l2-block-number-based-activation
)
-
[
L2 Block-timestamp based activation
](
#l2-block-timestamp-based-activation
)
-
[
Post-Bedrock Network upgrades
](
#post-bedrock-network-upgrades
)
-
[
Regolith
](
#regolith
)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Activation rules
The below L2-block based activation rules may be applied in two contexts:
-
The rollup node, specified through the rollup configuration (known as
`rollup.json`
),
referencing L2 blocks (or block input-attributes) that pass through the derivation pipeline.
-
The execution engine, specified through the chain configuration (known as the
`config`
part of
`genesis.json`
),
referencing blocks or input-attributes that are part of, or applied to, the L2 chain.
### L2 Block-number based activation
Activation rule:
`x != null && x >= upgradeNumber`
Starting at, and including, the L2
`block`
with
`block.number == x`
, the upgrade rules apply.
If the upgrade block-number
`x`
is not specified in the configuration, the upgrade is ignored.
This applies to the L2 block number, not to the L1-origin block number.
This means that an L2 upgrade may be inactive, and then active, without changing the L1-origin.
This block number based method has commonly been used in L1 up until the Bellatrix/Paris upgrade, a.k.a. The Merge,
which was upgraded through special rules.
### L2 Block-timestamp based activation
Activation rule:
`x != null && x >= upgradeTime`
Starting at, and including, the L2
`block`
with
`block.timestamp == x`
, the upgrade rules apply.
If the upgrade block-timestamp
`x`
is not specified in the configuration, the upgrade is ignored.
This applies to the L2 block timestamp, not to the L1-origin block timestamp.
This means that an L2 upgrade may be inactive, and then active, without changing the L1-origin.
This timestamp based method has become the default on L1 after the Bellatrix/Paris upgrade, a.k.a. The Merge,
because it can be planned in accordance with beacon-chain epochs and slots.
Note that the L2 version is not limited to timestamps that match L1 beacon-chain slots or epochs.
A timestamp may be chosen to be synchronous with a specific slot or epoch on L1,
but the matching L1-origin information may not be present at the time of activation on L2.
## Post-Bedrock Network upgrades
### Regolith
The Regolith upgrade, named after a material best described as "deposited dust on top of a layer of bedrock",
implements minor changes to deposit processing, based on reports of the Sherlock Audit-contest and findings in
the Bedrock Optimism Goerli testnet.
Summary of changes:
-
The
`isSystemTx`
boolean is disabled, system transactions now use the same gas accounting rules as regular deposits.
-
The actual deposit gas-usage is recorded in the receipt of the deposit transaction,
and subtracted from the L2 block gas-pool.
Unused gas of deposits is not refunded with ETH however, as it is burned on L1.
-
The
`nonce`
value of the deposit sender account, before the transaction state-transition, is recorded in a new
optional field (
`depositNonce`
), extending the transaction receipt (i.e. not present in pre-Regolith receipts).
-
The recorded deposit
`nonce`
is used to correct the transaction and receipt metadata in RPC responses,
including the
`contractAddress`
field of deposits that deploy contracts.
-
The
`gas`
and
`depositNonce`
data is committed to as part of the consensus-representation of the receipt,
enabling the data to be safely synced between independent L2 nodes.
The
[
deposit specification
](
./deposits.md
)
specifies the changes of the Regolith upgrade in more detail.
The Regolith upgrade uses a
*L2 block-timestamp*
activation-rule, and is specified in both the
rollup-node (
`regolith_time`
) and execution engine (
`config.regolithTime`
).
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