Skip to content

Commit

Permalink
Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
mininny committed Oct 4, 2024
1 parent 0d6173c commit 95775ba
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
ci_builder_image:
type: string
# depends with rvsol/lib/optimism submodule version
default: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.51.0
default: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.53.0

workflows:
main:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.1-alpine3.18 AS builder
FROM golang:1.22.7-alpine3.20 AS builder
WORKDIR /build

# Copy the context into the container
Expand All @@ -9,7 +9,7 @@ RUN apk add --no-cache git make bash

RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build make

FROM alpine:3.18 AS export
FROM alpine:3.20 AS export

RUN apk add --no-cache bash
COPY --from=builder /build/rvgo/bin/asterisc /usr/local/bin/asterisc
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.repro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.3-alpine3.18 as builder
FROM golang:1.22.7-alpine3.20 as builder

RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ devnet-clean: devnet-clean-monorepo
.PHONY: devnet-clean

reproducible-prestate:
sed -i '' "1s/.*/$(head -n 1 ./rvsol/lib/optimism/op-program/Dockerfile.repro | sed 's/[&/\]/\\&/g')/" ./Dockerfile.repro
@docker build --output ./bin/ --progress plain -f Dockerfile.repro .
@echo "Absolute prestate hash:"
@cat ./bin/prestate.json | jq -r .stateHash
Expand Down
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ module github.com/ethereum-optimism/asterisc

go 1.22

toolchain go1.22.1
toolchain go1.22.7

replace github.com/ethereum/go-ethereum v1.14.8 => github.com/ethereum-optimism/op-geth v1.101408.0-rc.4.0.20240827042333-110c433a2469

replace github.com/ethereum-optimism/optimism v1.9.2 => github.com/testinprod-io/optimism v0.0.0-20241003225321-55d7533108f9
replace github.com/ethereum/go-ethereum v1.14.11 => github.com/ethereum-optimism/op-geth v1.101408.1-0.20241002211323-d5a96613c22b
replace github.com/ethereum-optimism/optimism v1.9.2 => github.com/testinprod-io/optimism v0.0.0-20241003231047-9d908ccbe262

require (
github.com/ethereum-optimism/optimism v1.9.2
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/u
github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v1.101408.1-0.20241002211323-d5a96613c22b h1:9C6WytqAcqWKXQTMw2Da/S/aIJJmMvT+2MUpFnMdGrg=
github.com/ethereum-optimism/op-geth v1.101408.1-0.20241002211323-d5a96613c22b/go.mod h1:7S4pp8KHBmEmKkRjL1BPOc6jY9hW+64YeMUjR3RVLw4=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240910145426-b3905c89e8ac h1:hCIrLuOPV3FJfMDvXeOhCC3uQNvFoMIIlkT2mN2cfeg=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240910145426-b3905c89e8ac/go.mod h1:XaVXL9jg8BcyOeugECgIUGa9Y3DjYJj71RHmb5qon6M=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA=
github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/go-ethereum v1.14.11 h1:8nFDCUUE67rPc6AKxFj7JKaOa2W/W1Rse3oS6LvvxEY=
github.com/ethereum/go-ethereum v1.14.11/go.mod h1:+l/fr42Mma+xBnhefL/+z11/hcmJ2egl+ScIVPjhc7E=
github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 h1:8NfxH2iXvJ60YRB8ChToFTUzl8awsc3cJ8CbLjGIl/A=
github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
Expand Down Expand Up @@ -711,8 +711,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI=
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/testinprod-io/optimism v0.0.0-20241003225321-55d7533108f9 h1:M9Wm97GqM/5QzKR2Kk3lUdjGk8jscx6Cu3rZJ5+UulU=
github.com/testinprod-io/optimism v0.0.0-20241003225321-55d7533108f9/go.mod h1:eeUe73d7TOnas4o97ULLR8K0xP6zfdOx6HPilL7v3No=
github.com/testinprod-io/optimism v0.0.0-20241003231047-9d908ccbe262 h1:dhPqoJchsMwwHenZ9hSuN4gjNsdVuWKpMlXx6eosd+E=
github.com/testinprod-io/optimism v0.0.0-20241003231047-9d908ccbe262/go.mod h1:eeUe73d7TOnas4o97ULLR8K0xP6zfdOx6HPilL7v3No=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
Expand Down
4 changes: 2 additions & 2 deletions rvgo/cmd/witness.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package cmd

import (
"fmt"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"os"

"github.com/urfave/cli/v2"
Expand All @@ -12,6 +10,8 @@ import (
cannon "github.com/ethereum-optimism/optimism/cannon/cmd"
"github.com/ethereum-optimism/optimism/op-service/ioutil"
"github.com/ethereum-optimism/optimism/op-service/jsonutil"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
)

type WitnessOutput struct {
Expand Down
8 changes: 4 additions & 4 deletions rvgo/test/evm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/triedb"

"github.com/ethereum-optimism/asterisc/rvgo/fast"
)
Expand Down Expand Up @@ -102,13 +103,12 @@ func newEVMEnv(t *testing.T, contracts *Contracts, addrs *Addresses) *vm.EVM {
bc := &dummyChain{startTime: *chainCfg.CancunTime + offsetBlocks*12}
header := bc.GetHeader(common.Hash{}, 17034870+offsetBlocks)
db := rawdb.NewMemoryDatabase()
statedb := state.NewDatabase(db)
state, err := state.New(types.EmptyRootHash, statedb, nil)
statedb, err := state.New(types.EmptyRootHash, state.NewDatabase(triedb.NewDatabase(db, nil), nil))
require.NoError(t, err)
blockContext := core.NewEVMBlockContext(header, bc, nil, chainCfg, state)
blockContext := core.NewEVMBlockContext(header, bc, nil, chainCfg, statedb)
vmCfg := vm.Config{}

env := vm.NewEVM(blockContext, vm.TxContext{}, state, chainCfg, vmCfg)
env := vm.NewEVM(blockContext, vm.TxContext{}, statedb, chainCfg, vmCfg)
env.StateDB.SetCode(addrs.RISCV, contracts.RISCV.DeployedBytecode.Object)
env.StateDB.SetCode(addrs.Oracle, contracts.Oracle.DeployedBytecode.Object)
env.StateDB.SetState(addrs.RISCV, common.Hash{}, common.BytesToHash(addrs.Oracle.Bytes())) // set storage slot pointing to preimage oracle
Expand Down
2 changes: 1 addition & 1 deletion rvsol/lib/optimism
Submodule optimism updated 422 files
2 changes: 1 addition & 1 deletion rvsol/scripts/Deploy_Stage_1_4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ contract Deploy is Deployer, StdAssertions {
// `DisputeGameFactory` implementation alongside dependent contracts, which are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.DisputeGameFactory = address(factory);
ChainAssertions.checkDisputeGameFactory({ _contracts: contracts, _expectedOwner: address(0) });
ChainAssertions.checkDisputeGameFactory({ _contracts: contracts, _expectedOwner: address(0), _isProxy: true });

addr_ = address(factory);
}
Expand Down
3 changes: 2 additions & 1 deletion rvsol/test/RISCV.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity 0.8.15;

import { Test } from "@forge-std/Test.sol";
import { RISCV } from "src/RISCV.sol";
import { IPreimageOracle } from "@optimism/src/cannon/interfaces/IPreimageOracle.sol";
import { PreimageOracle } from "@optimism/src/cannon/PreimageOracle.sol";
import { CommonTest } from "./CommonTest.sol";
import "@optimism/src/dispute/lib/Types.sol";
Expand Down Expand Up @@ -31,7 +32,7 @@ contract RISCV_Test is CommonTest {
function setUp() public virtual override {
super.setUp();
oracle = new PreimageOracle(0, 0);
riscv = new RISCV(oracle);
riscv = new RISCV(IPreimageOracle(address(oracle)));
vm.store(address(riscv), 0x0, bytes32(abi.encode(address(oracle))));
vm.label(address(oracle), "PreimageOracle");
vm.label(address(riscv), "RISCV");
Expand Down

0 comments on commit 95775ba

Please sign in to comment.