Commit 15009ac9 authored by tre's avatar tre

Merge branch 'develop' into update_eco_bridge

parents 17b87632 2e64d046
This diff is collapsed.
......@@ -35,21 +35,10 @@ jobs:
uses: actions/setup-node@master
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: pnpm
- name: Install Dependencies
run: yarn --frozen-lockfile
run: pnpm --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
......@@ -57,17 +46,17 @@ jobs:
version: nightly
- name: Build
run: yarn build
run: pnpm build
- name: Setup Canary Snapshot
run: yarn changeset version --snapshot
run: pnpm changeset version --snapshot
- name: Publish To NPM
uses: changesets/action@v1
id: changesets
with:
createGithubReleases: false
publish: yarn changeset publish --tag canary
publish: pnpm changeset publish --tag canary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
......
......@@ -33,21 +33,10 @@ jobs:
uses: actions/setup-node@master
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: pnpm
- name: Install Dependencies
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
......@@ -62,7 +51,7 @@ jobs:
id: changesets
with:
createGithubReleases: false
publish: yarn release
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
......
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn nx affected --target=pre-commit
pnpm nx affected --target=pre-commit
# run prefoo scripts
# npm and yarn support this as a default pnpm defaults to false
enable-pre-post-scripts=true
lockfile=true
prefer-workspace-packages=true
module.exports = {
$schema: 'http://json.schemastore.org/prettierrc',
plugins: ['prettier-plugin-solidity'],
trailingComma: 'es5',
tabWidth: 2,
semi: false,
......
......@@ -43,7 +43,7 @@ You *must* include a `changeset` file in your PR when making a change that would
Adding a `changeset` file is easy:
1. Navigate to the root of the monorepo.
2. Run `yarn changeset`. You'll be prompted to select packages to include in the changeset. Use the arrow keys to move the cursor up and down, hit the `spacebar` to select a package, and hit `enter` to confirm your selection. Select *all* packages that require a new release as a result of your PR.
2. Run `pnpm changeset`. You'll be prompted to select packages to include in the changeset. Use the arrow keys to move the cursor up and down, hit the `spacebar` to select a package, and hit `enter` to confirm your selection. Select *all* packages that require a new release as a result of your PR.
3. Once you hit `enter` you'll be prompted to decide whether your selected packages need a `major`, `minor`, or `patch` release. We follow the [Semantic Versioning](https://semver.org/) scheme. Please avoid using `major` releases for any packages that are still in version `0.y.z`.
4. Commit your changeset and push it into your PR. The changeset bot will notice your changeset file and leave a little comment to this effect on GitHub.
5. Voilà, c'est fini!
......@@ -63,7 +63,7 @@ You'll need the following:
* [Git](https://git-scm.com/downloads)
* [NodeJS](https://nodejs.org/en/download/)
* [Node Version Manager](https://github.com/nvm-sh/nvm)
* [Yarn](https://classic.yarnpkg.com/en/docs/install)
* [pnpm](https://pnpm.io/installation)
* [Docker](https://docs.docker.com/get-docker/)
* [Docker Compose](https://docs.docker.com/compose/install/)
* [Go](https://go.dev/dl/)
......@@ -86,10 +86,10 @@ Install node v16.16.0 with [nvm](https://github.com/nvm-sh/nvm)
nvm use
```
### Install node modules with Yarn
### Install node modules with pnpm
```bash
yarn install
pnpm i
```
### Building the TypeScript packages
......@@ -101,8 +101,8 @@ and compile the smart contracts. Install foundry [here](https://getfoundry.sh/).
To build all of the [TypeScript packages](./packages), run:
```bash
yarn clean
yarn build
pnpm clean
pnpm build
```
Packages compiled when on one branch may not be compatible with packages on a different branch.
......@@ -136,8 +136,8 @@ Finally, **if you're running into weird problems and nothing seems to be working
```bash
cd optimism
yarn clean
yarn build
pnpm clean
pnpm build
cd ops
docker-compose down -v
docker-compose build
......@@ -162,14 +162,14 @@ Before running tests: **follow the above instructions to get everything built.**
Run unit tests for all packages in parallel via:
```bash
yarn test
pnpm test
```
To run unit tests for a specific package:
```bash
cd packages/package-to-test
yarn test
pnpm test
```
#### Running contract static analysis
......@@ -181,5 +181,5 @@ To run `slither` locally, do:
```bash
cd packages/contracts
pip3 install slither-analyzer
yarn test:slither
pnpm test:slither
```
......@@ -12,8 +12,8 @@ build-ts: submodules
if [ -n "$$NVM_DIR" ]; then \
. $$NVM_DIR/nvm.sh && nvm use; \
fi
yarn install
yarn build
pnpm install
pnpm build
.PHONY: build-ts
submodules:
......@@ -102,7 +102,7 @@ test-unit:
make -C ./op-proposer test
make -C ./op-batcher test
make -C ./op-e2e test
yarn test
pnpm test
.PHONY: test-unit
test-integration:
......
......@@ -138,7 +138,7 @@ See table in the **Active Branches** section above to find the right branch to t
We use [changesets](https://github.com/changesets/changesets) to mark packages for new releases.
When merging commits to the `develop` branch you MUST include a changeset file if your change would require that a new version of a package be released.
To add a changeset, run the command `yarn changeset` in the root of this monorepo.
To add a changeset, run the command `pnpm changeset` in the root of this monorepo.
You will be presented with a small prompt to select the packages to be released, the scope of the release (major, minor, or patch), and the reason for the release.
Comments within changeset files will be automatically included in the changelog of the package.
......
......@@ -48,7 +48,7 @@ func LoadContractsFromFiles() (*Contracts, error) {
if err != nil {
return nil, err
}
oracle, err := LoadContract("Oracle")
oracle, err := LoadContract("PreimageOracle")
if err != nil {
return nil, err
}
......
......@@ -58,8 +58,9 @@ func TestEVM(t *testing.T) {
for _, f := range testFiles {
t.Run(f.Name(), func(t *testing.T) {
var oracle PreimageOracle
if f.Name() == "oracle.bin" {
t.Skip("oracle test needs to be updated to use syscall pre-image oracle")
oracle = staticOracle(t, []byte("hello world"))
}
env, evmState := NewEVMEnv(contracts, addrs)
......@@ -75,7 +76,7 @@ func TestEVM(t *testing.T) {
// set the return address ($ra) to jump into when test completes
state.Registers[31] = endAddr
us := NewInstrumentedState(state, nil, os.Stdout, os.Stderr)
us := NewInstrumentedState(state, oracle, os.Stdout, os.Stderr)
for i := 0; i < 1000; i++ {
if us.state.PC == endAddr {
......@@ -91,6 +92,16 @@ func TestEVM(t *testing.T) {
// we take a snapshot so we can clean up the state, and isolate the logs of this instruction run.
snap := env.StateDB.Snapshot()
// prepare pre-image oracle data, if any
if stepWitness.HasPreimage() {
t.Logf("reading preimage key %x at offset %d", stepWitness.PreimageKey, stepWitness.PreimageOffset)
poInput, err := stepWitness.EncodePreimageOracleInput()
require.NoError(t, err, "encode preimage oracle input")
_, leftOverGas, err := env.Call(vm.AccountRef(addrs.Sender), addrs.Oracle, poInput, startingGas, big.NewInt(0))
require.NoErrorf(t, err, "evm should not fail, took %d gas", startingGas-leftOverGas)
}
ret, leftOverGas, err := env.Call(vm.AccountRef(sender), addrs.MIPS, input, startingGas, big.NewInt(0))
require.NoError(t, err, "evm should not fail")
require.Len(t, ret, 32, "expecting 32-byte state hash")
......
.section .test, "x"
.section .test, "x"
.balign 4
.set noreorder
.global test
.ent test
# load hash at 0x30001000
# 0x47173285 a8d7341e 5e972fc6 77286384 f802f8ef 42a5ec5f 03bbfa25 4cb01fad = "hello world"
# 0x47173285 a8d7341e 5e972fc6 77286384 f802f8ef 42a5ec5f 03bbfa25 4cb01fad = keccak("hello world")
# 0x02173285 a8d7341e 5e972fc6 77286384 f802f8ef 42a5ec5f 03bbfa25 4cb01fad = keccak("hello world").key
test:
lui $s0, 0x3000
ori $s0, 0x1000
lui $t0, 0x4717
lui $t0, 0x0217
ori $t0, 0x3285
sw $t0, 0($s0)
lui $t0, 0xa8d7
......@@ -35,20 +36,53 @@ test:
ori $t0, 0x1fad
sw $t0, 0x1c($s0)
# syscall 4020 to trigger
li $v0, 4020
# preimage request - write(fdPreimageWrite, preimageData, 32)
li $a0, 6
li $a1, 0x30001000
li $t0, 8
li $a2, 4
$writeloop:
li $v0, 4004
syscall
addiu $a1, $a1, 4
addiu $t0, $t0, -1
bnez $t0, $writeloop
nop
# preimage response to 0x30002000 - read(fdPreimageRead, addr, count)
# read preimage length
li $a0, 5
li $a1, 0x31000000
li $a2, 4
li $v0, 4003
syscall
li $a1, 0x31000004
li $v0, 4003
syscall
# read the preimage data
li $a1, 0x31000008
li $t0, 3
$readloop:
li $v0, 4003
syscall
addiu $a1, $a1, 4
addiu $t0, $t0, -1
bnez $t0, $readloop
nop
# length at 0x31000000
# length at 0x31000000. We also check that the lower 32 bits are zero
lui $s1, 0x3100
lw $t0, 0($s1)
sltiu $t6, $t0, 1
li $s1, 0x31000004
lw $t0, 0($s1)
# should be len("hello world") == 11
li $t4, 11
subu $t5, $t0, $t4
sltiu $v0, $t5, 1
and $v0, $v0, $t6
# data at 0x31000004
# data at 0x31000008
lw $t0, 4($s1)
lui $t4, 0x6865
ori $t4, 0x6c6c
......
......@@ -31,8 +31,9 @@ func TestState(t *testing.T) {
for _, f := range testFiles {
t.Run(f.Name(), func(t *testing.T) {
var oracle PreimageOracle
if f.Name() == "oracle.bin" {
t.Skip("oracle test needs to be updated to use syscall pre-image oracle")
oracle = staticOracle(t, []byte("hello world"))
}
// TODO: currently tests are compiled as flat binary objects
// We can use more standard tooling to compile them to ELF files and get remove maketests.py
......@@ -50,7 +51,7 @@ func TestState(t *testing.T) {
// set the return address ($ra) to jump into when test completes
state.Registers[31] = endAddr
us := NewInstrumentedState(state, nil, os.Stdout, os.Stderr)
us := NewInstrumentedState(state, oracle, os.Stdout, os.Stderr)
for i := 0; i < 1000; i++ {
if us.state.PC == endAddr {
......@@ -196,3 +197,15 @@ func TestClaim(t *testing.T) {
require.Equal(t, expectedStdOut, stdOutBuf.String(), "stdout")
require.Equal(t, expectedStdErr, stdErrBuf.String(), "stderr")
}
func staticOracle(t *testing.T, preimageData []byte) *testOracle {
return &testOracle{
hint: func(v []byte) {},
getPreimage: func(k [32]byte) []byte {
if k != preimage.Keccak256Key(crypto.Keccak256Hash(preimageData)).PreimageKey() {
t.Fatalf("invalid preimage request for %x", k)
}
return preimageData
},
}
}
{
"npmClient": "yarn",
"npmClient": "pnpm",
"useWorkspaces": true,
"version": "independent",
"packages": [
"packages/*"
],
"version": "independent"
]
}
......@@ -11,7 +11,7 @@ version:
compile:
cd $(contracts-dir) && \
yarn build
pnpm build
bindings: compile bindings-build
......@@ -28,7 +28,7 @@ mkdir:
clean-contracts:
cd $(contracts-dir) && \
yarn clean
pnpm clean
clean:
rm -rf $(pkg)
......
......@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
const FaultDisputeGameStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/dispute/FaultDisputeGame.sol:FaultDisputeGame\",\"label\":\"gameStart\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_userDefinedValueType(Timestamp)1011\"},{\"astId\":1001,\"contract\":\"contracts/dispute/FaultDisputeGame.sol:FaultDisputeGame\",\"label\":\"status\",\"offset\":8,\"slot\":\"0\",\"type\":\"t_enum(GameStatus)1006\"},{\"astId\":1002,\"contract\":\"contracts/dispute/FaultDisputeGame.sol:FaultDisputeGame\",\"label\":\"bondManager\",\"offset\":9,\"slot\":\"0\",\"type\":\"t_contract(IBondManager)1005\"},{\"astId\":1003,\"contract\":\"contracts/dispute/FaultDisputeGame.sol:FaultDisputeGame\",\"label\":\"claimData\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_struct(ClaimData)5796_storage)dyn_storage\"},{\"astId\":1004,\"contract\":\"contracts/dispute/FaultDisputeGame.sol:FaultDisputeGame\",\"label\":\"claims\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_mapping(t_userDefinedValueType(ClaimHash)1008,t_bool)\"}],\"types\":{\"t_array(t_struct(ClaimData)5796_storage)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"struct IFaultDisputeGame.ClaimData[]\",\"numberOfBytes\":\"32\",\"base\":\"t_struct(ClaimData)5796_storage\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_contract(IBondManager)1005\":{\"encoding\":\"inplace\",\"label\":\"contract IBondManager\",\"numberOfBytes\":\"20\"},\"t_enum(GameStatus)1006\":{\"encoding\":\"inplace\",\"label\":\"enum GameStatus\",\"numberOfBytes\":\"1\"},\"t_mapping(t_userDefinedValueType(ClaimHash)1008,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(ClaimHash =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_userDefinedValueType(ClaimHash)1008\",\"value\":\"t_bool\"},\"t_struct(ClaimData)5796_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IFaultDisputeGame.ClaimData\",\"numberOfBytes\":\"96\"},\"t_uint32\":{\"encoding\":\"inplace\",\"label\":\"uint32\",\"numberOfBytes\":\"4\"},\"t_userDefinedValueType(Claim)1007\":{\"encoding\":\"inplace\",\"label\":\"Claim\",\"numberOfBytes\":\"32\"},\"t_userDefinedValueType(ClaimHash)1008\":{\"encoding\":\"inplace\",\"label\":\"ClaimHash\",\"numberOfBytes\":\"32\"},\"t_userDefinedValueType(Clock)1009\":{\"encoding\":\"inplace\",\"label\":\"Clock\",\"numberOfBytes\":\"16\"},\"t_userDefinedValueType(Position)1010\":{\"encoding\":\"inplace\",\"label\":\"Position\",\"numberOfBytes\":\"16\"},\"t_userDefinedValueType(Timestamp)1011\":{\"encoding\":\"inplace\",\"label\":\"Timestamp\",\"numberOfBytes\":\"8\"}}}"
const FaultDisputeGameStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/dispute/FaultDisputeGame.sol:FaultDisputeGame\",\"label\":\"gameStart\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_userDefinedValueType(Timestamp)1011\"},{\"astId\":1001,\"contract\":\"contracts/dispute/FaultDisputeGame.sol:FaultDisputeGame\",\"label\":\"status\",\"offset\":8,\"slot\":\"0\",\"type\":\"t_enum(GameStatus)1006\"},{\"astId\":1002,\"contract\":\"contracts/dispute/FaultDisputeGame.sol:FaultDisputeGame\",\"label\":\"bondManager\",\"offset\":9,\"slot\":\"0\",\"type\":\"t_contract(IBondManager)1005\"},{\"astId\":1003,\"contract\":\"contracts/dispute/FaultDisputeGame.sol:FaultDisputeGame\",\"label\":\"claimData\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_struct(ClaimData)38805_storage)dyn_storage\"},{\"astId\":1004,\"contract\":\"contracts/dispute/FaultDisputeGame.sol:FaultDisputeGame\",\"label\":\"claims\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_mapping(t_userDefinedValueType(ClaimHash)1008,t_bool)\"}],\"types\":{\"t_array(t_struct(ClaimData)38805_storage)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"struct IFaultDisputeGame.ClaimData[]\",\"numberOfBytes\":\"32\",\"base\":\"t_struct(ClaimData)38805_storage\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_contract(IBondManager)1005\":{\"encoding\":\"inplace\",\"label\":\"contract IBondManager\",\"numberOfBytes\":\"20\"},\"t_enum(GameStatus)1006\":{\"encoding\":\"inplace\",\"label\":\"enum GameStatus\",\"numberOfBytes\":\"1\"},\"t_mapping(t_userDefinedValueType(ClaimHash)1008,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(ClaimHash =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_userDefinedValueType(ClaimHash)1008\",\"value\":\"t_bool\"},\"t_struct(ClaimData)38805_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IFaultDisputeGame.ClaimData\",\"numberOfBytes\":\"96\"},\"t_uint32\":{\"encoding\":\"inplace\",\"label\":\"uint32\",\"numberOfBytes\":\"4\"},\"t_userDefinedValueType(Claim)1007\":{\"encoding\":\"inplace\",\"label\":\"Claim\",\"numberOfBytes\":\"32\"},\"t_userDefinedValueType(ClaimHash)1008\":{\"encoding\":\"inplace\",\"label\":\"ClaimHash\",\"numberOfBytes\":\"32\"},\"t_userDefinedValueType(Clock)1009\":{\"encoding\":\"inplace\",\"label\":\"Clock\",\"numberOfBytes\":\"16\"},\"t_userDefinedValueType(Position)1010\":{\"encoding\":\"inplace\",\"label\":\"Position\",\"numberOfBytes\":\"16\"},\"t_userDefinedValueType(Timestamp)1011\":{\"encoding\":\"inplace\",\"label\":\"Timestamp\",\"numberOfBytes\":\"8\"}}}"
var FaultDisputeGameStorageLayout = new(solc.StorageLayout)
......
......@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
const L2OutputOracleStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L1/L2OutputOracle.sol:L2OutputOracle\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/L1/L2OutputOracle.sol:L2OutputOracle\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/L1/L2OutputOracle.sol:L2OutputOracle\",\"label\":\"startingBlockNumber\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":1003,\"contract\":\"contracts/L1/L2OutputOracle.sol:L2OutputOracle\",\"label\":\"startingTimestamp\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":1004,\"contract\":\"contracts/L1/L2OutputOracle.sol:L2OutputOracle\",\"label\":\"l2Outputs\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_array(t_struct(OutputProposal)9692_storage)dyn_storage\"}],\"types\":{\"t_array(t_struct(OutputProposal)9692_storage)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"struct Types.OutputProposal[]\",\"numberOfBytes\":\"32\",\"base\":\"t_struct(OutputProposal)9692_storage\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_struct(OutputProposal)9692_storage\":{\"encoding\":\"inplace\",\"label\":\"struct Types.OutputProposal\",\"numberOfBytes\":\"64\"},\"t_uint128\":{\"encoding\":\"inplace\",\"label\":\"uint128\",\"numberOfBytes\":\"16\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
const L2OutputOracleStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L1/L2OutputOracle.sol:L2OutputOracle\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/L1/L2OutputOracle.sol:L2OutputOracle\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/L1/L2OutputOracle.sol:L2OutputOracle\",\"label\":\"startingBlockNumber\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":1003,\"contract\":\"contracts/L1/L2OutputOracle.sol:L2OutputOracle\",\"label\":\"startingTimestamp\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":1004,\"contract\":\"contracts/L1/L2OutputOracle.sol:L2OutputOracle\",\"label\":\"l2Outputs\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_array(t_struct(OutputProposal)42701_storage)dyn_storage\"}],\"types\":{\"t_array(t_struct(OutputProposal)42701_storage)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"struct Types.OutputProposal[]\",\"numberOfBytes\":\"32\",\"base\":\"t_struct(OutputProposal)42701_storage\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_struct(OutputProposal)42701_storage\":{\"encoding\":\"inplace\",\"label\":\"struct Types.OutputProposal\",\"numberOfBytes\":\"64\"},\"t_uint128\":{\"encoding\":\"inplace\",\"label\":\"uint128\",\"numberOfBytes\":\"16\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
var L2OutputOracleStorageLayout = new(solc.StorageLayout)
......
This diff is collapsed.
This diff is collapsed.
......@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
const OptimismPortalStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"params\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_struct(ResourceParams)1932_storage\"},{\"astId\":1003,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_array(t_uint256)48_storage\"},{\"astId\":1004,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"l2Sender\",\"offset\":0,\"slot\":\"50\",\"type\":\"t_address\"},{\"astId\":1005,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"finalizedWithdrawals\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":1006,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"provenWithdrawals\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_mapping(t_bytes32,t_struct(ProvenWithdrawal)1271_storage)\"},{\"astId\":1007,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"paused\",\"offset\":0,\"slot\":\"53\",\"type\":\"t_bool\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)48_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[48]\",\"numberOfBytes\":\"1536\",\"base\":\"t_uint256\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_mapping(t_bytes32,t_struct(ProvenWithdrawal)1271_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e struct OptimismPortal.ProvenWithdrawal)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_struct(ProvenWithdrawal)1271_storage\"},\"t_struct(ProvenWithdrawal)1271_storage\":{\"encoding\":\"inplace\",\"label\":\"struct OptimismPortal.ProvenWithdrawal\",\"numberOfBytes\":\"64\"},\"t_struct(ResourceParams)1932_storage\":{\"encoding\":\"inplace\",\"label\":\"struct ResourceMetering.ResourceParams\",\"numberOfBytes\":\"32\"},\"t_uint128\":{\"encoding\":\"inplace\",\"label\":\"uint128\",\"numberOfBytes\":\"16\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint64\":{\"encoding\":\"inplace\",\"label\":\"uint64\",\"numberOfBytes\":\"8\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
const OptimismPortalStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"params\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_struct(ResourceParams)34941_storage\"},{\"astId\":1003,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_array(t_uint256)48_storage\"},{\"astId\":1004,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"l2Sender\",\"offset\":0,\"slot\":\"50\",\"type\":\"t_address\"},{\"astId\":1005,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"finalizedWithdrawals\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":1006,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"provenWithdrawals\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_mapping(t_bytes32,t_struct(ProvenWithdrawal)34280_storage)\"},{\"astId\":1007,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"paused\",\"offset\":0,\"slot\":\"53\",\"type\":\"t_bool\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)48_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[48]\",\"numberOfBytes\":\"1536\",\"base\":\"t_uint256\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_mapping(t_bytes32,t_struct(ProvenWithdrawal)34280_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e struct OptimismPortal.ProvenWithdrawal)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_struct(ProvenWithdrawal)34280_storage\"},\"t_struct(ProvenWithdrawal)34280_storage\":{\"encoding\":\"inplace\",\"label\":\"struct OptimismPortal.ProvenWithdrawal\",\"numberOfBytes\":\"64\"},\"t_struct(ResourceParams)34941_storage\":{\"encoding\":\"inplace\",\"label\":\"struct ResourceMetering.ResourceParams\",\"numberOfBytes\":\"32\"},\"t_uint128\":{\"encoding\":\"inplace\",\"label\":\"uint128\",\"numberOfBytes\":\"16\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint64\":{\"encoding\":\"inplace\",\"label\":\"uint64\",\"numberOfBytes\":\"8\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
var OptimismPortalStorageLayout = new(solc.StorageLayout)
......
......@@ -15,7 +15,7 @@ var PreimageOracleStorageLayout = new(solc.StorageLayout)
var PreimageOracleDeployedBin = "0x608060405234801561001057600080fd5b50600436106100725760003560e01c8063e159261111610050578063e15926111461011b578063fe4ac08e14610130578063fef2b4ed146101a557600080fd5b806361238bde146100775780638542cf50146100b5578063e03110e1146100f3575b600080fd5b6100a26100853660046103b5565b600160209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b6100e36100c33660046103b5565b600260209081526000928352604080842090915290825290205460ff1681565b60405190151581526020016100ac565b6101066101013660046103b5565b6101c5565b604080519283526020830191909152016100ac565b61012e6101293660046103d7565b6102b6565b005b61012e61013e366004610453565b6000838152600260209081526040808320878452825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091558684528252808320968352958152858220939093559283529082905291902055565b6100a26101b3366004610485565b60006020819052908152604090205481565b6000828152600260209081526040808320848452909152812054819060ff1661024e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f707265696d616765206d75737420657869737400000000000000000000000000604482015260640160405180910390fd5b506000838152602081815260409091205461026a8160086104cd565b6102758560206104cd565b1061029357836102868260086104cd565b61029091906104e5565b91505b506000938452600160209081526040808620948652939052919092205492909150565b6044356000806008830186106102cb57600080fd5b60c083901b6080526088838682378087017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80151908490207effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f02000000000000000000000000000000000000000000000000000000000000001760008181526002602090815260408083208b8452825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915584845282528083209a83529981528982209390935590815290819052959095209190915550505050565b600080604083850312156103c857600080fd5b50508035926020909101359150565b6000806000604084860312156103ec57600080fd5b83359250602084013567ffffffffffffffff8082111561040b57600080fd5b818601915086601f83011261041f57600080fd5b81358181111561042e57600080fd5b87602082850101111561044057600080fd5b6020830194508093505050509250925092565b6000806000806080858703121561046957600080fd5b5050823594602084013594506040840135936060013592509050565b60006020828403121561049757600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156104e0576104e061049e565b500190565b6000828210156104f7576104f761049e565b50039056fea164736f6c634300080f000a"
var PreimageOracleDeployedSourceMap = "57:2945:19:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;143:68;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;413:25:195;;;401:2;386:18;143:68:19;;;;;;;;217:66;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;614:14:195;;607:22;589:41;;577:2;562:18;217:66:19;449:187:195;290:454:19;;;;;;:::i;:::-;;:::i;:::-;;;;815:25:195;;;871:2;856:18;;849:34;;;;788:18;290:454:19;641:248:195;1537:1463:19;;;;;;:::i;:::-;;:::i;:::-;;1086:262;;;;;;:::i;:::-;1219:19;;;;:14;:19;;;;;;;;:31;;;;;;;;:38;;;;1253:4;1219:38;;;;;;1267:18;;;;;;;;:30;;;;;;;;;:37;;;;1314:20;;;;;;;;;;:27;1086:262;87:50;;;;;;:::i;:::-;;;;;;;;;;;;;;;290:454;388:11;439:19;;;:14;:19;;;;;;;;:27;;;;;;;;;388:11;;439:27;;431:59;;;;;;;2517:2:195;431:59:19;;;2499:21:195;2556:2;2536:18;;;2529:30;2595:21;2575:18;;;2568:49;2634:18;;431:59:19;;;;;;;;-1:-1:-1;521:14:19;538:20;;;509:2;538:20;;;;;;;;631:10;538:20;640:1;631:10;:::i;:::-;616:11;:6;625:2;616:11;:::i;:::-;:25;612:84;;679:6;666:10;:6;675:1;666:10;:::i;:::-;:19;;;;:::i;:::-;657:28;;612:84;-1:-1:-1;711:18:19;;;;:13;:18;;;;;;;;:26;;;;;;;;;;;;290:454;;-1:-1:-1;290:454:19:o;1537:1463::-;1831:4;1818:18;1636:12;;1966:1;1956:12;;1941:28;;1931:84;;1999:1;1996;1989:12;1931:84;2258:3;2254:14;;;2158:4;2242:27;2289:11;2263:4;2408:15;2289:11;2390:40;2620:28;;;2624:11;2620:28;2614:35;2671:20;;;;2818:19;2811:27;2840:11;2808:44;2871:19;;;;2849:1;2871:19;;;;;;;;:31;;;;;;;;:38;;;;2905:4;2871:38;;;;;;2919:18;;;;;;;;:30;;;;;;;;;:37;;;;2966:20;;;;;;;;;;;:27;;;;-1:-1:-1;;;;1537:1463:19:o;14:248:195:-;82:6;90;143:2;131:9;122:7;118:23;114:32;111:52;;;159:1;156;149:12;111:52;-1:-1:-1;;182:23:195;;;252:2;237:18;;;224:32;;-1:-1:-1;14:248:195:o;894:659::-;973:6;981;989;1042:2;1030:9;1021:7;1017:23;1013:32;1010:52;;;1058:1;1055;1048:12;1010:52;1094:9;1081:23;1071:33;;1155:2;1144:9;1140:18;1127:32;1178:18;1219:2;1211:6;1208:14;1205:34;;;1235:1;1232;1225:12;1205:34;1273:6;1262:9;1258:22;1248:32;;1318:7;1311:4;1307:2;1303:13;1299:27;1289:55;;1340:1;1337;1330:12;1289:55;1380:2;1367:16;1406:2;1398:6;1395:14;1392:34;;;1422:1;1419;1412:12;1392:34;1467:7;1462:2;1453:6;1449:2;1445:15;1441:24;1438:37;1435:57;;;1488:1;1485;1478:12;1435:57;1519:2;1515;1511:11;1501:21;;1541:6;1531:16;;;;;894:659;;;;;:::o;1558:385::-;1644:6;1652;1660;1668;1721:3;1709:9;1700:7;1696:23;1692:33;1689:53;;;1738:1;1735;1728:12;1689:53;-1:-1:-1;;1761:23:195;;;1831:2;1816:18;;1803:32;;-1:-1:-1;1882:2:195;1867:18;;1854:32;;1933:2;1918:18;1905:32;;-1:-1:-1;1558:385:195;-1:-1:-1;1558:385:195:o;1948:180::-;2007:6;2060:2;2048:9;2039:7;2035:23;2031:32;2028:52;;;2076:1;2073;2066:12;2028:52;-1:-1:-1;2099:23:195;;1948:180;-1:-1:-1;1948:180:195:o;2663:184::-;2715:77;2712:1;2705:88;2812:4;2809:1;2802:15;2836:4;2833:1;2826:15;2852:128;2892:3;2923:1;2919:6;2916:1;2913:13;2910:39;;;2929:18;;:::i;:::-;-1:-1:-1;2965:9:195;;2852:128::o;2985:125::-;3025:4;3053:1;3050;3047:8;3044:34;;;3058:18;;:::i;:::-;-1:-1:-1;3095:9:195;;2985:125::o"
var PreimageOracleDeployedSourceMap = "57:2945:58:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;143:68;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;413:25:234;;;401:2;386:18;143:68:58;;;;;;;;217:66;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;614:14:234;;607:22;589:41;;577:2;562:18;217:66:58;449:187:234;290:454:58;;;;;;:::i;:::-;;:::i;:::-;;;;815:25:234;;;871:2;856:18;;849:34;;;;788:18;290:454:58;641:248:234;1537:1463:58;;;;;;:::i;:::-;;:::i;:::-;;1086:262;;;;;;:::i;:::-;1219:19;;;;:14;:19;;;;;;;;:31;;;;;;;;:38;;;;1253:4;1219:38;;;;;;1267:18;;;;;;;;:30;;;;;;;;;:37;;;;1314:20;;;;;;;;;;:27;1086:262;87:50;;;;;;:::i;:::-;;;;;;;;;;;;;;;290:454;388:11;439:19;;;:14;:19;;;;;;;;:27;;;;;;;;;388:11;;439:27;;431:59;;;;;;;2517:2:234;431:59:58;;;2499:21:234;2556:2;2536:18;;;2529:30;2595:21;2575:18;;;2568:49;2634:18;;431:59:58;;;;;;;;-1:-1:-1;521:14:58;538:20;;;509:2;538:20;;;;;;;;631:10;538:20;640:1;631:10;:::i;:::-;616:11;:6;625:2;616:11;:::i;:::-;:25;612:84;;679:6;666:10;:6;675:1;666:10;:::i;:::-;:19;;;;:::i;:::-;657:28;;612:84;-1:-1:-1;711:18:58;;;;:13;:18;;;;;;;;:26;;;;;;;;;;;;290:454;;-1:-1:-1;290:454:58:o;1537:1463::-;1831:4;1818:18;1636:12;;1966:1;1956:12;;1941:28;;1931:84;;1999:1;1996;1989:12;1931:84;2258:3;2254:14;;;2158:4;2242:27;2289:11;2263:4;2408:15;2289:11;2390:40;2620:28;;;2624:11;2620:28;2614:35;2671:20;;;;2818:19;2811:27;2840:11;2808:44;2871:19;;;;2849:1;2871:19;;;;;;;;:31;;;;;;;;:38;;;;2905:4;2871:38;;;;;;2919:18;;;;;;;;:30;;;;;;;;;:37;;;;2966:20;;;;;;;;;;;:27;;;;-1:-1:-1;;;;1537:1463:58:o;14:248:234:-;82:6;90;143:2;131:9;122:7;118:23;114:32;111:52;;;159:1;156;149:12;111:52;-1:-1:-1;;182:23:234;;;252:2;237:18;;;224:32;;-1:-1:-1;14:248:234:o;894:659::-;973:6;981;989;1042:2;1030:9;1021:7;1017:23;1013:32;1010:52;;;1058:1;1055;1048:12;1010:52;1094:9;1081:23;1071:33;;1155:2;1144:9;1140:18;1127:32;1178:18;1219:2;1211:6;1208:14;1205:34;;;1235:1;1232;1225:12;1205:34;1273:6;1262:9;1258:22;1248:32;;1318:7;1311:4;1307:2;1303:13;1299:27;1289:55;;1340:1;1337;1330:12;1289:55;1380:2;1367:16;1406:2;1398:6;1395:14;1392:34;;;1422:1;1419;1412:12;1392:34;1467:7;1462:2;1453:6;1449:2;1445:15;1441:24;1438:37;1435:57;;;1488:1;1485;1478:12;1435:57;1519:2;1515;1511:11;1501:21;;1541:6;1531:16;;;;;894:659;;;;;:::o;1558:385::-;1644:6;1652;1660;1668;1721:3;1709:9;1700:7;1696:23;1692:33;1689:53;;;1738:1;1735;1728:12;1689:53;-1:-1:-1;;1761:23:234;;;1831:2;1816:18;;1803:32;;-1:-1:-1;1882:2:234;1867:18;;1854:32;;1933:2;1918:18;1905:32;;-1:-1:-1;1558:385:234;-1:-1:-1;1558:385:234:o;1948:180::-;2007:6;2060:2;2048:9;2039:7;2035:23;2031:32;2028:52;;;2076:1;2073;2066:12;2028:52;-1:-1:-1;2099:23:234;;1948:180;-1:-1:-1;1948:180:234:o;2663:184::-;2715:77;2712:1;2705:88;2812:4;2809:1;2802:15;2836:4;2833:1;2826:15;2852:128;2892:3;2923:1;2919:6;2916:1;2913:13;2910:39;;;2929:18;;:::i;:::-;-1:-1:-1;2965:9:234;;2852:128::o;2985:125::-;3025:4;3053:1;3050;3047:8;3044:34;;;3058:18;;:::i;:::-;-1:-1:-1;3095:9:234;;2985:125::o"
func init() {
if err := json.Unmarshal([]byte(PreimageOracleStorageLayoutJSON), PreimageOracleStorageLayout); err != nil {
......
......@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
const SystemConfigStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)50_storage\"},{\"astId\":1003,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":1004,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":1005,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"overhead\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_uint256\"},{\"astId\":1006,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"scalar\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_uint256\"},{\"astId\":1007,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"batcherHash\",\"offset\":0,\"slot\":\"103\",\"type\":\"t_bytes32\"},{\"astId\":1008,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"gasLimit\",\"offset\":0,\"slot\":\"104\",\"type\":\"t_uint64\"},{\"astId\":1009,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_resourceConfig\",\"offset\":0,\"slot\":\"105\",\"type\":\"t_struct(ResourceConfig)1945_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\",\"base\":\"t_uint256\"},\"t_array(t_uint256)50_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\",\"base\":\"t_uint256\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_struct(ResourceConfig)1945_storage\":{\"encoding\":\"inplace\",\"label\":\"struct ResourceMetering.ResourceConfig\",\"numberOfBytes\":\"32\"},\"t_uint128\":{\"encoding\":\"inplace\",\"label\":\"uint128\",\"numberOfBytes\":\"16\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint32\":{\"encoding\":\"inplace\",\"label\":\"uint32\",\"numberOfBytes\":\"4\"},\"t_uint64\":{\"encoding\":\"inplace\",\"label\":\"uint64\",\"numberOfBytes\":\"8\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
const SystemConfigStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)50_storage\"},{\"astId\":1003,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":1004,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":1005,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"overhead\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_uint256\"},{\"astId\":1006,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"scalar\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_uint256\"},{\"astId\":1007,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"batcherHash\",\"offset\":0,\"slot\":\"103\",\"type\":\"t_bytes32\"},{\"astId\":1008,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"gasLimit\",\"offset\":0,\"slot\":\"104\",\"type\":\"t_uint64\"},{\"astId\":1009,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_resourceConfig\",\"offset\":0,\"slot\":\"105\",\"type\":\"t_struct(ResourceConfig)34954_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\",\"base\":\"t_uint256\"},\"t_array(t_uint256)50_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\",\"base\":\"t_uint256\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_struct(ResourceConfig)34954_storage\":{\"encoding\":\"inplace\",\"label\":\"struct ResourceMetering.ResourceConfig\",\"numberOfBytes\":\"32\"},\"t_uint128\":{\"encoding\":\"inplace\",\"label\":\"uint128\",\"numberOfBytes\":\"16\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint32\":{\"encoding\":\"inplace\",\"label\":\"uint32\",\"numberOfBytes\":\"4\"},\"t_uint64\":{\"encoding\":\"inplace\",\"label\":\"uint64\",\"numberOfBytes\":\"8\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
var SystemConfigStorageLayout = new(solc.StorageLayout)
......
......@@ -95,6 +95,9 @@ func (s *SourceMap) Info(pc uint64) (source string, line uint32, col uint32) {
if s.PosData[instr.F] == nil { // when the source file is known to be unavailable
return
}
if int(instr.S) >= len(s.PosData[instr.F]) { // possibly invalid / truncated source mapping
return
}
lc := s.PosData[instr.F][instr.S]
line = lc.Line
col = lc.Col
......
......@@ -3,6 +3,8 @@ package fault
import (
"context"
"sync"
"github.com/ethereum/go-ethereum/log"
)
type Agent struct {
......@@ -12,15 +14,17 @@ type Agent struct {
trace TraceProvider
responder Responder
maxDepth int
log log.Logger
}
func NewAgent(game Game, maxDepth int, trace TraceProvider, responder Responder) Agent {
func NewAgent(game Game, maxDepth int, trace TraceProvider, responder Responder, log log.Logger) Agent {
return Agent{
game: game,
solver: NewSolver(maxDepth, trace),
trace: trace,
responder: responder,
maxDepth: maxDepth,
log: log,
}
}
......@@ -38,19 +42,30 @@ func (a *Agent) AddClaim(claim Claim) error {
func (a *Agent) PerformActions() {
a.mu.Lock()
defer a.mu.Unlock()
for _, pair := range a.game.ClaimPairs() {
_ = a.move(pair.claim, pair.parent)
for _, claim := range a.game.Claims() {
_ = a.move(claim)
}
}
// move determines & executes the next move given a claim pair
func (a *Agent) move(claim, parent Claim) error {
move, err := a.solver.NextMove(claim)
if err != nil || move == nil {
func (a *Agent) move(claim Claim) error {
nextMove, err := a.solver.NextMove(claim)
if err != nil {
a.log.Warn("Failed to execute the next move", "err", err)
return err
}
if a.game.IsDuplicate(*move) {
if nextMove == nil {
a.log.Info("No next move")
return nil
}
move := *nextMove
log := a.log.New("is_defend", move.DefendsParent(), "depth", move.Depth(), "index_at_depth", move.IndexAtDepth(), "value", move.Value,
"letter", string(move.Value[31:]), "trace_index", move.Value[30],
"parent_letter", string(claim.Value[31:]), "parent_trace_index", claim.Value[30])
if a.game.IsDuplicate(move) {
log.Debug("Duplicate move")
return nil
}
return a.responder.Respond(context.TODO(), *move)
log.Info("Performing move")
return a.responder.Respond(context.TODO(), move)
}
package examples
import (
"os"
"github.com/ethereum-optimism/optimism/op-challenger/fault"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
)
func FullGame() {
log.Root().SetHandler(
log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stdout, log.TerminalFormat(true))),
)
canonical := "abcdefgh"
disputed := "abcdexyz"
maxDepth := uint64(3)
canonicalProvider := fault.NewAlphabetProvider(canonical, maxDepth)
disputedProvider := fault.NewAlphabetProvider(disputed, maxDepth)
root := fault.Claim{
ClaimData: fault.ClaimData{
Value: common.HexToHash("0x000000000000000000000000000000000000000000000000000000000000077a"),
Position: fault.NewPosition(0, 0),
},
}
o := fault.NewOrchestrator(maxDepth, []fault.TraceProvider{canonicalProvider, disputedProvider}, []string{"charlie", "mallory"}, root)
o.Start()
}
......@@ -37,17 +37,6 @@ func SolverExampleOne() {
},
}
// Note: We have to create the first counter claim seperately because next move does not know how to counter
// the root claim at this time.
// Counter claim is d at trace index 3 from the canonical provider
counter := fault.Claim{
ClaimData: fault.ClaimData{
Value: common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000364"),
Position: fault.NewPosition(1, 0),
},
Parent: root.ClaimData,
}
canonicalProvider := fault.NewAlphabetProvider(canonical, uint64(maxDepth))
disputedProvider := fault.NewAlphabetProvider(disputed, uint64(maxDepth))
......@@ -63,17 +52,22 @@ func SolverExampleOne() {
fmt.Println("go left to d, then right to x (cannonical is f), then left to e")
fmt.Println()
PrettyPrintAlphabetClaim("Root claim", root)
PrettyPrintAlphabetClaim("Counter claim", counter)
claim1, err := disputedSolver.NextMove(counter)
claim1, err := cannonicalSolver.NextMove(root)
if err != nil {
fmt.Printf("error getting claim from provider: %v", err)
}
PrettyPrintAlphabetClaim("Cannonical move", *claim1)
claim2, err := disputedSolver.NextMove(*claim1)
if err != nil {
fmt.Printf("error getting claim from disputed provider: %v", err)
fmt.Printf("error getting claim from provider: %v", err)
}
PrettyPrintAlphabetClaim("Disputed moved", *claim1)
PrettyPrintAlphabetClaim("Disputed moved", *claim2)
claim2, err := cannonicalSolver.NextMove(*claim1)
claim3, err := cannonicalSolver.NextMove(*claim2)
if err != nil {
fmt.Printf("error getting claim from disputed provider: %v", err)
fmt.Printf("error getting claim from provider: %v", err)
}
PrettyPrintAlphabetClaim("Cannonical move", *claim2)
PrettyPrintAlphabetClaim("Cannonical move", *claim3)
}
......@@ -5,8 +5,8 @@ import (
)
func main() {
examples.SolverExampleOne()
examples.FullGame()
// examples.SolverExampleOne()
// examples.PositionExampleOne()
// examples.PositionExampleTwo()
}
......@@ -17,11 +17,8 @@ type Game interface {
// Put adds a claim into the game state.
Put(claim Claim) error
// ClaimPairs returns a list of claim pairs.
ClaimPairs() []struct {
claim Claim
parent Claim
}
// Claims returns all of the claims in the game.
Claims() []Claim
IsDuplicate(claim Claim) bool
}
......@@ -93,8 +90,8 @@ func (g *gameState) recurseTree(treeNode *Node, claim ClaimData) (*Node, error)
// Put adds a claim into the game state.
func (g *gameState) Put(claim Claim) error {
// If the claim is the root node and the node is set, return an error.
if claim.IsRoot() && g.root.self != (Claim{}) {
// The game is always initialized with a root claim. Cannot add a second.
if claim.IsRoot() {
return ErrClaimExists
}
......@@ -132,40 +129,15 @@ func (g *gameState) IsDuplicate(claim Claim) bool {
return ok
}
// recurseTreePairs recursively walks down the tree from the root node
// returning a list of claim and parent pairs.
func (g *gameState) recurseTreePairs(current *Node) []struct {
claim Claim
parent Claim
} {
// Create a list of claim pairs.
pairs := make([]struct {
claim Claim
parent Claim
}, 0)
// Iterate over all children of the current node.
for _, child := range current.children {
// Add the current node to the list of pairs.
pairs = append(pairs, struct {
claim Claim
parent Claim
}{
claim: child.self,
parent: current.self,
})
// Recurse down the tree.
pairs = append(pairs, g.recurseTreePairs(child)...)
}
return pairs
func (g *gameState) Claims() []Claim {
return g.root.claims()
}
// ClaimPairs returns a list of claim pairs.
func (g *gameState) ClaimPairs() []struct {
claim Claim
parent Claim
} {
return g.recurseTreePairs(&g.root)
func (n *Node) claims() []Claim {
var out []Claim
out = append(out, n.self)
for _, c := range n.children {
out = append(out, c.claims()...)
}
return out
}
......@@ -121,10 +121,7 @@ func TestGame_ClaimPairs(t *testing.T) {
require.NoError(t, err)
// Validate claim pairs.
expected := []struct{ claim, parent Claim }{
{middle, top},
{bottom, middle},
}
pairs := g.ClaimPairs()
require.ElementsMatch(t, expected, pairs)
expected := []Claim{top, middle, bottom}
claims := g.Claims()
require.ElementsMatch(t, expected, claims)
}
package fault
import (
"context"
"os"
"time"
"github.com/ethereum/go-ethereum/log"
)
type Orchestrator struct {
agents []Agent
outputChs []chan Claim
responses chan Claim
}
func NewOrchestrator(maxDepth uint64, traces []TraceProvider, names []string, root Claim) Orchestrator {
o := Orchestrator{
responses: make(chan Claim, 100),
outputChs: make([]chan Claim, len(traces)),
agents: make([]Agent, len(traces)),
}
log.Info("Starting game", "root_letter", string(root.Value[31:]))
for i, trace := range traces {
game := NewGameState(root)
o.agents[i] = NewAgent(game, int(maxDepth), trace, &o, log.New("role", names[i]))
o.outputChs[i] = make(chan Claim)
}
return o
}
func (o *Orchestrator) Respond(_ context.Context, response Claim) error {
o.responses <- response
return nil
}
func (o *Orchestrator) Start() {
for i := 0; i < len(o.agents); i++ {
go runAgent(&o.agents[i], o.outputChs[i])
}
o.responderThread()
}
func runAgent(agent *Agent, claimCh <-chan Claim) {
for {
agent.PerformActions()
// Note: Should drain the channel here
claim := <-claimCh
_ = agent.AddClaim(claim)
}
}
func (o *Orchestrator) responderThread() {
timer := time.NewTimer(200 * time.Millisecond)
defer timer.Stop()
for {
select {
case resp := <-o.responses:
timer.Reset(200 * time.Millisecond)
for _, ch := range o.outputChs {
// Copy it. Should be immutable, but be sure.
resp := resp
ch <- resp
}
case <-timer.C:
os.Exit(0)
}
}
}
......@@ -23,6 +23,21 @@ func NewSolver(gameDepth int, traceProvider TraceProvider) *Solver {
// NextMove returns the next move to make given the current state of the game.
func (s *Solver) NextMove(claim Claim) (*Claim, error) {
// Special case of the root claim
if claim.IsRoot() {
agree, err := s.agreeWithClaim(claim.ClaimData)
if err != nil {
return nil, err
}
// Attack the root claim if we do not agree with it
if !agree {
return s.attack(claim)
} else {
return nil, nil
}
}
parentCorrect, err := s.agreeWithClaim(claim.Parent)
if err != nil {
return nil, err
......@@ -31,6 +46,9 @@ func (s *Solver) NextMove(claim Claim) (*Claim, error) {
if err != nil {
return nil, err
}
if claim.Depth() == s.gameDepth {
return nil, errors.New("game depth reached")
}
if parentCorrect && claimCorrect {
// We agree with the parent, but the claim is disagreeing with it.
// Since we agree with the claim, the difference must be to the right of the claim
......
......@@ -22,6 +22,20 @@ func TestSolver_NextMove_Opponent(t *testing.T) {
claim Claim
response ClaimData
}{
{
7,
Claim{
ClaimData: ClaimData{
Value: common.HexToHash("0x000000000000000000000000000000000000000000000000000000000000077a"),
Position: NewPosition(0, 0),
},
// Root claim has no parent
},
ClaimData{
Value: common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000364"),
Position: NewPosition(1, 0),
},
},
{
3,
Claim{
......
......@@ -32,6 +32,10 @@ type ClaimData struct {
type Claim struct {
ClaimData
Parent ClaimData
// Location of the claim & it's parent inside the contract. Does not exist
// for claims that have not made it to the contract.
ContractIndex int
ParentContractIndex int
}
// IsRoot returns true if this claim is the root claim.
......
......@@ -10,10 +10,11 @@ REBUILD_ALL_PATTERNS = [
r'^\.circleci/\.*',
r'^\.github/\.*',
r'^package\.json',
r'^yarn\.lock',
r'ops/check-changed/.*',
r'^go\.mod',
r'^go\.sum',
r'^pnpm-lock\.yaml',
r'ops/check-changed/.*'
]
WHITELISTED_BRANCHES = {
......
......@@ -3,7 +3,7 @@
#
# Stage 0 (named `manifests`) collects
# dependency manifest files (`package.json` and `yarn.lock`) which are then
# dependency manifest files (`package.json` and `pnpm-lock.yaml`) which are then
# used by stage 1 to install these dependencies
# development. The only reason we need a separate stage just for collecting the
# dependency manifests is that Docker's `COPY` command still does not allow
......@@ -17,41 +17,47 @@ FROM alpine:3.16 as manifests
RUN apk add coreutils
WORKDIR /tmp
COPY yarn.lock .nvmrc package.json ./src/
COPY pnpm-lock.yaml pnpm-workspace.yaml .nvmrc package.json ./src/
COPY packages src/packages/
RUN mkdir manifests && \
cd src && \
# copy package.json recursively
find . -name 'package.json' | xargs cp --parents -t ../manifests/ && \
# yarn.lock
cp yarn.lock ../manifests/ && \
# pnpm-lock.yaml
cp pnpm-lock.yaml ../manifests/ && \
# pnpm-workspace.yaml
cp pnpm-workspace.yaml ../manifests/ && \
# .nvmrc
cp .nvmrc ../manifests/
FROM ethereumoptimism/foundry:latest as foundry
FROM node:16-alpine3.14 as base
# bullseye-slim is debian based
# we use it rather than alpien because it's not much
# bigger and alpine is often missing packages for node applications
# alpine is not officially supported by node.js
FROM node:16.16.0-bullseye-slim as base
# Base: install deps
RUN apk --no-cache add curl \
RUN apt-get update && apt-get install -y \
curl \
jq \
python3 \
ca-certificates \
git \
g++ \
make \
gcc \
musl-dev \
linux-headers \
bash \
build-base \
gcompat
# the following 4 deps are needed for node-hid
# which is a deep sub dependency of ethers to install
# correctly
pkg-config \
libusb-1.0-0-dev \
libudev-dev \
--no-install-recommends
ENV GLIBC_KEY=https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
ENV GLIBC_KEY_FILE=/etc/apk/keys/sgerrand.rsa.pub
ENV GLIBC_RELEASE=https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk
RUN wget -q -O ${GLIBC_KEY_FILE} ${GLIBC_KEY} \
&& wget -O glibc.apk ${GLIBC_RELEASE} \
&& apk add glibc.apk --force
RUN npm install pnpm --global
COPY --from=foundry /usr/local/bin/forge /usr/local/bin/forge
COPY --from=foundry /usr/local/bin/cast /usr/local/bin/cast
......@@ -59,37 +65,38 @@ COPY --from=foundry /usr/local/bin/cast /usr/local/bin/cast
WORKDIR /opt/optimism
# Copy manifest files into the image in
# preparation for `yarn install`.
# preparation for `pnpm install`.
COPY --from=manifests /tmp/manifests ./
COPY *.json ./
RUN yarn install --frozen-lockfile && yarn cache clean
RUN pnpm install --frozen-lockfile
COPY ./packages ./packages
RUN yarn build
RUN pnpm build
FROM base as fault-detector
WORKDIR /opt/optimism/packages/fault-detector
COPY ./ops/scripts/detector.sh .
CMD ["npm", "run", "start"]
CMD ["pnpm", "run", "start"]
FROM base as replica-healthcheck
WORKDIR /opt/optimism/packages/replica-healthcheck
ENTRYPOINT ["npm", "run", "start"]
ENTRYPOINT ["pnpm", "run", "start"]
FROM base as balance-mon
WORKDIR /opt/optimism/packages/chain-mon
ENTRYPOINT ["npm", "run", "start:balance-mon"]
ENTRYPOINT ["pnpm", "run", "start:balance-mon"]
FROM base as drippie-mon
WORKDIR /opt/optimism/packages/chain-mon
ENTRYPOINT ["npm", "run", "start:drippie-mon"]
ENTRYPOINT ["pnpm", "run", "start:drippie-mon"]
FROM base as wd-mon
WORKDIR /opt/optimism/packages/chain-mon
ENTRYPOINT ["yarn", "run", "start:wd-mon"]
ENTRYPOINT ["pnpm", "run", "start:wd-mon"]
FROM base as wallet-mon
WORKDIR /opt/optimism/packages/chain-mon
ENTRYPOINT ["yarn", "run", "start:wallet-mon"]
ENTRYPOINT ["pnpm", "run", "start:wallet-mon"]
......@@ -50,13 +50,18 @@ RUN apt-get update && \
ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt && \
bash nodesource_setup.sh && \
apt-get install -y nodejs && \
npm i -g npm@8.11.0 \
npm i -g yarn && \
npm i -g depcheck && \
pip install slither-analyzer==0.9.3 && \
go install gotest.tools/gotestsum@latest && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.48.0 && \
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | bash
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | bash &&
chmox +x /usr/local/bin/check-changed
RUN echo "downloading pnpm" && \
curl -o /pnpm-install.sh -L https://get.pnpm.io/install.sh && \
chmod +x /pnpm-install.sh && \
/pnpm-install.sh && \
rm /pnpm-install.sh
RUN echo "downloading solidity compilers" && \
curl -o solc-linux-amd64-v0.5.17+commit.d19bba13 -sL https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.5.17+commit.d19bba13 && \
......
......@@ -16,4 +16,4 @@ curl \
$FAULT_DETECTOR__L2_RPC_PROVIDER
# go
exec yarn start
exec pnpm start
......@@ -3,6 +3,7 @@
"version": "1.0.0",
"author": "Optimism PBC",
"license": "MIT",
"private": true,
"workspaces": {
"packages": [
"packages/*",
......@@ -22,7 +23,9 @@
"forta-agent"
]
},
"private": true,
"engines": {
"pnpm": ">=8"
},
"scripts": {
"clean": "npx nx run-many --target=clean",
"build": "npx nx run-many --target=build",
......@@ -32,15 +35,15 @@
"lint:ts:check": "npx nx run-many --target=lint:ts:check",
"lint:check": "npx nx run-many --target=lint:check",
"lint:fix": "npx nx run-many --target=lint:fix",
"lint:specs:fix": "yarn run markdownlint-cli2-fix \"./specs/**/*.md\"",
"lint:specs:check": "yarn run markdownlint-cli2 \"./specs/**/*.md\"",
"lint:specs:toc": "yarn run doctoc '--title=**Table of Contents**' ./specs",
"postinstall": "patch-package",
"ready": "yarn lint && yarn test",
"lint:specs:fix": "npx markdownlint-cli2-fix \"./specs/**/*.md\"",
"lint:specs:check": "npx markdownlint-cli2 \"./specs/**/*.md\"",
"lint:specs:toc": "npx doctoc '--title=**Table of Contents**' ./specs",
"preinstall": "npx only-allow pnpm",
"postinstall": "patch-package && (test -d docs/op-stack && cd docs/op-stack && npx yarn@1 install && cd ../.. || exit 0)",
"ready": "pnpm lint && pnpm test",
"prepare": "husky install",
"release": "yarn build && yarn changeset publish",
"update:yarn": "yarn set version 1.x",
"install:foundry": "curl -L https://foundry.paradigm.xyz | bash && yarn update:foundry",
"release": "pnpm build && pnpm changeset publish",
"install:foundry": "curl -L https://foundry.paradigm.xyz | bash && pnpm update:foundry",
"update:foundry": "foundryup -C $(cat .foundryrc)"
},
"devDependencies": {
......@@ -50,13 +53,13 @@
"@types/chai-as-promised": "^7.1.4",
"@types/mocha": "^8.2.2",
"@types/node": "^12.0.0",
"@typescript-eslint/eslint-plugin": "^5.45.1",
"@typescript-eslint/parser": "^5.45.1",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"chai": "^4.2.0",
"copyfiles": "^2.3.0",
"depcheck": "^1.4.3",
"doctoc": "^2.2.0",
"eslint": "^8.16.0",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.26.0",
......@@ -68,6 +71,7 @@
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-unicorn": "^42.0.0",
"husky": "^6.0.0",
"lerna": "^6.0.0",
"lint-staged": "11.0.0",
"markdownlint": "^0.24.0",
"markdownlint-cli2": "0.4.0",
......
......@@ -10,8 +10,8 @@ Clone, install, and build the Optimism monorepo:
```
git clone https://github.com/ethereum-optimism/optimism.git
yarn install
yarn build
pnpm install
pnpm build
```
## Running a service
......@@ -20,11 +20,11 @@ Copy `.env.example` into a new file named `.env`, then set the environment varia
Once your environment variables have been set, run via:
```
yarn start:<service name>
pnpm start:<service name>
```
For example, to run `drippie-mon`, execute:
```
yarn start:drippie-mon
pnpm start:drippie-mon
```
......@@ -16,9 +16,9 @@
"test:coverage": "echo 'No tests defined.'",
"build": "tsc -p ./tsconfig.json",
"clean": "rimraf dist/ ./tsconfig.tsbuildinfo",
"lint": "yarn lint:fix && yarn lint:check",
"lint": "pnpm lint:fix && pnpm lint:check",
"pre-commit": "lint-staged",
"lint:fix": "yarn lint:check --fix",
"lint:fix": "pnpm lint:check --fix",
"lint:check": "eslint . --max-warnings=0"
},
"keywords": [
......
......@@ -9,12 +9,12 @@
"src/*"
],
"scripts": {
"all": "yarn clean && yarn build && yarn test && yarn lint:fix && yarn lint",
"all": "pnpm clean && pnpm build && pnpm test && pnpm lint:fix && pnpm lint",
"build": "tsc -p tsconfig.json",
"clean": "rimraf dist/ ./tsconfig.tsbuildinfo",
"lint:check": "eslint . --max-warnings=0",
"lint:fix": "yarn lint:check --fix",
"lint": "yarn lint:fix && yarn lint:check",
"lint:fix": "pnpm lint:check --fix",
"lint": "pnpm lint:fix && pnpm lint:check",
"pre-commit": "lint-staged",
"test": "ts-mocha test/*.spec.ts",
"test:coverage": "nyc ts-mocha test/*.spec.ts && nyc merge .nyc_output coverage.json"
......
......@@ -56,28 +56,28 @@ npm install @eth-optimism/contracts-bedrock
We work on this repository with a combination of [Hardhat](https://hardhat.org) and [Foundry](https://getfoundry.sh/).
1. Install node modules with yarn (v1) and Node.js (16+):
1. Install node modules with pnpm (v8) and Node.js (16+):
```shell
yarn install
pnpm install
```
1. Install the correct version of foundry (defined in the .foundryrc file in the root of this repo.
2. Install the correct version of foundry (defined in the .foundryrc file in the root of this repo.
```shell
yarn install:foundry
pnpm install:foundry
```
### Build
```shell
yarn build
pnpm build
```
### Tests
```shell
yarn test
pnpm test
```
#### Running Echidna tests
......@@ -85,10 +85,10 @@ yarn test
You must have [Echidna](https://github.com/crytic/echidna) installed.
Contracts targetted for Echidna testing are located in `./contracts/echidna`
Each target contract is tested with a separate yarn command, for example:
Each target contract is tested with a separate pnpm command, for example:
```shell
yarn echidna:aliasing
pnpm echidna:aliasing
```
### Deployment
......
......@@ -145,9 +145,9 @@ contract MIPS {
if lt(space, datLen) { datLen := space } // if less space than data, shorten data
if lt(a2, datLen) { datLen := a2 } // if requested to read less, read less
dat := shr(sub(256, mul(datLen, 8)), dat) // right-align data
dat := shl(mul(alignment, 8), dat) // position data to insert into memory word
dat := shl(mul(add(sub(4, datLen), alignment), 8), dat) // position data to insert into memory word
let mask := sub(shl(mul(sub(4, alignment), 8), 1), 1) // mask all bytes after start
let suffixMask := sub(shl(mul(add(sub(4, alignment), datLen), 8), 1), 1) // mask of all bytes starting from end, maybe none
let suffixMask := sub(shl(mul(sub(sub(4, alignment), datLen), 8), 1), 1) // mask of all bytes starting from end, maybe none
mask := and(mask, not(suffixMask)) // reduce mask to just cover the data we insert
mem := or(and(mem, not(mask)), dat) // clear masked part of original memory, and insert data
}
......
......@@ -19,6 +19,8 @@ build_info_path = 'artifacts/build-info'
ffi = true
fuzz_runs = 16
no_match_contract = 'EchidnaFuzz'
# PNPM symlinks all node_modules from the monorepo root
allow_paths = ["../../node_modules", "./**"]
fs_permissions = [
{ 'access'='read-write', 'path'='./.resource-metering.csv' },
......
......@@ -2,7 +2,7 @@
This directory contains documentation for all defined invariant tests within `contracts-bedrock`.
<!-- Do not modify the following section manually. It will be automatically generated on running `yarn autogen:invariant-docs` -->
<!-- Do not modify the following section manually. It will be automatically generated on running `pnpm autogen:invariant-docs` -->
<!-- START autoTOC -->
## Table of Contents
......@@ -23,7 +23,7 @@ This directory contains documentation for all defined invariant tests within `co
## Usage
To auto-generate documentation for invariant tests, run `yarn autogen:invariant-docs`.
To auto-generate documentation for invariant tests, run `pnpm autogen:invariant-docs`.
## Documentation Standard
......
......@@ -10,18 +10,18 @@
],
"scripts": {
"bindings": "cd ../../op-bindings && make",
"build:with-metadata": "FOUNDRY_PROFILE=echidna yarn build:forge",
"build:with-metadata": "FOUNDRY_PROFILE=echidna pnpm build:forge",
"build": "npx nx build:contracts",
"prebuild:contracts": "./scripts/verify-foundry-install.sh",
"build:contracts": "yarn build:forge",
"build:contracts": "pnpm build:forge",
"build:forge": "forge build",
"build:differential": "go build -o ./scripts/differential-testing/differential-testing ./scripts/differential-testing",
"build:fuzz": "(cd test-case-generator && go build ./cmd/fuzz.go)",
"autogen:invariant-docs": "ts-node scripts/invariant-doc-gen.ts",
"test": "yarn build:differential && yarn build:fuzz && forge test",
"coverage": "yarn build:differential && yarn build:fuzz && forge coverage",
"coverage:lcov": "yarn build:differential && yarn build:fuzz && forge coverage --report lcov",
"gas-snapshot": "yarn build:differential && yarn build:fuzz && forge snapshot --no-match-test 'testDiff|testFuzz|invariant|generateArtifact'",
"test": "pnpm build:differential && pnpm build:fuzz && forge test",
"coverage": "pnpm build:differential && pnpm build:fuzz && forge coverage",
"coverage:lcov": "pnpm build:differential && pnpm build:fuzz && forge coverage --report lcov",
"gas-snapshot": "pnpm build:differential && pnpm build:fuzz && forge snapshot --no-match-test 'testDiff|testFuzz|invariant|generateArtifact'",
"storage-snapshot": "./scripts/storage-snapshot.sh",
"validate-deploy-configs": "./scripts/validate-deploy-configs.sh",
"validate-spacers": "forge build && npx ts-node scripts/validate-spacers.ts",
......@@ -30,12 +30,12 @@
"clean": "rm -rf ./dist ./artifacts ./forge-artifacts ./cache ./tsconfig.tsbuildinfo ./tsconfig.build.tsbuildinfo ./src/contract-artifacts.ts ./test-case-generator/fuzz",
"lint:ts:check": "eslint . --max-warnings=0",
"lint:forge-tests:check": "ts-node scripts/forge-test-names.ts",
"lint:contracts:check": "yarn solhint -f table 'contracts/**/!(DisputeTypes).sol' && yarn prettier --check 'contracts/**/!(DisputeTypes).sol' && yarn lint:forge-tests:check",
"lint:check": "yarn lint:contracts:check && yarn lint:ts:check",
"lint:contracts:check": "pnpm solhint -f table 'contracts/**/!(DisputeTypes|RLPReader).sol' && pnpm prettier --check 'contracts/**/!(DisputeTypes|RLPReader).sol' && pnpm lint:forge-tests:check",
"lint:check": "pnpm lint:contracts:check && pnpm lint:ts:check",
"lint:ts:fix": "eslint --fix .",
"lint:contracts:fix": "yarn solhint --fix 'contracts/**/!(DisputeTypes).sol' && yarn prettier --write 'contracts/**/!(DisputeTypes).sol'",
"lint:fix": "yarn lint:contracts:fix && yarn lint:ts:fix",
"lint": "yarn lint:fix && yarn lint:check",
"lint:contracts:fix": "pnpm solhint --fix 'contracts/**/!(DisputeTypes|RLPReader).sol' && pnpm prettier --write 'contracts/**/!(DisputeTypes|RLPReader).sol'",
"lint:fix": "pnpm lint:contracts:fix && pnpm lint:ts:fix",
"lint": "pnpm lint:fix && pnpm lint:check",
"echidna:aliasing": "echidna-test --contract EchidnaFuzzAddressAliasing --config ./echidna.yaml .",
"echidna:burn:gas": "echidna-test --contract EchidnaFuzzBurnGas --config ./echidna.yaml .",
"echidna:burn:eth": "echidna-test --contract EchidnaFuzzBurnEth --config ./echidna.yaml .",
......@@ -48,17 +48,17 @@
"@eth-optimism/core-utils": "^0.12.1",
"@openzeppelin/contracts": "4.7.3",
"@openzeppelin/contracts-upgradeable": "4.7.3",
"@rari-capital/solmate": "https://github.com/rari-capital/solmate.git#8f9b23f8838670afda0fd8983f2c41e8037ae6bc",
"clones-with-immutable-args": "https://github.com/Saw-mon-and-Natalie/clones-with-immutable-args.git#105efee1b9127ed7f6fedf139e1fc796ce8791f2",
"@rari-capital/solmate": "github:transmissions11/solmate#8f9b23f8838670afda0fd8983f2c41e8037ae6bc",
"clones-with-immutable-args": "github:Saw-mon-and-Natalie/clones-with-immutable-args#105efee1b9127ed7f6fedf139e1fc796ce8791f2",
"ethers": "^5.7.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.45.1",
"@typescript-eslint/parser": "^5.45.1",
"ds-test": "https://github.com/dapphub/ds-test.git#9310e879db8ba3ea6d5c6489a579118fd264a3f5",
"forge-std": "https://github.com/foundry-rs/forge-std.git#e8a047e3f40f13fa37af6fe14e6e06283d9a060e",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"ds-test": "github:dapphub/ds-test#c9ce3f25bde29fc5eb9901842bf02850dfd2d084",
"forge-std": "github:foundry-rs/forge-std#e8a047e3f40f13fa37af6fe14e6e06283d9a060e",
"glob": "^7.1.6",
"solhint": "^3.3.7",
"solhint": "^3.4.1",
"solhint-plugin-prettier": "^0.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.3"
......
pragma solidity ^0.8.15;
import { Script } from "forge-std/Script.sol";
import { console2 as console } from "forge-std/console2.sol";
import { FaultDisputeGame_Init } from "../contracts/test/FaultDisputeGame.t.sol";
import { DisputeGameFactory } from "../contracts/dispute/DisputeGameFactory.sol";
import { FaultDisputeGame } from "../contracts/dispute/FaultDisputeGame.sol";
import { IFaultDisputeGame } from "../contracts/dispute/interfaces/IFaultDisputeGame.sol";
import "../contracts/libraries/DisputeTypes.sol";
import "../contracts/libraries/DisputeErrors.sol";
import { LibClock } from "../contracts/dispute/lib/LibClock.sol";
import { LibPosition } from "../contracts/dispute/lib/LibPosition.sol";
/**
* @title FaultDisputeGameViz
* @dev To run this script, make sure to install the `dagviz` & `eth_abi` python packages.
*/
contract FaultDisputeGameViz is Script, FaultDisputeGame_Init {
/// @dev The root claim of the game.
Claim internal constant ROOT_CLAIM = Claim.wrap(bytes32(uint256(10)));
/// @dev The absolute prestate of the trace.
Claim internal constant ABSOLUTE_PRESTATE = Claim.wrap(bytes32(uint256(0)));
function setUp() public override {
super.init(ROOT_CLAIM, ABSOLUTE_PRESTATE);
}
/**
* @dev Entry point
*/
function local() public {
// Construct the game by performing attacks, defenses, and steps.
// ...
buildGraph();
console.log("Saved graph to `./dispute_game.svg");
}
/**
* @dev Entry point
*/
function remote(address _addr) public {
gameProxy = FaultDisputeGame(_addr);
buildGraph();
console.log("Saved graph to `./dispute_game.svg");
}
/**
* @dev Uses the `dag-viz` python script to generate a visual model of the game state.
*/
function buildGraph() internal {
uint256 numClaims = uint256(vm.load(address(gameProxy), bytes32(uint256(1))));
IFaultDisputeGame.ClaimData[] memory gameData = new IFaultDisputeGame.ClaimData[](numClaims);
for (uint256 i = 0; i < numClaims; i++) {
(
uint32 parentIndex,
bool countered,
Claim claim,
Position position,
Clock clock
) = gameProxy.claimData(i);
gameData[i] = IFaultDisputeGame.ClaimData({
parentIndex: parentIndex,
countered: countered,
claim: claim,
position: position,
clock: clock
});
}
string[] memory commands = new string[](3);
commands[0] = "python3";
commands[1] = "scripts/dag-viz.py";
commands[2] = vm.toString(abi.encode(gameData));
vm.ffi(commands);
}
}
import sys
import dagviz
import networkx as nx
from eth_abi import decode
# The parent of the root claim is uint32 max.
ROOT_PARENT = 4294967295
# Get the abi-encoded input
b = sys.argv[1].removeprefix('0x')
# Decode the input
t = decode(['(uint32,bool,bytes32,uint128,uint128)[]'], bytes.fromhex(b))[0]
# Create the graph
G = nx.DiGraph()
for c in t:
claim = c[2].hex()
key = f"Position: {bin(c[3])[2:]} | Claim: 0x{claim[:4]}..{claim[60:64]}"
G.add_node(key)
if int(c[0]) != ROOT_PARENT:
pclaim = t[c[0]][2].hex()
G.add_edge(f"Position: {bin(t[c[0]][3])[2:]} | Claim: 0x{pclaim[:4]}..{pclaim[60:64]}", key)
r = dagviz.render_svg(G)
f = open('dispute_game.svg', 'w')
f.write(r)
f.close()
......@@ -10,7 +10,7 @@ A lightweight input fuzzing utility used for testing various Bedrock contracts.
## Usage
To build, run `yarn build:fuzz` from this directory or the `contract-bedrock` package.
To build, run `pnpm build:fuzz` from this directory or the `contract-bedrock` package.
To generate an abi-encoded fuzz case, pass in a mode via the `-m` flag as well as an optional variant via the `-v` flag.
......
"*.{ts,js}":
- eslint
"*.sol":
- yarn solhint -f table
- pnpm solhint -f table
......@@ -19,8 +19,9 @@ remappings = [
'multicall/=lib/multicall',
'@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/',
'@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/',
'@eth-optimism/contracts-bedrock/=../../node_modules/@eth-optimism/contracts-bedrock',
'@eth-optimism/contracts-bedrock/=node_modules/@eth-optimism/contracts-bedrock',
]
allow_paths = ["../../node_modules", "./**"]
# The metadata hash can be removed from the bytecode by setting "none"
bytecode_hash = "none"
libs = ["node_modules", "lib"]
......
......@@ -13,29 +13,29 @@
"contracts"
],
"scripts": {
"build": "yarn build:hh",
"build": "pnpm build:hh",
"build:hh": "hardhat compile --show-stack-traces",
"build:forge": "forge build",
"test": "yarn test:forge",
"test": "pnpm test:forge",
"test:forge": "forge test",
"test:coverage": "yarn test:coverage:forge",
"test:coverage": "pnpm test:coverage:forge",
"test:coverage:forge": "forge coverage",
"test:slither": "slither .",
"gas-snapshot": "forge snapshot",
"pretest:slither": "rm -f @openzeppelin && rm -f hardhat && ln -s node_modules/@openzeppelin @openzeppelin && ln -s ../../node_modules/hardhat hardhat",
"posttest:slither": "rm -f @openzeppelin && rm -f hardhat",
"lint:ts:check": "eslint . --max-warnings=0",
"lint:contracts:check": "yarn solhint -f table 'contracts/**/*.sol'",
"lint:check": "yarn lint:contracts:check && yarn lint:ts:check",
"lint:contracts:check": "pnpm solhint -f table 'contracts/**/*.sol'",
"lint:check": "pnpm lint:contracts:check && pnpm lint:ts:check",
"lint:ts:fix": "eslint --fix .",
"lint:contracts:fix": "yarn prettier --write 'contracts/**/*.sol'",
"lint:fix": "yarn lint:contracts:fix && yarn lint:ts:fix",
"lint": "yarn lint:fix && yarn lint:check",
"lint:contracts:fix": "pnpm prettier --write 'contracts/**/*.sol'",
"lint:fix": "pnpm lint:contracts:fix && pnpm lint:ts:fix",
"lint": "pnpm lint:fix && pnpm lint:check",
"clean": "rm -rf ./dist ./artifacts ./forge-artifacts ./cache ./coverage ./tsconfig.tsbuildinfo",
"prepublishOnly": "yarn copyfiles -u 1 -e \"**/test-*/**/*\" \"contracts/**/*\" ./",
"prepublishOnly": "pnpm copyfiles -u 1 -e \"**/test-*/**/*\" \"contracts/**/*\" ./",
"postpublish": "rimraf chugsplash L1 L2 libraries standards",
"prepack": "yarn prepublishOnly",
"postpack": "yarn postpublish",
"prepack": "pnpm prepublishOnly",
"postpack": "pnpm postpublish",
"pre-commit": "lint-staged"
},
"keywords": [
......@@ -60,20 +60,18 @@
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-etherscan": "^3.0.3",
"@nomiclabs/hardhat-waffle": "^2.0.3",
"@rari-capital/solmate": "7.0.0-alpha.3",
"@openzeppelin/contracts": "4.7.3",
"@openzeppelin/contracts-upgradeable": "4.7.3",
"@types/node": "^17.0.21",
"@rari-capital/solmate": "7.0.0-alpha.3",
"@typechain/ethers-v5": "^10.1.0",
"@typechain/hardhat": "^6.1.2",
"@types/node": "^17.0.21",
"babel-eslint": "^10.1.0",
"chai": "^4.3.4",
"copyfiles": "^2.3.0",
"dotenv": "^10.0.0",
"ds-test": "https://github.com/dapphub/ds-test.git#9310e879db8ba3ea6d5c6489a579118fd264a3f5",
"ethereum-waffle": "^3.4.4",
"ethers": "^5.7.0",
"forge-std": "https://github.com/foundry-rs/forge-std.git#e8a047e3f40f13fa37af6fe14e6e06283d9a060e",
"hardhat": "^2.9.6",
"hardhat-deploy": "^0.11.10",
"hardhat-gas-reporter": "^1.0.8",
......@@ -87,5 +85,9 @@
"solidity-coverage": "^0.7.17",
"ts-node": "^10.9.1",
"typechain": "^8.1.0"
},
"dependencies": {
"ds-test": "github:dapphub/ds-test#c9ce3f25bde29fc5eb9901842bf02850dfd2d084",
"forge-std": "github:foundry-rs/forge-std#e8a047e3f40f13fa37af6fe14e6e06283d9a060e"
}
}
......@@ -13,14 +13,14 @@
After cloning and switching to the repository, install dependencies:
```bash
$ yarn
$ pnpm i
```
Use the following commands to build, use, test, and lint:
```bash
$ yarn build
$ yarn start
$ yarn test
$ yarn lint
$ pnpm build
$ pnpm start
$ pnpm test
$ pnpm lint
```
......@@ -8,12 +8,12 @@
"dist/*"
],
"scripts": {
"all": "yarn clean && yarn build && yarn test && yarn lint:fix && yarn lint",
"all": "pnpm clean && pnpm build && pnpm test && pnpm lint:fix && pnpm lint",
"build": "tsc -p tsconfig.json",
"clean": "rimraf dist/ ./tsconfig.tsbuildinfo",
"lint": "yarn lint:fix && yarn lint:check",
"lint": "pnpm lint:fix && pnpm lint:check",
"lint:check": "eslint . --max-warnings=0",
"lint:fix": "yarn lint:check --fix",
"lint:fix": "pnpm lint:check --fix",
"pre-commit": "lint-staged",
"test": "ts-mocha test/**/*.spec.ts",
"test:coverage": "nyc ts-mocha test/**/*.spec.ts && nyc merge .nyc_output coverage.json"
......
......@@ -10,8 +10,8 @@ Clone, install, and build the Optimism monorepo:
```
git clone https://github.com/ethereum-optimism/optimism.git
yarn install
yarn build
pnpm install
pnpm build
```
## Running the service
......@@ -22,7 +22,7 @@ a custom op chain, the `OptimismPortal` contract addresses must also be set asso
Once your environment variables or flags have been set, run the service via:
```
yarn start
pnpm start
```
## Ports
......@@ -44,11 +44,10 @@ The state root of the block is published to the [`L2OutputOracle`](https://githu
We can therefore detect differences by, for each block, checking the state root of the given block as reported by an Optimism node and the state root as published to Ethereum.
We export a series of Prometheus metrics that you can use to trigger alerting when issues are detected.
Check the list of available metrics via `yarn start --help`:
Check the list of available metrics via `pnpm start --help`:
```sh
> yarn start --help
yarn run v1.22.19
> pnpm start --help
$ ts-node ./src/service.ts --help
Usage: service [options]
......@@ -71,6 +70,4 @@ Metrics:
l2_node_connection_failures Number of times L2 node connection has failed (type: Gauge)
metadata Service metadata (type: Gauge)
unhandled_errors Unhandled errors (type: Counter)
Done in 2.19s.
```
......@@ -14,11 +14,11 @@
"test": "hardhat test",
"test:coverage": "nyc hardhat test && nyc merge .nyc_output coverage.json",
"build": "tsc -p tsconfig.json",
"preview": "yarn build && yarn start",
"preview": "pnpm build && pnpm start",
"clean": "rimraf dist/ ./tsconfig.tsbuildinfo",
"lint": "yarn lint:fix && yarn lint:check",
"lint": "pnpm lint:fix && pnpm lint:check",
"pre-commit": "lint-staged",
"lint:fix": "yarn lint:check --fix",
"lint:fix": "pnpm lint:check --fix",
"lint:check": "eslint . --max-warnings=0"
},
"keywords": [
......
......@@ -5,5 +5,5 @@
## Installation
```
yarn add @eth-optimism/hardhat-deploy-config
pnpm i @eth-optimism/hardhat-deploy-config
```
......@@ -11,9 +11,9 @@
"test:coverage": "echo 'No tests defined.'",
"build": "tsc -p tsconfig.json",
"clean": "rimraf dist/ ./tsconfig.tsbuildinfo",
"lint": "yarn lint:fix && yarn lint:check",
"lint": "pnpm lint:fix && pnpm lint:check",
"pre-commit": "lint-staged",
"lint:fix": "yarn lint:check --fix",
"lint:fix": "pnpm lint:check --fix",
"lint:check": "eslint . --max-warnings=0"
},
"keywords": [
......
......@@ -13,8 +13,8 @@ Clone, install, and build the Optimism monorepo:
```
git clone https://github.com/ethereum-optimism/optimism.git
yarn install
yarn build
pnpm install
pnpm build
```
## Running the service (manual)
......@@ -23,11 +23,11 @@ Copy `.env.example` into a new file named `.env`, then set the environment varia
You can view a list of all environment variables and descriptions for each via:
```
yarn start --help
pnpm start --help
```
Once your environment variables have been set, run the relayer via:
```
yarn start
pnpm start
```
......@@ -13,9 +13,9 @@
"test:coverage": "echo 'No tests defined.'",
"build": "tsc -p tsconfig.json",
"clean": "rimraf ./dist ./tsconfig.tsbuildinfo",
"lint": "yarn run lint:fix && yarn run lint:check",
"lint": "pnpm run lint:fix && pnpm run lint:check",
"pre-commit": "lint-staged",
"lint:fix": "yarn lint:check --fix",
"lint:fix": "pnpm lint:check --fix",
"lint:check": "eslint . --max-warnings=0"
},
"keywords": [
......
......@@ -9,12 +9,12 @@
"src/*"
],
"scripts": {
"all": "yarn clean && yarn build && yarn test && yarn lint:fix && yarn lint",
"all": "pnpm clean && pnpm build && pnpm test && pnpm lint:fix && pnpm lint",
"build": "tsc -p tsconfig.json",
"clean": "rimraf dist/ ./tsconfig.tsbuildinfo",
"lint": "yarn lint:fix && yarn lint:check",
"lint": "pnpm lint:fix && pnpm lint:check",
"lint:check": "eslint . --max-warnings=0",
"lint:fix": "yarn lint:check --fix",
"lint:fix": "pnpm lint:check --fix",
"pre-commit": "lint-staged",
"test": "hardhat test",
"test:next": "vitest",
......
This diff is collapsed.
packages:
- 'packages/*'
- 'endpoint-monitor'
- 'op-exporter'
......@@ -308,7 +308,7 @@ A reference implementation of the L1 Attributes predeploy contract can be found
[L1Block.sol]: ../packages/contracts-bedrock/contracts/L2/L1Block.sol
After running `yarn build` in the `packages/contracts` directory, the bytecode to add to the genesis
After running `pnpm build` in the `packages/contracts` directory, the bytecode to add to the genesis
file will be located in the `deployedBytecode` field of the build artifacts file at
`/packages/contracts/artifacts/contracts/L2/L1Block.sol/L1Block.json`.
......
......@@ -13,7 +13,7 @@ You can spin up a local devnet via `docker-compose`.
For convenience, we have defined `make` targets to start and stop the devnet with a single command.
To run the devnet, you will need `docker` and `docker-compose` installed.
Then, as a precondition, make sure that you have compiled the contracts by `cd`ing into `packages/contracts`
and running `yarn` followed by `yarn build`. You'll only need to do this if you change the contracts in the future.
and running `pnpm i` followed by `pnpm build`. You'll only need to do this if you change the contracts in the future.
Then, run the following:
......
......@@ -24,10 +24,10 @@ Justification for linting rules in [.markdownlint.json](/.markdownlint.json):
- *no-emphasis-as-heading*: enable emphasized paragraphs
```shell
yarn # Install dependencies
yarn lint:specs:check # Run linter
yarn lint:specs:fix # Fix lint issues
yarn lint:specs:toc # Update TOC docs
pnpm i # Install dependencies
pnpm lint:specs:check # Run linter
pnpm lint:specs:fix # Fix lint issues
pnpm lint:specs:toc # Update TOC docs
# Check links
docker run --init -it -v `pwd`:/input lycheeverse/lychee --verbose --no-progress --exclude-loopback --exclude twitter.com --exclude-mail /input/README.md "/input/specs/**/*.md"
......
......@@ -13,7 +13,7 @@
## Linting
Respect the [linting rules] (you can run the linter with `yarn lint`).
Respect the [linting rules] (you can run the linter with `pnpm lint`).
Notably:
......
This diff is collapsed.
This diff is collapsed.
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