Commit b5c9af4d authored by Inphi's avatar Inphi Committed by GitHub

contracts: More robust abi/storage snapshot gen (#9950)

* contracts: More robust abi/storage snapshot gen

* update geth version used by ci

* ci: bump ci-builder rc

* ci-builder: pin foundry commit, update nvm

* ci: remove foundry commit pin, update foundry in versions.json

* ci: bump ci-builder to v0.46.0-rc.4

* update Kontrol snapshots

* set ast=true in foundry.toml; revert snapshot gen

* replace Clone snapshots

* enable --ast only during snapshots

* reset snapshot directories

* Update .circleci/config.yml to use ci-builder:v0.46.0

* update foundry to nightly-617dfc28cb8206a0003edcf73a6f1058adaef740

* ci: bump ci-builder to v0.46.1

---------
Co-authored-by: default avatarRoberto Bayardo <roberto.bayardo@coinbase.com>
Co-authored-by: default avatarSebastian Stammler <seb@oplabs.co>
parent 88ee1306
...@@ -3,7 +3,7 @@ version: 2.1 ...@@ -3,7 +3,7 @@ version: 2.1
parameters: parameters:
ci_builder_image: ci_builder_image:
type: string type: string
default: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.43.0 default: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.46.1
ci_builder_rust_image: ci_builder_rust_image:
type: string type: string
default: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder-rust:latest default: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder-rust:latest
...@@ -1158,11 +1158,11 @@ jobs: ...@@ -1158,11 +1158,11 @@ jobs:
- run: - run:
name: Install Geth name: Install Geth
command: | command: |
wget https://gethstore.blob.core.windows.net/builds/geth-alltools-linux-amd64-1.13.4-3f907d6a.tar.gz wget https://gethstore.blob.core.windows.net/builds/geth-alltools-linux-amd64-1.13.14-2bd6bd01.tar.gz
# geth only provides md5 sums sadly # geth only provides md5 sums sadly
echo 'c2e3d38372cb8081ed01591246a7556f geth-alltools-linux-amd64-1.13.4-3f907d6a.tar.gz' | md5sum -c - echo '76a04354dba9980fcbc35bece2957b30 geth-alltools-linux-amd64-1.13.14-2bd6bd01.tar.gz' | md5sum -c -
tar -xzvf geth-alltools-linux-amd64-1.13.4-3f907d6a.tar.gz tar -xzvf geth-alltools-linux-amd64-1.13.14-2bd6bd01.tar.gz
sudo cp geth-alltools-linux-amd64-1.13.4-3f907d6a/* /usr/local/bin sudo cp geth-alltools-linux-amd64-1.13.14-2bd6bd01/* /usr/local/bin
- run: - run:
name: foundryup name: foundryup
command: | command: |
...@@ -1175,7 +1175,7 @@ jobs: ...@@ -1175,7 +1175,7 @@ jobs:
- run: - run:
name: Install NVM name: Install NVM
command: | command: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc source ~/.bashrc
nvm --version nvm --version
- run: - run:
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"gas-snapshot:no-build": "forge snapshot --match-contract GasBenchMark", "gas-snapshot:no-build": "forge snapshot --match-contract GasBenchMark",
"statediff": "./scripts/statediff.sh && git diff --exit-code", "statediff": "./scripts/statediff.sh && git diff --exit-code",
"gas-snapshot": "pnpm build:go-ffi && pnpm gas-snapshot:no-build", "gas-snapshot": "pnpm build:go-ffi && pnpm gas-snapshot:no-build",
"snapshots": "npx tsx scripts/autogen/generate-snapshots.ts && ./test/kontrol/scripts/make-summary-deployment.sh", "snapshots": "forge build --ast && npx tsx scripts/autogen/generate-snapshots.ts && ./test/kontrol/scripts/make-summary-deployment.sh",
"snapshots:check": "./scripts/checks/check-snapshots.sh", "snapshots:check": "./scripts/checks/check-snapshots.sh",
"semver-lock": "forge script scripts/SemverLock.s.sol", "semver-lock": "forge script scripts/SemverLock.s.sol",
"validate-deploy-configs": "./scripts/checks/check-deploy-configs.sh", "validate-deploy-configs": "./scripts/checks/check-deploy-configs.sh",
......
...@@ -81,6 +81,8 @@ const main = async () => { ...@@ -81,6 +81,8 @@ const main = async () => {
const storageLayoutDir = path.join(outdir, 'storageLayout') const storageLayoutDir = path.join(outdir, 'storageLayout')
const abiDir = path.join(outdir, 'abi') const abiDir = path.join(outdir, 'abi')
fs.rmdirSync(storageLayoutDir, { recursive: true })
fs.rmdirSync(abiDir, { recursive: true })
fs.mkdirSync(storageLayoutDir, { recursive: true }) fs.mkdirSync(storageLayoutDir, { recursive: true })
fs.mkdirSync(abiDir, { recursive: true }) fs.mkdirSync(abiDir, { recursive: true })
...@@ -96,6 +98,11 @@ const main = async () => { ...@@ -96,6 +98,11 @@ const main = async () => {
const contractName = parseArtifactName(name) const contractName = parseArtifactName(name)
// HACK: This is a hack to ignore libraries and abstract contracts. Not robust against changes to solc's internal ast repr // HACK: This is a hack to ignore libraries and abstract contracts. Not robust against changes to solc's internal ast repr
if (artifact.ast === undefined) {
throw new Error(
"ast isn't present in forge-artifacts. Did you run forge build with `--ast`?"
)
}
const isContract = artifact.ast.nodes.some((node: any) => { const isContract = artifact.ast.nodes.some((node: any) => {
return ( return (
node.nodeType === 'ContractDefinition' && node.nodeType === 'ContractDefinition' &&
......
[
{
"inputs": [],
"name": "checkpoint",
"outputs": [
{
"internalType": "uint256",
"name": "blockNumber_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_blockNumber",
"type": "uint256"
}
],
"name": "load",
"outputs": [
{
"components": [
{
"internalType": "Hash",
"name": "hash",
"type": "bytes32"
},
{
"internalType": "Timestamp",
"name": "childTimestamp",
"type": "uint64"
}
],
"internalType": "struct BlockOracle.BlockInfo",
"name": "blockInfo_",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
},
{
"indexed": true,
"internalType": "Hash",
"name": "blockHash",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "Timestamp",
"name": "childTimestamp",
"type": "uint64"
}
],
"name": "Checkpoint",
"type": "event"
},
{
"inputs": [],
"name": "BlockHashNotPresent",
"type": "error"
}
]
\ No newline at end of file
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "BRIDGE",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "REMOTE_TOKEN",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_who",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "bridge",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "burn",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "l1Token",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "l2Bridge",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "mint",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "remoteToken",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "_interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "Burn",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "Mint",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
}
]
\ No newline at end of file
[
{
"bytes": "32",
"label": "blocks",
"offset": 0,
"slot": "0",
"type": "mapping(uint256 => struct BlockOracle.BlockInfo)"
}
]
\ No newline at end of file
[
{
"bytes": "32",
"label": "_balances",
"offset": 0,
"slot": "0",
"type": "mapping(address => uint256)"
},
{
"bytes": "32",
"label": "_allowances",
"offset": 0,
"slot": "1",
"type": "mapping(address => mapping(address => uint256))"
},
{
"bytes": "32",
"label": "_totalSupply",
"offset": 0,
"slot": "2",
"type": "uint256"
},
{
"bytes": "32",
"label": "_name",
"offset": 0,
"slot": "3",
"type": "string"
},
{
"bytes": "32",
"label": "_symbol",
"offset": 0,
"slot": "4",
"type": "string"
}
]
\ No newline at end of file
[
{
"bytes": "8",
"label": "createdAt",
"offset": 0,
"slot": "0",
"type": "Timestamp"
},
{
"bytes": "1",
"label": "status",
"offset": 8,
"slot": "0",
"type": "enum GameStatus"
},
{
"bytes": "32",
"label": "l1Head",
"offset": 0,
"slot": "1",
"type": "Hash"
},
{
"bytes": "32",
"label": "claimData",
"offset": 0,
"slot": "2",
"type": "struct ILegacyFaultDisputeGame.ClaimData[]"
},
{
"bytes": "128",
"label": "proposals",
"offset": 0,
"slot": "3",
"type": "struct ILegacyFaultDisputeGame.OutputProposals"
},
{
"bytes": "32",
"label": "claims",
"offset": 0,
"slot": "7",
"type": "mapping(ClaimHash => bool)"
},
{
"bytes": "32",
"label": "subgames",
"offset": 0,
"slot": "8",
"type": "mapping(uint256 => uint256[])"
},
{
"bytes": "1",
"label": "subgameAtRootResolved",
"offset": 0,
"slot": "9",
"type": "bool"
}
]
\ No newline at end of file
{ {
"abigen": "v1.10.25", "abigen": "v1.10.25",
"foundry": "a170021b0e058925047a2c9697ba61f10fc0b2ce", "foundry": "617dfc28cb8206a0003edcf73a6f1058adaef740",
"geth": "v1.13.4", "geth": "v1.13.14",
"nvm": "v20.9.0", "nvm": "v20.9.0",
"slither": "0.10.0", "slither": "0.10.0",
"kontrol": "0.1.196" "kontrol": "0.1.196"
......
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