Commit 1d23f3be authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

Merge branch 'develop' into fix/docker-config

parents abee3245 f05ab6b6
---
'@eth-optimism/contracts-bedrock': patch
---
Fix slither script
---
'@eth-optimism/hardhat-deploy-config': patch
---
Support JSON-formatted deploy configs
---
'@eth-optimism/foundry': patch
---
Update to 64fe4acc97e6d76551cea7598c201f05ecd65639
---
'@eth-optimism/sdk': minor
---
Add wstETH to sdk
...@@ -141,7 +141,7 @@ jobs: ...@@ -141,7 +141,7 @@ jobs:
name: gas snapshot name: gas snapshot
command: | command: |
forge --version forge --version
forge snapshot --check || exit 0 forge snapshot --check
environment: environment:
FOUNDRY_PROFILE: ci FOUNDRY_PROFILE: ci
working_directory: packages/contracts-bedrock working_directory: packages/contracts-bedrock
......
...@@ -2,6 +2,7 @@ steps: ...@@ -2,6 +2,7 @@ steps:
- name: 'gcr.io/kaniko-project/executor:latest' - name: 'gcr.io/kaniko-project/executor:latest'
args: args:
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-node:$_TAG - --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-node:$_TAG
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-proposer:$COMMIT_SHA
- --dockerfile=op-node/Dockerfile - --dockerfile=op-node/Dockerfile
- --cache=true - --cache=true
- --cache-ttl=48h - --cache-ttl=48h
...@@ -9,6 +10,7 @@ steps: ...@@ -9,6 +10,7 @@ steps:
- name: 'gcr.io/kaniko-project/executor:latest' - name: 'gcr.io/kaniko-project/executor:latest'
args: args:
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-batcher:$_TAG - --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-batcher:$_TAG
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-proposer:$COMMIT_SHA
- --dockerfile=./op-batcher/Dockerfile - --dockerfile=./op-batcher/Dockerfile
- --cache=true - --cache=true
- --cache-ttl=48h - --cache-ttl=48h
...@@ -16,6 +18,7 @@ steps: ...@@ -16,6 +18,7 @@ steps:
- name: 'gcr.io/kaniko-project/executor:latest' - name: 'gcr.io/kaniko-project/executor:latest'
args: args:
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-proposer:$_TAG - --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-proposer:$_TAG
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-proposer:$COMMIT_SHA
- --dockerfile=./op-proposer/Dockerfile - --dockerfile=./op-proposer/Dockerfile
- --cache=true - --cache=true
- --cache-ttl=48h - --cache-ttl=48h
...@@ -23,6 +26,7 @@ steps: ...@@ -23,6 +26,7 @@ steps:
- name: 'gcr.io/kaniko-project/executor:latest' - name: 'gcr.io/kaniko-project/executor:latest'
args: args:
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/deployer-bedrock:$_TAG - --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/deployer-bedrock:$_TAG
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/deployer-bedrock:$COMMIT_SHA
- --dockerfile=./ops/docker/Dockerfile.packages - --dockerfile=./ops/docker/Dockerfile.packages
- --target=deployer-bedrock - --target=deployer-bedrock
- --cache=true - --cache=true
......
...@@ -9,7 +9,7 @@ WORKDIR /opt/foundry ...@@ -9,7 +9,7 @@ WORKDIR /opt/foundry
# Only diff from upstream docker image is this clone instead # Only diff from upstream docker image is this clone instead
# of COPY. We select a specific commit to use. # of COPY. We select a specific commit to use.
RUN git clone https://github.com/foundry-rs/foundry.git . \ RUN git clone https://github.com/foundry-rs/foundry.git . \
&& git checkout 3c49efe58ca4bdeec4729490501da06914446405 && git checkout 64fe4acc97e6d76551cea7598c201f05ecd65639
RUN source $HOME/.profile && cargo build --release \ RUN source $HOME/.profile && cargo build --release \
&& strip /opt/foundry/target/release/forge \ && strip /opt/foundry/target/release/forge \
......
...@@ -95,7 +95,7 @@ L2OutputOracleTest:test_updateOwner() (gas: 34619) ...@@ -95,7 +95,7 @@ L2OutputOracleTest:test_updateOwner() (gas: 34619)
L2OutputOracleUpgradeable_Test:test_cannotInitImpl() (gas: 19555) L2OutputOracleUpgradeable_Test:test_cannotInitImpl() (gas: 19555)
L2OutputOracleUpgradeable_Test:test_cannotInitProxy() (gas: 24554) L2OutputOracleUpgradeable_Test:test_cannotInitProxy() (gas: 24554)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy() (gas: 39086) L2OutputOracleUpgradeable_Test:test_initValuesOnProxy() (gas: 39086)
L2OutputOracleUpgradeable_Test:test_upgrading() (gas: 230843) L2OutputOracleUpgradeable_Test:test_upgrading() (gas: 180632)
L2StandardBridge_Test:test_ERC20BridgeFailed_whenLocalTokenIsBridge() (gas: 134358) L2StandardBridge_Test:test_ERC20BridgeFailed_whenLocalTokenIsBridge() (gas: 134358)
L2StandardBridge_Test:test_cannotWithdrawEthWithoutSendingIt() (gas: 21619) L2StandardBridge_Test:test_cannotWithdrawEthWithoutSendingIt() (gas: 21619)
L2StandardBridge_Test:test_finalizeBridgeERC20FailSendBack() (gas: 499449) L2StandardBridge_Test:test_finalizeBridgeERC20FailSendBack() (gas: 499449)
...@@ -131,10 +131,10 @@ OptimismMintableTokenFactory_Test:test_bridge() (gas: 7663) ...@@ -131,10 +131,10 @@ OptimismMintableTokenFactory_Test:test_bridge() (gas: 7663)
OptimismMintableTokenFactory_Test:test_createStandardL2Token() (gas: 1112929) OptimismMintableTokenFactory_Test:test_createStandardL2Token() (gas: 1112929)
OptimismMintableTokenFactory_Test:test_createStandardL2TokenSameTwice() (gas: 2208763) OptimismMintableTokenFactory_Test:test_createStandardL2TokenSameTwice() (gas: 2208763)
OptimismMintableTokenFactory_Test:test_createStandardL2TokenShouldRevertIfRemoteIsZero() (gas: 9398) OptimismMintableTokenFactory_Test:test_createStandardL2TokenShouldRevertIfRemoteIsZero() (gas: 9398)
OptimismPortalUpgradeable_Test:test_cannotInitImpl() (gas: 10686) OptimismPortalUpgradeable_Test:test_cannotInitImpl() (gas: 10813)
OptimismPortalUpgradeable_Test:test_cannotInitProxy() (gas: 15662) OptimismPortalUpgradeable_Test:test_cannotInitProxy() (gas: 15789)
OptimismPortalUpgradeable_Test:test_initValuesOnProxy() (gas: 15967) OptimismPortalUpgradeable_Test:test_initValuesOnProxy() (gas: 15967)
OptimismPortalUpgradeable_Test:test_upgrading() (gas: 230843) OptimismPortalUpgradeable_Test:test_upgrading() (gas: 180632)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_revertsOnInsufficientGas() (gas: 160743) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_revertsOnInsufficientGas() (gas: 160743)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_revertsOnInvalidOutputRootProof() (gas: 81241) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_revertsOnInvalidOutputRootProof() (gas: 81241)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_revertsOnRecentWithdrawal() (gas: 53001) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_revertsOnRecentWithdrawal() (gas: 53001)
...@@ -272,7 +272,7 @@ ResourceMetering_Test:test_updateParamsNoChange() (gas: 13956) ...@@ -272,7 +272,7 @@ ResourceMetering_Test:test_updateParamsNoChange() (gas: 13956)
ResourceMetering_Test:test_updateTenEmptyBlocks() (gas: 20571) ResourceMetering_Test:test_updateTenEmptyBlocks() (gas: 20571)
ResourceMetering_Test:test_updateTwoEmptyBlocks() (gas: 20594) ResourceMetering_Test:test_updateTwoEmptyBlocks() (gas: 20594)
ResourceMetering_Test:test_useMaxSucceeds() (gas: 8017134) ResourceMetering_Test:test_useMaxSucceeds() (gas: 8017134)
ResourceMetering_Test:test_useMoreThanMaxReverts() (gas: 16047) ResourceMetering_Test:test_useMoreThanMaxReverts() (gas: 16058)
Semver_Test:test_behindProxy() (gas: 506906) Semver_Test:test_behindProxy() (gas: 506906)
Semver_Test:test_version() (gas: 9487) Semver_Test:test_version() (gas: 9487)
SequencerFeeVault_Test:test_constructor() (gas: 7678) SequencerFeeVault_Test:test_constructor() (gas: 7678)
......
...@@ -10,7 +10,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -10,7 +10,7 @@ const deployFn: DeployFunction = async (hre) => {
const { deployer } = await hre.getNamedAccounts() const { deployer } = await hre.getNamedAccounts()
const { deployConfig } = hre const { deployConfig } = hre
const l1 = hre.ethers.getDefaultProvider() const l1 = hre.ethers.provider
const l1StartingBlock = await l1.getBlock(deployConfig.l1StartingBlockTag) const l1StartingBlock = await l1.getBlock(deployConfig.l1StartingBlockTag)
if (l1StartingBlock === null) { if (l1StartingBlock === null) {
throw new Error(`Cannot fetch block tag ${deployConfig.l1StartingBlockTag}`) throw new Error(`Cannot fetch block tag ${deployConfig.l1StartingBlockTag}`)
......
...@@ -16,6 +16,7 @@ remappings = [ ...@@ -16,6 +16,7 @@ remappings = [
extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout'] extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout']
bytecode_hash = 'none' bytecode_hash = 'none'
build_info = true build_info = true
build_info_path = 'artifacts/build-info'
ffi = true ffi = true
fuzz_runs = 16 fuzz_runs = 16
......
...@@ -46,6 +46,11 @@ const config: HardhatUserConfig = { ...@@ -46,6 +46,11 @@ const config: HardhatUserConfig = {
url: process.env.L1_RPC || '', url: process.env.L1_RPC || '',
accounts: [process.env.PRIVATE_KEY_DEPLOYER || ethers.constants.HashZero], accounts: [process.env.PRIVATE_KEY_DEPLOYER || ethers.constants.HashZero],
}, },
deployer: {
chainId: Number(process.env.CHAIN_ID),
url: process.env.L1_RPC || '',
accounts: [process.env.PRIVATE_KEY_DEPLOYER || ethers.constants.HashZero],
},
}, },
foundry: { foundry: {
buildInfo: true, buildInfo: true,
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
"@rari-capital/solmate": "https://github.com/rari-capital/solmate.git#8f9b23f8838670afda0fd8983f2c41e8037ae6bc", "@rari-capital/solmate": "https://github.com/rari-capital/solmate.git#8f9b23f8838670afda0fd8983f2c41e8037ae6bc",
"ds-test": "https://github.com/dapphub/ds-test.git#9310e879db8ba3ea6d5c6489a579118fd264a3f5", "ds-test": "https://github.com/dapphub/ds-test.git#9310e879db8ba3ea6d5c6489a579118fd264a3f5",
"ethers": "^5.6.8", "ethers": "^5.6.8",
"excessively-safe-call": "https://github.com/nomad-xyz/ExcessivelySafeCall.git#4fcdfd3593d21381f696c790fa6180b8ef559c1e", "excessively-safe-call": "https://github.com/nomad-xyz/ExcessivelySafeCall.git#81cd99ce3e69117d665d7601c330ea03b97acce0",
"forge-std": "https://github.com/foundry-rs/forge-std.git#f18682b2874fc57d7c80a511fed0b35ec4201ffa", "forge-std": "https://github.com/foundry-rs/forge-std.git#f18682b2874fc57d7c80a511fed0b35ec4201ffa",
"hardhat": "^2.9.6" "hardhat": "^2.9.6"
}, },
......
#!/bin/bash #!/bin/bash
if [ ! -d forge-artifacts/build-info ]; then rm -rf artifacts forge-artifacts
npx hardhat compile
fi # Handle slither bug unable to work with the foundry tests
TEMP=$(mktemp -d)
mv contracts/test $TEMP/test
cp -rf forge-artifacts/build-info artifacts/build-info
slither . slither .
mv $TEMP/test contracts/test
import * as path from 'path' import * as path from 'path'
import * as fs from 'fs'
import { extendEnvironment, extendConfig } from 'hardhat/config' import { extendEnvironment, extendConfig } from 'hardhat/config'
import { import {
...@@ -28,9 +29,16 @@ const normalizePath = ( ...@@ -28,9 +29,16 @@ const normalizePath = (
export const loadDeployConfig = (hre: HardhatRuntimeEnvironment): any => { export const loadDeployConfig = (hre: HardhatRuntimeEnvironment): any => {
let config: any let config: any
try { try {
config = const base = `${hre.config.paths.deployConfig}/${hre.network.name}`
if (fs.existsSync(`${base}.ts`)) {
// eslint-disable-next-line @typescript-eslint/no-var-requires // eslint-disable-next-line @typescript-eslint/no-var-requires
require(`${hre.config.paths.deployConfig}/${hre.network.name}.ts`).default config = require(`${base}.ts`).default
} else if (fs.existsSync(`${base}.json`)) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
config = require(`${base}.json`)
} else {
throw new Error('not found')
}
} catch (err) { } catch (err) {
throw new Error( throw new Error(
`error while loading deploy config for network: ${hre.network.name}, ${err}` `error while loading deploy config for network: ${hre.network.name}, ${err}`
......
...@@ -145,6 +145,11 @@ export const BRIDGE_ADAPTER_DATA: { ...@@ -145,6 +145,11 @@ export const BRIDGE_ADAPTER_DATA: {
}, },
}, },
[L2ChainID.OPTIMISM_KOVAN]: { [L2ChainID.OPTIMISM_KOVAN]: {
wstETH: {
Adapter: StandardBridgeAdapter,
l1Bridge: '0xa88751C0a08623E11ff38c6B70F2BbEe7865C17c' as const,
l2Bridge: '0xF9C842dE4381a70eB265d10CF8D43DceFF5bA935' as const,
},
BitBTC: { BitBTC: {
Adapter: StandardBridgeAdapter, Adapter: StandardBridgeAdapter,
l1Bridge: '0x0b651A42F32069d62d5ECf4f2a7e5Bd3E9438746' as const, l1Bridge: '0x0b651A42F32069d62d5ECf4f2a7e5Bd3E9438746' as const,
......
...@@ -8529,9 +8529,9 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: ...@@ -8529,9 +8529,9 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3:
md5.js "^1.3.4" md5.js "^1.3.4"
safe-buffer "^5.1.1" safe-buffer "^5.1.1"
"excessively-safe-call@https://github.com/nomad-xyz/ExcessivelySafeCall.git#4fcdfd3593d21381f696c790fa6180b8ef559c1e": "excessively-safe-call@https://github.com/nomad-xyz/ExcessivelySafeCall.git#81cd99ce3e69117d665d7601c330ea03b97acce0":
version "0.0.1-rc.1" version "0.0.1-rc.1"
resolved "https://github.com/nomad-xyz/ExcessivelySafeCall.git#4fcdfd3593d21381f696c790fa6180b8ef559c1e" resolved "https://github.com/nomad-xyz/ExcessivelySafeCall.git#81cd99ce3e69117d665d7601c330ea03b97acce0"
execa@^0.7.0: execa@^0.7.0:
version "0.7.0" version "0.7.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment