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
cfcbddab
Unverified
Commit
cfcbddab
authored
Mar 17, 2023
by
mergify[bot]
Committed by
GitHub
Mar 17, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into jg/fix_replacement_underpriced
parents
d0adf42e
98bce041
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
220 additions
and
14 deletions
+220
-14
contribute.md
docs/op-stack/src/docs/contribute.md
+3
-3
config.go
op-chain-ops/genesis/config.go
+5
-0
layer_one.go
op-chain-ops/genesis/layer_one.go
+1
-1
test-deploy-config-full.json
op-chain-ops/genesis/testdata/test-deploy-config-full.json
+1
-0
bridge_test.go
op-e2e/bridge_test.go
+120
-0
OptimismPortal.sol
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
+1
-1
devnetL1.json
packages/contracts-bedrock/deploy-config/devnetL1.json
+1
-0
final-migration-rehearsal.json
...acts-bedrock/deploy-config/final-migration-rehearsal.json
+1
-0
getting-started.json
...ages/contracts-bedrock/deploy-config/getting-started.json
+1
-0
goerli-forked.json
packages/contracts-bedrock/deploy-config/goerli-forked.json
+1
-0
goerli.json
packages/contracts-bedrock/deploy-config/goerli.json
+1
-0
hardhat.json
packages/contracts-bedrock/deploy-config/hardhat.json
+1
-0
internal-devnet.json
...ages/contracts-bedrock/deploy-config/internal-devnet.json
+1
-0
013-OptimismPortalImpl.ts
packages/contracts-bedrock/deploy/013-OptimismPortalImpl.ts
+7
-9
deploy-config.ts
packages/contracts-bedrock/src/deploy-config.ts
+9
-0
@changesets+cli+2.26.0.patch
patches/@changesets+cli+2.26.0.patch
+66
-0
No files found.
docs/op-stack/src/docs/contribute.md
View file @
cfcbddab
---
title
:
Contribute to OP Stack
title
:
Contribute to
the
OP Stack
lang
:
en-US
---
...
...
op-chain-ops/genesis/config.go
View file @
cfcbddab
...
...
@@ -76,6 +76,8 @@ type DeployConfig struct {
ProxyAdminOwner
common
.
Address
`json:"proxyAdminOwner"`
// Owner of the system on L1
FinalSystemOwner
common
.
Address
`json:"finalSystemOwner"`
// GUARDIAN account in the OptimismPortal
PortalGuardian
common
.
Address
`json:"portalGuardian"`
// L1 recipient of fees accumulated in the BaseFeeVault
BaseFeeVaultRecipient
common
.
Address
`json:"baseFeeVaultRecipient"`
// L1 recipient of fees accumulated in the L1FeeVault
...
...
@@ -128,6 +130,9 @@ func (d *DeployConfig) Check() error {
if
d
.
FinalizationPeriodSeconds
==
0
{
return
fmt
.
Errorf
(
"%w: FinalizationPeriodSeconds cannot be 0"
,
ErrInvalidDeployConfig
)
}
if
d
.
PortalGuardian
==
(
common
.
Address
{})
{
return
fmt
.
Errorf
(
"%w: PortalGuardian cannot be address(0)"
,
ErrInvalidDeployConfig
)
}
if
d
.
MaxSequencerDrift
==
0
{
return
fmt
.
Errorf
(
"%w: MaxSequencerDrift cannot be 0"
,
ErrInvalidDeployConfig
)
}
...
...
op-chain-ops/genesis/layer_one.go
View file @
cfcbddab
...
...
@@ -295,7 +295,7 @@ func deployL1Contracts(config *DeployConfig, backend *backends.SimulatedBackend)
Name
:
"OptimismPortal"
,
Args
:
[]
interface
{}{
predeploys
.
DevL2OutputOracleAddr
,
config
.
FinalSystemOwner
,
config
.
PortalGuardian
,
true
,
// _paused
},
},
...
...
op-chain-ops/genesis/testdata/test-deploy-config-full.json
View file @
cfcbddab
...
...
@@ -19,6 +19,7 @@
"l1GenesisBlockGasLimit"
:
"0xe4e1c0"
,
"l1GenesisBlockDifficulty"
:
"0x1"
,
"finalSystemOwner"
:
"0x0000000000000000000000000000000000000111"
,
"portalGuardian"
:
"0x0000000000000000000000000000000000000112"
,
"finalizationPeriodSeconds"
:
2
,
"l1GenesisBlockMixHash"
:
"0x0000000000000000000000000000000000000000000000000000000000000000"
,
"l1GenesisBlockCoinbase"
:
"0x0000000000000000000000000000000000000000"
,
...
...
op-e2e/bridge_test.go
0 → 100644
View file @
cfcbddab
package
op_e2e
import
(
"math"
"math/big"
"testing"
"time"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/stretchr/testify/require"
)
// TestERC20BridgeDeposits tests the the L1StandardBridge bridge ERC20
// functionality.
func
TestERC20BridgeDeposits
(
t
*
testing
.
T
)
{
parallel
(
t
)
if
!
verboseGethNodes
{
log
.
Root
()
.
SetHandler
(
log
.
DiscardHandler
())
}
cfg
:=
DefaultSystemConfig
(
t
)
sys
,
err
:=
cfg
.
Start
()
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
log
:=
testlog
.
Logger
(
t
,
log
.
LvlInfo
)
log
.
Info
(
"genesis"
,
"l2"
,
sys
.
RollupConfig
.
Genesis
.
L2
,
"l1"
,
sys
.
RollupConfig
.
Genesis
.
L1
,
"l2_time"
,
sys
.
RollupConfig
.
Genesis
.
L2Time
)
l1Client
:=
sys
.
Clients
[
"l1"
]
l2Client
:=
sys
.
Clients
[
"sequencer"
]
opts
,
err
:=
bind
.
NewKeyedTransactorWithChainID
(
sys
.
cfg
.
Secrets
.
Alice
,
cfg
.
L1ChainIDBig
())
require
.
Nil
(
t
,
err
)
// Deploy WETH9
weth9Address
,
tx
,
WETH9
,
err
:=
bindings
.
DeployWETH9
(
opts
,
l1Client
)
require
.
NoError
(
t
,
err
)
_
,
err
=
waitForTransaction
(
tx
.
Hash
(),
l1Client
,
3
*
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
)
*
time
.
Second
)
require
.
NoError
(
t
,
err
,
"Waiting for deposit tx on L1"
)
// Get some WETH
opts
.
Value
=
big
.
NewInt
(
params
.
Ether
)
tx
,
err
=
WETH9
.
Fallback
(
opts
,
[]
byte
{})
require
.
NoError
(
t
,
err
)
_
,
err
=
waitForTransaction
(
tx
.
Hash
(),
l1Client
,
3
*
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
)
*
time
.
Second
)
require
.
NoError
(
t
,
err
)
opts
.
Value
=
nil
wethBalance
,
err
:=
WETH9
.
BalanceOf
(
&
bind
.
CallOpts
{},
opts
.
From
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
big
.
NewInt
(
params
.
Ether
),
wethBalance
)
// Deploy L2 WETH9
l2Opts
,
err
:=
bind
.
NewKeyedTransactorWithChainID
(
sys
.
cfg
.
Secrets
.
Alice
,
cfg
.
L2ChainIDBig
())
require
.
NoError
(
t
,
err
)
optimismMintableTokenFactory
,
err
:=
bindings
.
NewOptimismMintableERC20Factory
(
predeploys
.
OptimismMintableERC20FactoryAddr
,
l2Client
)
require
.
NoError
(
t
,
err
)
tx
,
err
=
optimismMintableTokenFactory
.
CreateOptimismMintableERC20
(
l2Opts
,
weth9Address
,
"L2-WETH"
,
"L2-WETH"
)
require
.
NoError
(
t
,
err
)
_
,
err
=
waitForTransaction
(
tx
.
Hash
(),
l2Client
,
3
*
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
)
*
time
.
Second
)
require
.
NoError
(
t
,
err
)
// Get the deployment event to have access to the L2 WETH9 address
it
,
err
:=
optimismMintableTokenFactory
.
FilterOptimismMintableERC20Created
(
&
bind
.
FilterOpts
{
Start
:
0
},
nil
,
nil
)
require
.
NoError
(
t
,
err
)
var
event
*
bindings
.
OptimismMintableERC20FactoryOptimismMintableERC20Created
for
it
.
Next
()
{
event
=
it
.
Event
}
require
.
NotNil
(
t
,
event
)
// Approve WETH9 with the bridge
tx
,
err
=
WETH9
.
Approve
(
opts
,
predeploys
.
DevL1StandardBridgeAddr
,
new
(
big
.
Int
)
.
SetUint64
(
math
.
MaxUint64
))
require
.
NoError
(
t
,
err
)
_
,
err
=
waitForTransaction
(
tx
.
Hash
(),
l1Client
,
3
*
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
)
*
time
.
Second
)
require
.
NoError
(
t
,
err
)
// Bridge the WETH9
l1StandardBridge
,
err
:=
bindings
.
NewL1StandardBridge
(
predeploys
.
DevL1StandardBridgeAddr
,
l1Client
)
require
.
NoError
(
t
,
err
)
tx
,
err
=
l1StandardBridge
.
BridgeERC20
(
opts
,
weth9Address
,
event
.
LocalToken
,
big
.
NewInt
(
100
),
100000
,
[]
byte
{})
require
.
NoError
(
t
,
err
)
depositReceipt
,
err
:=
waitForTransaction
(
tx
.
Hash
(),
l1Client
,
3
*
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
)
*
time
.
Second
)
require
.
NoError
(
t
,
err
)
t
.
Log
(
"Deposit through L1StandardBridge"
,
"gas used"
,
depositReceipt
.
GasUsed
)
// compute the deposit transaction hash + poll for it
portal
,
err
:=
bindings
.
NewOptimismPortal
(
predeploys
.
DevOptimismPortalAddr
,
l1Client
)
require
.
NoError
(
t
,
err
)
depIt
,
err
:=
portal
.
FilterTransactionDeposited
(
&
bind
.
FilterOpts
{
Start
:
0
},
nil
,
nil
,
nil
)
require
.
NoError
(
t
,
err
)
var
depositEvent
*
bindings
.
OptimismPortalTransactionDeposited
for
depIt
.
Next
()
{
depositEvent
=
depIt
.
Event
}
require
.
NotNil
(
t
,
depositEvent
)
depositTx
,
err
:=
derive
.
UnmarshalDepositLogEvent
(
&
depositEvent
.
Raw
)
require
.
NoError
(
t
,
err
)
_
,
err
=
waitForTransaction
(
types
.
NewTx
(
depositTx
)
.
Hash
(),
l2Client
,
3
*
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
)
*
time
.
Second
)
require
.
NoError
(
t
,
err
)
// Ensure that the deposit went through
optimismMintableToken
,
err
:=
bindings
.
NewOptimismMintableERC20
(
event
.
LocalToken
,
l2Client
)
require
.
NoError
(
t
,
err
)
// Should have balance on L2
l2Balance
,
err
:=
optimismMintableToken
.
BalanceOf
(
&
bind
.
CallOpts
{},
opts
.
From
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
l2Balance
,
big
.
NewInt
(
100
))
}
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
View file @
cfcbddab
...
...
@@ -49,7 +49,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
L2OutputOracle public immutable L2_ORACLE;
/**
* @notice Address that has the ability to pause and unpause
deposits and
withdrawals.
* @notice Address that has the ability to pause and unpause withdrawals.
*/
address public immutable GUARDIAN;
...
...
packages/contracts-bedrock/deploy-config/devnetL1.json
View file @
cfcbddab
...
...
@@ -20,6 +20,7 @@
"sequencerFeeVaultRecipient"
:
"0xfabb0ac9d68b0b445fb7357272ff202c5651694a"
,
"proxyAdminOwner"
:
"0xBcd4042DE499D14e55001CcbB24a551F3b954096"
,
"finalSystemOwner"
:
"0xBcd4042DE499D14e55001CcbB24a551F3b954096"
,
"portalGuardian"
:
"0xBcd4042DE499D14e55001CcbB24a551F3b954096"
,
"controller"
:
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
,
"finalizationPeriodSeconds"
:
2
,
"deploymentWaitConfirmations"
:
1
,
...
...
packages/contracts-bedrock/deploy-config/final-migration-rehearsal.json
View file @
cfcbddab
{
"finalSystemOwner"
:
"0x62790eFcB3a5f3A5D398F95B47930A9Addd83807"
,
"portalGuardian"
:
"0x62790eFcB3a5f3A5D398F95B47930A9Addd83807"
,
"controller"
:
"0x2d30335B0b807bBa1682C487BaAFD2Ad6da5D675"
,
"l1StartingBlockTag"
:
"0x4104895a540d87127ff11eef0d51d8f63ce00a6fc211db751a45a4b3a61a9c83"
,
...
...
packages/contracts-bedrock/deploy-config/getting-started.json
View file @
cfcbddab
...
...
@@ -2,6 +2,7 @@
"numDeployConfirmations"
:
1
,
"finalSystemOwner"
:
"ADMIN"
,
"portalGuardian"
:
"ADMIN"
,
"controller"
:
"ADMIN"
,
"l1StartingBlockTag"
:
"BLOCKHASH"
,
...
...
packages/contracts-bedrock/deploy-config/goerli-forked.json
View file @
cfcbddab
{
"finalSystemOwner"
:
"0x62790eFcB3a5f3A5D398F95B47930A9Addd83807"
,
"portalGuardian"
:
"0x62790eFcB3a5f3A5D398F95B47930A9Addd83807"
,
"controller"
:
"0x2d30335B0b807bBa1682C487BaAFD2Ad6da5D675"
,
"l1StartingBlockTag"
:
"0x4104895a540d87127ff11eef0d51d8f63ce00a6fc211db751a45a4b3a61a9c83"
,
...
...
packages/contracts-bedrock/deploy-config/goerli.json
View file @
cfcbddab
...
...
@@ -2,6 +2,7 @@
"numDeployConfirmations"
:
1
,
"finalSystemOwner"
:
"0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f"
,
"portalGuardian"
:
"0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f"
,
"controller"
:
"0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f"
,
"l1StartingBlockTag"
:
"0x6ffc1bf3754c01f6bb9fe057c1578b87a8571ce2e9be5ca14bace6eccfd336c7"
,
...
...
packages/contracts-bedrock/deploy-config/hardhat.json
View file @
cfcbddab
{
"finalSystemOwner"
:
"0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc"
,
"portalGuardian"
:
"0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc"
,
"controller"
:
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
,
"l1StartingBlockTag"
:
"earliest"
,
...
...
packages/contracts-bedrock/deploy-config/internal-devnet.json
View file @
cfcbddab
{
"finalSystemOwner"
:
"0x858F0751ef8B4067f0d2668C076BDB50a8549fbF"
,
"portalGuardian"
:
"0x858F0751ef8B4067f0d2668C076BDB50a8549fbF"
,
"controller"
:
"0x2d30335B0b807bBa1682C487BaAFD2Ad6da5D675"
,
"l1StartingBlockTag"
:
"0x19c7e6b18fe156e45f4cfef707294fd8f079fa9c30a7b7cd6ec1ce3682ec6a2e"
,
...
...
packages/contracts-bedrock/deploy/013-OptimismPortalImpl.ts
View file @
cfcbddab
...
...
@@ -17,13 +17,11 @@ const deployFn: DeployFunction = async (hre) => {
'
L2OutputOracleProxy
'
)
const
finalSystemOwner
=
hre
.
deployConfig
.
finalSystemOwner
const
finalSystemOwnerCode
=
await
hre
.
ethers
.
provider
.
getCode
(
finalSystemOwner
)
if
(
finalSystemOwnerCode
===
'
0x
'
)
{
const
portalGuardian
=
hre
.
deployConfig
.
portalGuardian
const
portalGuardianCode
=
await
hre
.
ethers
.
provider
.
getCode
(
portalGuardian
)
if
(
portalGuardianCode
===
'
0x
'
)
{
console
.
log
(
`WARNING: setting OptimismPortal.GUARDIAN to
${
finalSystemOwner
}
and it has no code`
`WARNING: setting OptimismPortal.GUARDIAN to
${
portalGuardian
}
and it has no code`
)
if
(
!
isLiveDeployer
)
{
throw
new
Error
(
...
...
@@ -35,13 +33,13 @@ const deployFn: DeployFunction = async (hre) => {
// Deploy the OptimismPortal implementation as paused to
// ensure that users do not interact with it and instead
// interact with the proxied contract.
// The `
finalSystemOwner
` is set at the GUARDIAN.
// The `
portalGuardian
` is set at the GUARDIAN.
await
deploy
({
hre
,
name
:
'
OptimismPortal
'
,
args
:
[
L2OutputOracleProxy
.
address
,
finalSystemOwner
,
portalGuardian
,
true
,
// paused
],
postDeployAction
:
async
(
contract
)
=>
{
...
...
@@ -53,7 +51,7 @@ const deployFn: DeployFunction = async (hre) => {
await
assertContractVariable
(
contract
,
'
GUARDIAN
'
,
hre
.
deployConfig
.
finalSystemOwner
hre
.
deployConfig
.
portalGuardian
)
},
})
...
...
packages/contracts-bedrock/src/deploy-config.ts
View file @
cfcbddab
...
...
@@ -14,6 +14,12 @@ interface RequiredDeployConfig {
*/
finalSystemOwner
?:
string
/**
* Address that is deployed as the GUARDIAN in the OptimismPortal. Has the
* ability to pause withdrawals.
*/
portalGuardian
:
string
/**
* Address that will own the entire system on L1 during the deployment process. This address will
* not own the system after the deployment is complete, ownership will be transferred to the
...
...
@@ -181,6 +187,9 @@ export const deployConfigSpec: {
finalSystemOwner
:
{
type
:
'
address
'
,
},
portalGuardian
:
{
type
:
'
address
'
,
},
controller
:
{
type
:
'
address
'
,
},
...
...
patches/@changesets+cli+2.26.0.patch
0 → 100644
View file @
cfcbddab
diff --git a/node_modules/@changesets/cli/dist/cli.cjs.dev.js b/node_modules/@changesets/cli/dist/cli.cjs.dev.js
index b158219..6fdfb6e 100644
--- a/node_modules/@changesets/cli/dist/cli.cjs.dev.js
+++ b/node_modules/@changesets/cli/dist/cli.cjs.dev.js
@@ -937,7 +937,7 @@
async function publishPackages({
}) {
const packagesByName = new Map(packages.map(x => [x.packageJson.name, x]));
const publicPackages = packages.filter(pkg => !pkg.packageJson.private);
- const unpublishedPackagesInfo = await getUnpublishedPackages(publicPackages, preState);
+ const unpublishedPackagesInfo = await getUnpublishedPackages(packages, preState);
if (unpublishedPackagesInfo.length === 0) {
return [];
@@ -957,20 +957,27 @@
async function publishAPackage(pkg, access, twoFactorState, tag) {
const {
name,
version,
- publishConfig
+ publishConfig,
+ private: isPrivate
} = pkg.packageJson;
const localAccess = publishConfig === null || publishConfig === void 0 ? void 0 : publishConfig.access;
- logger.info(`Publishing ${chalk__default['default'].cyan(`"${name}"`)} at ${chalk__default['default'].green(`"${version}"`)}`);
- const publishDir = publishConfig !== null && publishConfig !== void 0 && publishConfig.directory ? path.join(pkg.dir, publishConfig.directory) : pkg.dir;
- const publishConfirmation = await publish(name, {
- cwd: publishDir,
- access: localAccess || access,
- tag
- }, twoFactorState);
+ let published;
+ if (!isPrivate) {
+ logger.info(`Publishing ${chalk__default['default'].cyan(`"${name}"`)} at ${chalk__default['default'].green(`"${version}"`)}`);
+ const publishDir = publishConfig !== null && publishConfig !== void 0 && publishConfig.directory ? path.join(pkg.dir, publishConfig.directory) : pkg.dir;
+ const publishConfirmation = await publish(name, {
+ cwd: publishDir,
+ access: localAccess || access,
+ tag
+ }, twoFactorState);
+ published = publishConfirmation.published;
+ } else {
+ published = true;
+ }
return {
name,
newVersion: version,
- published: publishConfirmation.published
+ published
};
}
@@ -1140,8 +1147,13 @@ async function tagPublish(tool, packageReleases, cwd) {
if (tool !== "root") {
for (const pkg of packageReleases) {
const tag = `${pkg.name}@${pkg.newVersion}`;
- logger.log("New tag: ", tag);
- await git.tag(tag, cwd);
+ const allTags = await git.getAllTags(cwd);
+ if (allTags.has(tag)) {
+ logger.log("Skipping existing tag: ", tag);
+ } else {
+ logger.log("New tag: ", tag);
+ await git.tag(tag, cwd);
+ }
}
} else {
const tag = `v${packageReleases[0].newVersion}`;
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