Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ parameters:
reproducibility_dispatch:
type: boolean
default: false
diff_asterisc_bytecode_dispatch:
type: boolean
default: false
kontrol_dispatch:
type: boolean
default: false
Expand Down Expand Up @@ -239,6 +242,43 @@ jobs:
command: python3 maketests.py && git diff --exit-code
working_directory: cannon/mipsevm/tests/open_mips_tests

diff-asterisc-bytecode:
docker:
- image: <<pipeline.parameters.ci_builder_image>>
resource_class: medium
steps:
- checkout
- run:
name: Check `RISCV.sol` bytecode
working_directory: packages/contracts-bedrock
command: |
# Clone asterisc @ the pinned version to fetch remote `RISCV.sol`
ASTERISC_REV="$(cat ../../versions.json | jq -r .asterisc)"
REMOTE_ASTERISC_PATH="./src/asterisc/RISCV_Remote.sol"
git clone https://github.com/ethereum-optimism/asterisc \
-b $ASTERISC_REV && \
cp ./asterisc/rvsol/src/RISCV.sol $REMOTE_ASTERISC_PATH

# Replace import paths
sed -i -e 's/@optimism\///' $REMOTE_ASTERISC_PATH
# Replace contract name
sed -i -e 's/contract RISCV/contract RISCV_Remote/' $REMOTE_ASTERISC_PATH

# Install deps
forge install

# Diff bytecode, with both contracts compiled in the local environment.
REMOTE_ASTERISC_CODE="$(forge inspect RISCV_Remote bytecode | tr -d '\n')"
LOCAL_ASTERISC_CODE="$(forge inspect RISCV bytecode | tr -d '\n')"
if [ "$REMOTE_ASTERISC_CODE" != "$LOCAL_ASTERISC_CODE" ]; then
echo "Asterisc bytecode mismatch. Local version does not match remote. Diff:"
diff <(echo "$REMOTE_ASTERISC_CODE") <(echo "$LOCAL_ASTERISC_CODE")
else
echo "Asterisc version up to date."
fi
- notify-failures-on-develop:
mentions: "@clabby @proofs-team"

contracts-bedrock-build:
machine: true
resource_class: ethereum-optimism/latitude-1
Expand Down Expand Up @@ -1688,6 +1728,17 @@ workflows:
- oplabs-gcr
- slack

scheduled-diff-asterisc-bytecode:
when:
or:
- equal: [build_daily, <<pipeline.schedule.name>>]
# Trigger on manual triggers if explicitly requested
- equal: [true, <<pipeline.parameters.diff_asterisc_bytecode_dispatch>>]
jobs:
- diff-asterisc-bytecode:
context:
- slack

scheduled-preimage-reproducibility:
when:
or:
Expand Down
68 changes: 68 additions & 0 deletions packages/contracts-bedrock/snapshots/abi/RISCV.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[
{
"inputs": [
{
"internalType": "contract IPreimageOracle",
"name": "_oracle",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "oracle",
"outputs": [
{
"internalType": "contract IPreimageOracle",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "_stateData",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "_proof",
"type": "bytes"
},
{
"internalType": "bytes32",
"name": "_localContext",
"type": "bytes32"
}
],
"name": "step",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
}
]
4 changes: 4 additions & 0 deletions packages/contracts-bedrock/snapshots/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@
"initCodeHash": "0x17ea1b1c5d5a622d51c2961fde886a5498de63584e654ed1d69ee80dddbe0b17",
"sourceCodeHash": "0x0fa0633a769e73f5937514c0003ba7947a1c275bbe5b85d78879c42f0ed8895b"
},
"src/asterisc/RISCV.sol": {
"initCodeHash": "0xb3f9c337d694b62704b63d86d7d412a661925f254e7af376a5e02717a455487e",
"sourceCodeHash": "0x92a8689e26a736868f90c6c208ef01782c3d9ce196fcef0a85aef4da936c6339"
},
"src/cannon/MIPS.sol": {
"initCodeHash": "0xa3cbf121bad13c00227ea4fef128853d9a86b7ec9158de894f99b58d38d7630a",
"sourceCodeHash": "0xd8467700c80b3e62fa37193dc6513bac35282094b686b50e162e157f704dde00"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"bytes": "20",
"label": "oracle",
"offset": 0,
"slot": "0",
"type": "contract IPreimageOracle"
}
]
Loading