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
a7cfdeb1
Unverified
Commit
a7cfdeb1
authored
Dec 07, 2022
by
Maurelian
Committed by
GitHub
Dec 07, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4165 from ethereum-optimism/jm/echidna-aliasing
parents
0ac00985
1594678e
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
89 additions
and
32 deletions
+89
-32
healthy-teachers-stare.md
.changeset/healthy-teachers-stare.md
+6
-0
neat-terms-buy.md
.changeset/neat-terms-buy.md
+5
-0
config.yml
.circleci/config.yml
+25
-24
.gitignore
.gitignore
+3
-0
codecov.yml
codecov.yml
+1
-0
Dockerfile
ops/docker/ci-builder/Dockerfile
+1
-1
FuzzAddressAliasing.sol
...ntracts-bedrock/contracts/echidna/FuzzAddressAliasing.sol
+33
-0
echidna.yaml
packages/contracts-bedrock/echidna.yaml
+6
-0
foundry.toml
packages/contracts-bedrock/foundry.toml
+2
-0
package.json
packages/contracts-bedrock/package.json
+7
-7
No files found.
.changeset/healthy-teachers-stare.md
0 → 100644
View file @
a7cfdeb1
---
'
@eth-optimism/ci-builder'
:
patch
'
@eth-optimism/contracts-bedrock'
:
patch
---
Add echidna test for AliasHelper
.changeset/neat-terms-buy.md
0 → 100644
View file @
a7cfdeb1
---
'
@eth-optimism/ci-builder'
:
patch
---
Pin echidna version
.circleci/config.yml
View file @
a7cfdeb1
...
@@ -263,7 +263,7 @@ jobs:
...
@@ -263,7 +263,7 @@ jobs:
command
:
yarn storage-snapshot && git diff --exit-code .storage-layout
command
:
yarn storage-snapshot && git diff --exit-code .storage-layout
working_directory
:
packages/contracts-bedrock
working_directory
:
packages/contracts-bedrock
contracts-bedrock-echidna
:
bedrock-echidna-build
:
docker
:
docker
:
-
image
:
ethereumoptimism/ci-builder:latest
-
image
:
ethereumoptimism/ci-builder:latest
resource_class
:
large
resource_class
:
large
...
@@ -282,30 +282,27 @@ jobs:
...
@@ -282,30 +282,27 @@ jobs:
name
:
Compile with metadata hash
name
:
Compile with metadata hash
command
:
yarn build:with-metadata
command
:
yarn build:with-metadata
working_directory
:
packages/contracts-bedrock
working_directory
:
packages/contracts-bedrock
-
persist_to_workspace
:
root
:
.
paths
:
-
"
node_modules"
-
packages/contracts-bedrock
bedrock-echidna-run
:
docker
:
-
image
:
ethereumoptimism/ci-builder:latest
parameters
:
echidna_target
:
description
:
Which echidna fuzz contract to run
type
:
string
steps
:
-
checkout
-
attach_workspace
:
{
at
:
"
."
}
-
run
:
-
run
:
name
:
Echidna Fuzz Aliasing
name
:
Echidna Fuzz <<parameters.echidna_target>>
command
:
yarn echidna:aliasing || exit
0
command
:
yarn echidna:<<parameters.echidna_target>>
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
Echidna Fuzz Burn
command
:
yarn echidna:burn || exit
0
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
Echidna Fuzz Encoding
command
:
yarn echidna:encoding || exit
0
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
Echidna Fuzz Portal
command
:
yarn enchidna:portal || exit
0
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
Echidna Fuzz Hashing
command
:
yarn echidna:hashing || exit
0
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
Echidna Fuzz Resource Metering
command
:
yarn echidna:metering || exit
0
working_directory
:
packages/contracts-bedrock
working_directory
:
packages/contracts-bedrock
no_output_timeout
:
15m
op-bindings-build
:
op-bindings-build
:
docker
:
docker
:
...
@@ -813,9 +810,13 @@ workflows:
...
@@ -813,9 +810,13 @@ workflows:
-
contracts-bedrock-tests
:
-
contracts-bedrock-tests
:
requires
:
requires
:
-
yarn-monorepo
-
yarn-monorepo
-
contracts-bedrock-echidna
:
-
bedrock-echidna-build
:
requires
:
requires
:
-
yarn-monorepo
-
yarn-monorepo
-
bedrock-echidna-run
:
echidna_target
:
aliasing
requires
:
-
bedrock-echidna-build
-
op-bindings-build
:
-
op-bindings-build
:
requires
:
requires
:
-
yarn-monorepo
-
yarn-monorepo
...
...
.gitignore
View file @
a7cfdeb1
...
@@ -56,3 +56,6 @@ op-exporter
...
@@ -56,3 +56,6 @@ op-exporter
__pycache__
__pycache__
# Ignore echidna artifacts
crytic-export
codecov.yml
View file @
a7cfdeb1
...
@@ -7,6 +7,7 @@ ignore:
...
@@ -7,6 +7,7 @@ ignore:
-
"
**/*.t.sol"
-
"
**/*.t.sol"
-
"
op-bindings/bindings/*.go"
-
"
op-bindings/bindings/*.go"
-
"
packages/contracts-bedrock/contracts/vendor/WETH9.sol"
-
"
packages/contracts-bedrock/contracts/vendor/WETH9.sol"
-
"
packages/contracts-bedrock/contracts/echidna"
coverage
:
coverage
:
status
:
status
:
patch
:
patch
:
...
...
ops/docker/ci-builder/Dockerfile
View file @
a7cfdeb1
...
@@ -26,7 +26,7 @@ RUN source $HOME/.profile && \
...
@@ -26,7 +26,7 @@ RUN source $HOME/.profile && \
FROM
ethereum/client-go:alltools-v1.10.25 as geth
FROM
ethereum/client-go:alltools-v1.10.25 as geth
FROM
ghcr.io/crytic/echidna/echidna:
testing-master
as echidna-test
FROM
ghcr.io/crytic/echidna/echidna:
v2.0.4
as echidna-test
FROM
python:3.8.13-slim-bullseye
FROM
python:3.8.13-slim-bullseye
...
...
packages/contracts-bedrock/contracts/echidna/FuzzAddressAliasing.sol
0 → 100644
View file @
a7cfdeb1
pragma solidity 0.8.15;
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
contract EchidnaFuzzAddressAliasing {
bool failedRoundtrip;
/**
* @notice Takes an address to be aliased with AddressAliasHelper and then unaliased
* and updates the test contract's state indicating if the round trip encoding
* failed.
*/
function testRoundTrip(address addr) public {
// Alias our address
address aliasedAddr = AddressAliasHelper.applyL1ToL2Alias(addr);
// Unalias our address
address undoneAliasAddr = AddressAliasHelper.undoL1ToL2Alias(aliasedAddr);
// If our round trip aliasing did not return the original result, set our state.
if (addr != undoneAliasAddr) {
failedRoundtrip = true;
}
}
/**
* @notice Verifies that testRoundTrip(...) did not ever fail.
*/
function echidna_round_trip_aliasing() public view returns (bool) {
// ASSERTION: The round trip aliasing done in testRoundTrip(...) should never fail.
return !failedRoundtrip;
}
}
packages/contracts-bedrock/echidna.yaml
0 → 100644
View file @
a7cfdeb1
cryticArgs
:
[
"
--hardhat-ignore-compile"
]
format
:
text
# Set the timeout to 3 minutes to keep CI from getting too long.
# The tool also adds 2 or 3 minutes before/after the actual timeout window.
timeout
:
180
packages/contracts-bedrock/foundry.toml
View file @
a7cfdeb1
...
@@ -18,6 +18,8 @@ build_info = true
...
@@ -18,6 +18,8 @@ build_info = true
build_info_path
=
'artifacts/build-info'
build_info_path
=
'artifacts/build-info'
ffi
=
true
ffi
=
true
fuzz_runs
=
16
fuzz_runs
=
16
no_match_contract
=
'EchidnaFuzz'
[profile.ci]
[profile.ci]
fuzz_runs
=
512
fuzz_runs
=
512
...
...
packages/contracts-bedrock/package.json
View file @
a7cfdeb1
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
],
],
"scripts"
:
{
"scripts"
:
{
"build:forge"
:
"forge build"
,
"build:forge"
:
"forge build"
,
"build:with-metadata"
:
"
hardhat clean && FOUNDRY_PROFILE=echidna hardhat compil
e"
,
"build:with-metadata"
:
"
FOUNDRY_PROFILE=echidna yarn build:forg
e"
,
"build:differential"
:
"tsc scripts/differential-testing.ts --outDir dist --moduleResolution node --esModuleInterop"
,
"build:differential"
:
"tsc scripts/differential-testing.ts --outDir dist --moduleResolution node --esModuleInterop"
,
"prebuild"
:
"yarn ts-node scripts/verify-foundry-install.ts"
,
"prebuild"
:
"yarn ts-node scripts/verify-foundry-install.ts"
,
"build"
:
"hardhat compile && yarn autogen:artifacts && yarn build:ts && yarn typechain"
,
"build"
:
"hardhat compile && yarn autogen:artifacts && yarn build:ts && yarn typechain"
,
...
@@ -38,12 +38,12 @@
...
@@ -38,12 +38,12 @@
"lint:fix"
:
"yarn lint:contracts:fix && yarn lint:ts:fix"
,
"lint:fix"
:
"yarn lint:contracts:fix && yarn lint:ts:fix"
,
"lint"
:
"yarn lint:fix && yarn lint:check"
,
"lint"
:
"yarn lint:fix && yarn lint:check"
,
"typechain"
:
"typechain --target ethers-v5 --out-dir dist/types --glob 'artifacts/!(build-info)/**/+([a-zA-Z0-9_]).json'"
,
"typechain"
:
"typechain --target ethers-v5 --out-dir dist/types --glob 'artifacts/!(build-info)/**/+([a-zA-Z0-9_]).json'"
,
"echidna:aliasing"
:
"echidna-test --contract
FuzzAddressAliasing --format text --crytic-args --hardhat-ignore-compile
."
,
"echidna:aliasing"
:
"echidna-test --contract
EchidnaFuzzAddressAliasing --config ./echidna.yaml
."
,
"echidna:burn"
:
"echidna-test --contract
FuzzBurn --format text --crytic-args --hardhat-ignore-compile
."
,
"echidna:burn"
:
"echidna-test --contract
EchidnaFuzzBurn --config ./echidna.yaml
."
,
"echidna:encoding"
:
"echidna-test --contract
FuzzEncoding --format text --crytic-args --hardhat-ignore-compile
."
,
"echidna:encoding"
:
"echidna-test --contract
EchidnaFuzzEncoding --config ./echidna.yaml
."
,
"echidna:portal"
:
"echidna-test --contract
FuzzOptimismPortal --format text --crytic-args --hardhat-ignore-compile
."
,
"echidna:portal"
:
"echidna-test --contract
EchidnaFuzzOptimismPortal --config ./echidna.yaml
."
,
"echidna:hashing"
:
"echidna-test --contract
FuzzHashing --format text --crytic-args --hardhat-ignore-compile
."
,
"echidna:hashing"
:
"echidna-test --contract
EchidnaFuzzHashing --config ./echidna.yaml
."
,
"echidna:metering"
:
"echidna-test --contract
FuzzResourceMetering --format text --crytic-args --hardhat-ignore-compile
."
"echidna:metering"
:
"echidna-test --contract
EchidnaFuzzResourceMetering --config ./echidna.yaml
."
},
},
"dependencies"
:
{
"dependencies"
:
{
"@eth-optimism/core-utils"
:
"^0.11.0"
,
"@eth-optimism/core-utils"
:
"^0.11.0"
,
...
...
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