Commit a89621c8 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge branch 'develop' into aj/clock-after-func

parents 8a3e8830 2a2cfc7f
--- ---
'@eth-optimism/contracts-periphery': patch
'@eth-optimism/contracts-bedrock': patch '@eth-optimism/contracts-bedrock': patch
'@eth-optimism/fault-detector': patch '@eth-optimism/fault-detector': patch
'@eth-optimism/core-utils': patch '@eth-optimism/core-utils': patch
......
...@@ -1008,7 +1008,7 @@ jobs: ...@@ -1008,7 +1008,7 @@ jobs:
steps: steps:
- checkout - checkout
- check-changed: - check-changed:
patterns: op-(.+),packages patterns: op-(.+),packages,ops-bedrock
- run: - run:
name: Install latest golang name: Install latest golang
command: | command: |
......
...@@ -7,7 +7,6 @@ runs: ...@@ -7,7 +7,6 @@ runs:
uses: pnpm/action-setup@v2 uses: pnpm/action-setup@v2
with: with:
version: 8.6.5 version: 8.6.5
- name: Setup node 16.x - name: Setup node 16.x
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
...@@ -15,22 +14,16 @@ runs: ...@@ -15,22 +14,16 @@ runs:
registry-url: https://registry.npmjs.org registry-url: https://registry.npmjs.org
cache: pnpm cache: pnpm
- name: Get foundry version
id: foundry-version
run: echo ::set-output name=version::$(cat .foundryrc)
- name: Setup foundry - name: Setup foundry
uses: foundry-rs/foundry-toolchain@v1 uses: foundry-rs/foundry-toolchain@v1
with:
version: $${ steps.foundry-version.outputs.version }
- name: Install node dependencies - name: Install node dependencies
shell: bash shell: bash
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
- name: Derive appropriate SHAs for base and head for `nx affected` commands - name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3 uses: nrwl/nx-set-shas@v3
with:
main-branch-name: "develop"
- run: | - run: |
echo "nx using following shas:" echo "nx using following shas:"
echo "BASE: ${{ env.NX_BASE }}" echo "BASE: ${{ env.NX_BASE }}"
......
...@@ -2,12 +2,6 @@ name: Release and version ...@@ -2,12 +2,6 @@ name: Release and version
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
branch:
description: "Trigger a release workflow"
type: string
default: "develop"
required: true
push: push:
branches: branches:
- develop - develop
...@@ -38,10 +32,11 @@ jobs: ...@@ -38,10 +32,11 @@ jobs:
id-token: write id-token: write
steps: steps:
- name: Checkout Repo - name: Checkout Repo
uses: actions/checkout@develop uses: actions/checkout@v3
with: with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0 fetch-depth: 0
ref: "develop"
- name: Setup - name: Setup
uses: ./.github/actions/setup uses: ./.github/actions/setup
...@@ -54,7 +49,8 @@ jobs: ...@@ -54,7 +49,8 @@ jobs:
id: changesets id: changesets
with: with:
createGithubReleases: false createGithubReleases: false
publish: pnpm release publish: pnpm release:publish
version: pnpm release:version
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -31,6 +31,7 @@ func setupFaultDisputeGame() (common.Address, *bind.TransactOpts, *backends.Simu ...@@ -31,6 +31,7 @@ func setupFaultDisputeGame() (common.Address, *bind.TransactOpts, *backends.Simu
backend, backend,
[32]byte{0x01}, [32]byte{0x01},
big.NewInt(15), big.NewInt(15),
uint64(604800), // 7 days
common.Address{0xdd}, common.Address{0xdd},
) )
if err != nil { if err != nil {
......
...@@ -94,6 +94,17 @@ func (a *Agent) step(claim Claim, game Game) error { ...@@ -94,6 +94,17 @@ func (a *Agent) step(claim Claim, game Game) error {
if claim.Depth() != a.maxDepth { if claim.Depth() != a.maxDepth {
return nil return nil
} }
if game.AgreeWithClaimLevel(claim) {
a.log.Warn("Agree with leaf claim, skipping step", "claim_depth", claim.Depth(), "maxDepth", a.maxDepth)
return nil
}
if claim.Countered {
a.log.Info("Claim already stepped on", "claim_depth", claim.Depth(), "maxDepth", a.maxDepth)
return nil
}
a.log.Info("Attempting step", "claim_depth", claim.Depth(), "maxDepth", a.maxDepth) a.log.Info("Attempting step", "claim_depth", claim.Depth(), "maxDepth", a.maxDepth)
step, err := a.solver.AttemptStep(claim) step, err := a.solver.AttemptStep(claim)
if err != nil { if err != nil {
......
...@@ -56,6 +56,8 @@ func (l *loader) fetchClaim(ctx context.Context, arrIndex uint64) (Claim, error) ...@@ -56,6 +56,8 @@ func (l *loader) fetchClaim(ctx context.Context, arrIndex uint64) (Claim, error)
Value: fetchedClaim.Claim, Value: fetchedClaim.Claim,
Position: NewPositionFromGIndex(fetchedClaim.Position.Uint64()), Position: NewPositionFromGIndex(fetchedClaim.Position.Uint64()),
}, },
Countered: fetchedClaim.Countered,
Clock: fetchedClaim.Clock.Uint64(),
ContractIndex: int(arrIndex), ContractIndex: int(arrIndex),
ParentContractIndex: int(fetchedClaim.ParentIndex), ParentContractIndex: int(fetchedClaim.ParentIndex),
} }
......
...@@ -40,16 +40,22 @@ func newMockClaimFetcher() *mockClaimFetcher { ...@@ -40,16 +40,22 @@ func newMockClaimFetcher() *mockClaimFetcher {
Clock *big.Int Clock *big.Int
}{ }{
{ {
Claim: [32]byte{0x00}, Claim: [32]byte{0x00},
Position: big.NewInt(0), Position: big.NewInt(0),
Countered: false,
Clock: big.NewInt(0),
}, },
{ {
Claim: [32]byte{0x01}, Claim: [32]byte{0x01},
Position: big.NewInt(0), Position: big.NewInt(0),
Countered: false,
Clock: big.NewInt(0),
}, },
{ {
Claim: [32]byte{0x02}, Claim: [32]byte{0x02},
Position: big.NewInt(0), Position: big.NewInt(0),
Countered: false,
Clock: big.NewInt(0),
}, },
}, },
} }
...@@ -101,6 +107,8 @@ func TestLoader_FetchClaims_Succeeds(t *testing.T) { ...@@ -101,6 +107,8 @@ func TestLoader_FetchClaims_Succeeds(t *testing.T) {
Value: expectedClaims[0].Claim, Value: expectedClaims[0].Claim,
Position: NewPositionFromGIndex(expectedClaims[0].Position.Uint64()), Position: NewPositionFromGIndex(expectedClaims[0].Position.Uint64()),
}, },
Countered: false,
Clock: uint64(0),
ContractIndex: 0, ContractIndex: 0,
}, },
{ {
...@@ -112,6 +120,8 @@ func TestLoader_FetchClaims_Succeeds(t *testing.T) { ...@@ -112,6 +120,8 @@ func TestLoader_FetchClaims_Succeeds(t *testing.T) {
Value: expectedClaims[0].Claim, Value: expectedClaims[0].Claim,
Position: NewPositionFromGIndex(expectedClaims[1].Position.Uint64()), Position: NewPositionFromGIndex(expectedClaims[1].Position.Uint64()),
}, },
Countered: false,
Clock: uint64(0),
ContractIndex: 1, ContractIndex: 1,
}, },
{ {
...@@ -123,6 +133,8 @@ func TestLoader_FetchClaims_Succeeds(t *testing.T) { ...@@ -123,6 +133,8 @@ func TestLoader_FetchClaims_Succeeds(t *testing.T) {
Value: expectedClaims[0].Claim, Value: expectedClaims[0].Claim,
Position: NewPositionFromGIndex(expectedClaims[2].Position.Uint64()), Position: NewPositionFromGIndex(expectedClaims[2].Position.Uint64()),
}, },
Countered: false,
Clock: uint64(0),
ContractIndex: 2, ContractIndex: 2,
}, },
}, claims) }, claims)
......
...@@ -49,7 +49,13 @@ func (c *ClaimData) ValueBytes() [32]byte { ...@@ -49,7 +49,13 @@ func (c *ClaimData) ValueBytes() [32]byte {
// and the Parent field is empty & meaningless. // and the Parent field is empty & meaningless.
type Claim struct { type Claim struct {
ClaimData ClaimData
Parent ClaimData // WARN: Countered is a mutable field in the FaultDisputeGame contract
// and rely on it for determining whether to step on leaf claims.
// When caching is implemented for the Challenger, this will need
// to be changed/removed to avoid invalid/stale contract state.
Countered bool
Clock uint64
Parent ClaimData
// Location of the claim & it's parent inside the contract. Does not exist // Location of the claim & it's parent inside the contract. Does not exist
// for claims that have not made it to the contract. // for claims that have not made it to the contract.
ContractIndex int ContractIndex int
......
...@@ -65,9 +65,6 @@ type Config struct { ...@@ -65,9 +65,6 @@ type Config struct {
DisableP2P bool DisableP2P bool
NoDiscovery bool NoDiscovery bool
// Enable P2P-based alt-syncing method (req-resp protocol, not gossip)
AltSync bool
ScoringParams *ScoringParams ScoringParams *ScoringParams
// Whether to ban peers based on their [PeerScoring] score. Should be negative. // Whether to ban peers based on their [PeerScoring] score. Should be negative.
......
...@@ -420,6 +420,11 @@ func (eq *EngineQueue) tryNextUnsafePayload(ctx context.Context) error { ...@@ -420,6 +420,11 @@ func (eq *EngineQueue) tryNextUnsafePayload(ctx context.Context) error {
eq.unsafePayloads.Pop() eq.unsafePayloads.Pop()
return nil return nil
} }
if uint64(first.BlockNumber) <= eq.unsafeHead.Number {
eq.log.Info("skipping unsafe payload, since it is older than unsafe head", "unsafe", eq.unsafeHead.ID(), "unsafe_payload", first.ID())
eq.unsafePayloads.Pop()
return nil
}
// Ensure that the unsafe payload builds upon the current unsafe head // Ensure that the unsafe payload builds upon the current unsafe head
// TODO: once we support snap-sync we can remove this condition, and handle the "SYNCING" status of the execution engine. // TODO: once we support snap-sync we can remove this condition, and handle the "SYNCING" status of the execution engine.
......
...@@ -1107,3 +1107,88 @@ func TestResetLoop(t *testing.T) { ...@@ -1107,3 +1107,88 @@ func TestResetLoop(t *testing.T) {
l1F.AssertExpectations(t) l1F.AssertExpectations(t)
eng.AssertExpectations(t) eng.AssertExpectations(t)
} }
func TestEngineQueue_StepPopOlderUnsafe(t *testing.T) {
logger := testlog.Logger(t, log.LvlInfo)
eng := &testutils.MockEngine{}
l1F := &testutils.MockL1Source{}
rng := rand.New(rand.NewSource(1234))
refA := testutils.RandomBlockRef(rng)
refA0 := eth.L2BlockRef{
Hash: testutils.RandomHash(rng),
Number: 0,
ParentHash: common.Hash{},
Time: refA.Time,
L1Origin: refA.ID(),
SequenceNumber: 0,
}
gasLimit := eth.Uint64Quantity(20_000_000)
cfg := &rollup.Config{
Genesis: rollup.Genesis{
L1: refA.ID(),
L2: refA0.ID(),
L2Time: refA0.Time,
SystemConfig: eth.SystemConfig{
BatcherAddr: common.Address{42},
Overhead: [32]byte{123},
Scalar: [32]byte{42},
GasLimit: 20_000_000,
},
},
BlockTime: 1,
SeqWindowSize: 2,
}
refA1 := eth.L2BlockRef{
Hash: testutils.RandomHash(rng),
Number: refA0.Number + 1,
ParentHash: refA0.Hash,
Time: refA0.Time + cfg.BlockTime,
L1Origin: refA.ID(),
SequenceNumber: 1,
}
refA2 := eth.L2BlockRef{
Hash: testutils.RandomHash(rng),
Number: refA1.Number + 1,
ParentHash: refA1.Hash,
Time: refA1.Time + cfg.BlockTime,
L1Origin: refA.ID(),
SequenceNumber: 2,
}
payloadA1 := &eth.ExecutionPayload{
ParentHash: refA1.ParentHash,
FeeRecipient: common.Address{},
StateRoot: eth.Bytes32{},
ReceiptsRoot: eth.Bytes32{},
LogsBloom: eth.Bytes256{},
PrevRandao: eth.Bytes32{},
BlockNumber: eth.Uint64Quantity(refA1.Number),
GasLimit: gasLimit,
GasUsed: 0,
Timestamp: eth.Uint64Quantity(refA1.Time),
ExtraData: nil,
BaseFeePerGas: *uint256.NewInt(7),
BlockHash: refA1.Hash,
Transactions: []eth.Data{},
}
prev := &fakeAttributesQueue{origin: refA}
eq := NewEngineQueue(logger, cfg, eng, metrics.NoopMetrics, prev, l1F)
eq.unsafeHead = refA2
eq.safeHead = refA0
eq.finalized = refA0
eq.AddUnsafePayload(payloadA1)
err := eq.Step(context.Background())
require.NoError(t, err)
require.Nil(t, eq.unsafePayloads.Peek(), "should pop the unsafe payload because it is too old")
fmt.Println(eq.unsafePayloads.Peek())
l1F.AssertExpectations(t)
eng.AssertExpectations(t)
}
...@@ -19,3 +19,9 @@ test: ...@@ -19,3 +19,9 @@ test:
lint: lint:
go vet ./... go vet ./...
.PHONY: test .PHONY: test
tls:
kubectl get secrets op-ufm-client-tls -o yaml | yq '.data."tls.key"' | base64 --decode > tls/tls.key
kubectl get secrets op-ufm-client-tls -o yaml | yq '.data."tls.crt"' | base64 --decode > tls/tls.crt
kubectl get secrets op-ufm-client-tls -o yaml | yq '.data."ca.crt"' | base64 --decode > tls/ca.crt
.PHONY: tls
...@@ -3,6 +3,7 @@ module github.com/ethereum-optimism/optimism/op-ufm ...@@ -3,6 +3,7 @@ module github.com/ethereum-optimism/optimism/op-ufm
go 1.20 go 1.20
require ( require (
cloud.google.com/go/kms v1.12.1
github.com/BurntSushi/toml v1.3.2 github.com/BurntSushi/toml v1.3.2
github.com/ethereum-optimism/optimism/op-service v0.10.14 github.com/ethereum-optimism/optimism/op-service v0.10.14
github.com/ethereum-optimism/optimism/op-signer v0.1.1 github.com/ethereum-optimism/optimism/op-signer v0.1.1
...@@ -11,9 +12,13 @@ require ( ...@@ -11,9 +12,13 @@ require (
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.16.0 github.com/prometheus/client_golang v1.16.0
github.com/rs/cors v1.9.0 github.com/rs/cors v1.9.0
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130
) )
require ( require (
cloud.google.com/go/compute v1.20.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.0 // indirect
github.com/DataDog/zstd v1.5.2 // indirect github.com/DataDog/zstd v1.5.2 // indirect
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
...@@ -32,8 +37,13 @@ require ( ...@@ -32,8 +37,13 @@ require (
github.com/go-stack/stack v1.8.1 // indirect github.com/go-stack/stack v1.8.1 // indirect
github.com/gofrs/flock v0.8.1 // indirect github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect
...@@ -55,10 +65,18 @@ require ( ...@@ -55,10 +65,18 @@ require (
github.com/tklauser/numcpus v0.5.0 // indirect github.com/tklauser/numcpus v0.5.0 // indirect
github.com/urfave/cli v1.22.9 // indirect github.com/urfave/cli v1.22.9 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/crypto v0.1.0 // indirect go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect
golang.org/x/sys v0.8.0 // indirect golang.org/x/net v0.12.0 // indirect
golang.org/x/text v0.8.0 // indirect golang.org/x/oauth2 v0.10.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
google.golang.org/api v0.132.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.56.2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
) )
This diff is collapsed.
...@@ -5,8 +5,6 @@ import ( ...@@ -5,8 +5,6 @@ import (
"time" "time"
"github.com/ethereum-optimism/optimism/op-ufm/pkg/metrics" "github.com/ethereum-optimism/optimism/op-ufm/pkg/metrics"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
...@@ -33,9 +31,7 @@ func Dial(providerName string, url string) (*InstrumentedEthClient, error) { ...@@ -33,9 +31,7 @@ func Dial(providerName string, url string) (*InstrumentedEthClient, error) {
func (i *InstrumentedEthClient) TransactionByHash(ctx context.Context, hash common.Hash) (*types.Transaction, bool, error) { func (i *InstrumentedEthClient) TransactionByHash(ctx context.Context, hash common.Hash) (*types.Transaction, bool, error) {
start := time.Now() start := time.Now()
log.Debug(">> TransactionByHash", "hash", hash, "provider", i.providerName)
tx, isPending, err := i.c.TransactionByHash(ctx, hash) tx, isPending, err := i.c.TransactionByHash(ctx, hash)
log.Debug("<< TransactionByHash", "tx", tx, "isPending", isPending, "err", err, "hash", hash, "provider", i.providerName)
if err != nil { if err != nil {
if !i.ignorableErrors(err) { if !i.ignorableErrors(err) {
metrics.RecordError(i.providerName, "ethclient.TransactionByHash") metrics.RecordError(i.providerName, "ethclient.TransactionByHash")
......
package main
import (
"context"
"crypto/x509/pkix"
"encoding/asn1"
"encoding/pem"
"fmt"
"os"
kms "cloud.google.com/go/kms/apiv1"
"cloud.google.com/go/kms/apiv1/kmspb"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
func main() {
println("kmstool - usage: kmstool <key>")
if len(os.Args) < 2 {
panic("missing <key>")
}
keyName := os.Args[1]
ctx := context.Background()
client, err := kms.NewKeyManagementClient(ctx)
if err != nil {
panic(fmt.Sprintf("failed to create kms client: %w", err))
}
defer client.Close()
addr, err := resolveAddr(ctx, client, keyName)
if err != nil {
panic(fmt.Sprintf("failed to retrieve the key: %w", err))
}
fmt.Printf("ethereum addr: %s", addr)
println()
println()
}
func resolveAddr(ctx context.Context, client *kms.KeyManagementClient, keyName string) (common.Address, error) {
resp, err := client.GetPublicKey(ctx, &kmspb.GetPublicKeyRequest{Name: keyName})
if err != nil {
return common.Address{}, fmt.Errorf("google kms public key %q lookup: %w", keyName, err)
}
block, _ := pem.Decode([]byte(resp.Pem))
if block == nil {
return common.Address{}, fmt.Errorf("google kms public key %q pem empty: %.130q", keyName, resp.Pem)
}
var info struct {
AlgID pkix.AlgorithmIdentifier
Key asn1.BitString
}
_, err = asn1.Unmarshal(block.Bytes, &info)
if err != nil {
return common.Address{}, fmt.Errorf("google kms public key %q pem block %q: %v", keyName, block.Type, err)
}
wantAlg := asn1.ObjectIdentifier{1, 2, 840, 10045, 2, 1}
if gotAlg := info.AlgID.Algorithm; !gotAlg.Equal(wantAlg) {
return common.Address{}, fmt.Errorf("google kms public key %q asn.1 algorithm %s intead of %s", keyName, gotAlg, wantAlg)
}
return pubKeyAddr(info.Key.Bytes), nil
}
// PubKeyAddr returns the Ethereum address for the (uncompressed) key bytes.
func pubKeyAddr(bytes []byte) common.Address {
digest := crypto.Keccak256(bytes[1:])
var addr common.Address
copy(addr[:], digest[12:])
return addr
}
FROM ethereum/client-go:v1.11.2 FROM ethereum/client-go:v1.12.0
RUN apk add --no-cache jq RUN apk add --no-cache jq
......
...@@ -30,7 +30,7 @@ RUN mkdir manifests && \ ...@@ -30,7 +30,7 @@ RUN mkdir manifests && \
# .nvmrc # .nvmrc
cp .nvmrc ../manifests/ cp .nvmrc ../manifests/
FROM ethereumoptimism/foundry:latest as foundry FROM us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest as foundry
# bullseye-slim is debian based # bullseye-slim is debian based
# we use it rather than alpien because it's not much # we use it rather than alpien because it's not much
# bigger and alpine is often missing packages for node applications # bigger and alpine is often missing packages for node applications
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"prepare": "husky install", "prepare": "husky install",
"release": "npx nx run-many --target=build --skip-nx-cache && pnpm changeset publish", "release": "npx nx run-many --target=build --skip-nx-cache && pnpm changeset publish",
"release:check": "changeset status --verbose --since=origin/main", "release:check": "changeset status --verbose --since=origin/main",
"release:publish": "npx nx run-many --target=build && pnpm install && pnpm build && changeset publish", "release:publish": "pnpm install --frozen-lockfile && npx nx run-many --target=build && pnpm build && changeset publish",
"release:version": "changeset version && pnpm install --lockfile-only", "release:version": "changeset version && pnpm install --lockfile-only",
"install:foundry": "curl -L https://foundry.paradigm.xyz | bash && pnpm update:foundry", "install:foundry": "curl -L https://foundry.paradigm.xyz | bash && pnpm update:foundry",
"update:foundry": "foundryup -C $(cat .foundryrc)" "update:foundry": "foundryup -C $(cat .foundryrc)"
...@@ -74,7 +74,6 @@ ...@@ -74,7 +74,6 @@
}, },
"dependencies": { "dependencies": {
"@changesets/cli": "^2.26.0", "@changesets/cli": "^2.26.0",
"@codechecks/client": "^0.1.11", "@codechecks/client": "^0.1.11"
"@ethersproject/abstract-provider": "^5.7.0"
} }
} }
...@@ -83,37 +83,36 @@ FaucetTest:test_nonAdmin_drip_fails() (gas: 262520) ...@@ -83,37 +83,36 @@ FaucetTest:test_nonAdmin_drip_fails() (gas: 262520)
FaucetTest:test_receive_succeeds() (gas: 17401) FaucetTest:test_receive_succeeds() (gas: 17401)
FaucetTest:test_withdraw_nonAdmin_reverts() (gas: 13145) FaucetTest:test_withdraw_nonAdmin_reverts() (gas: 13145)
FaucetTest:test_withdraw_succeeds() (gas: 78359) FaucetTest:test_withdraw_succeeds() (gas: 78359)
FaultDisputeGame_ResolvesCorrectly_Chaos:test_resolvesCorrectly_succeeds() (gas: 111450391) FaultDisputeGame_ResolvesCorrectly_CorrectRoot1:test_resolvesCorrectly_succeeds() (gas: 498839)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot1:test_resolvesCorrectly_succeeds() (gas: 498867) FaultDisputeGame_ResolvesCorrectly_CorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 505685)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 505669) FaultDisputeGame_ResolvesCorrectly_CorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 502382)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 502410) FaultDisputeGame_ResolvesCorrectly_CorrectRoot4:test_resolvesCorrectly_succeeds() (gas: 505561)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot4:test_resolvesCorrectly_succeeds() (gas: 505545) FaultDisputeGame_ResolvesCorrectly_CorrectRoot5:test_resolvesCorrectly_succeeds() (gas: 504878)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot5:test_resolvesCorrectly_succeeds() (gas: 504906) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot1:test_resolvesCorrectly_succeeds() (gas: 497604)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot1:test_resolvesCorrectly_succeeds() (gas: 497632) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 504450)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 504434) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 501147)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot3:test_resolvesCorrectly_succeeds() (gas: 501175) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot4:test_resolvesCorrectly_succeeds() (gas: 502326)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot4:test_resolvesCorrectly_succeeds() (gas: 502310) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot5:test_resolvesCorrectly_succeeds() (gas: 501643)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot5:test_resolvesCorrectly_succeeds() (gas: 501671) FaultDisputeGame_Test:test_extraData_succeeds() (gas: 17404)
FaultDisputeGame_Test:test_extraData_succeeds() (gas: 17426)
FaultDisputeGame_Test:test_gameData_succeeds() (gas: 17917) FaultDisputeGame_Test:test_gameData_succeeds() (gas: 17917)
FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 10315) FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 10315)
FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8282) FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8260)
FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 17669) FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 17669)
FaultDisputeGame_Test:test_move_clockCorrectness_succeeds() (gas: 415981) FaultDisputeGame_Test:test_move_clockCorrectness_succeeds() (gas: 416029)
FaultDisputeGame_Test:test_move_clockTimeExceeded_reverts() (gas: 26387) FaultDisputeGame_Test:test_move_clockTimeExceeded_reverts() (gas: 26399)
FaultDisputeGame_Test:test_move_defendRoot_reverts() (gas: 13360) FaultDisputeGame_Test:test_move_defendRoot_reverts() (gas: 13360)
FaultDisputeGame_Test:test_move_duplicateClaim_reverts() (gas: 103230) FaultDisputeGame_Test:test_move_duplicateClaim_reverts() (gas: 103254)
FaultDisputeGame_Test:test_move_gameDepthExceeded_reverts() (gas: 408100) FaultDisputeGame_Test:test_move_gameDepthExceeded_reverts() (gas: 408148)
FaultDisputeGame_Test:test_move_gameNotInProgress_reverts() (gas: 10968) FaultDisputeGame_Test:test_move_gameNotInProgress_reverts() (gas: 10968)
FaultDisputeGame_Test:test_move_nonExistentParent_reverts() (gas: 24655) FaultDisputeGame_Test:test_move_nonExistentParent_reverts() (gas: 24655)
FaultDisputeGame_Test:test_move_simpleAttack_succeeds() (gas: 107344) FaultDisputeGame_Test:test_move_simpleAttack_succeeds() (gas: 107356)
FaultDisputeGame_Test:test_resolve_challengeContested_succeeds() (gas: 224784) FaultDisputeGame_Test:test_resolve_challengeContested_succeeds() (gas: 224820)
FaultDisputeGame_Test:test_resolve_notInProgress_reverts() (gas: 9657) FaultDisputeGame_Test:test_resolve_notInProgress_reverts() (gas: 9657)
FaultDisputeGame_Test:test_resolve_rootContested_succeeds() (gas: 109749) FaultDisputeGame_Test:test_resolve_rootContested_succeeds() (gas: 109773)
FaultDisputeGame_Test:test_resolve_rootUncontestedClockNotExpired_succeeds() (gas: 21422) FaultDisputeGame_Test:test_resolve_rootUncontestedClockNotExpired_succeeds() (gas: 21434)
FaultDisputeGame_Test:test_resolve_rootUncontested_succeeds() (gas: 27251) FaultDisputeGame_Test:test_resolve_rootUncontested_succeeds() (gas: 27263)
FaultDisputeGame_Test:test_resolve_teamDeathmatch_succeeds() (gas: 395442) FaultDisputeGame_Test:test_resolve_teamDeathmatch_succeeds() (gas: 395502)
FaultDisputeGame_Test:test_rootClaim_succeeds() (gas: 8181) FaultDisputeGame_Test:test_rootClaim_succeeds() (gas: 8225)
FeeVault_Test:test_constructor_succeeds() (gas: 18185) FeeVault_Test:test_constructor_succeeds() (gas: 18185)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352113) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352113)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2950320) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2950320)
......
...@@ -56,11 +56,11 @@ contract MIPS { ...@@ -56,11 +56,11 @@ contract MIPS {
IPreimageOracle public oracle; IPreimageOracle public oracle;
/// @notice Extends the value leftwards with its most significant bit (sign extension). /// @notice Extends the value leftwards with its most significant bit (sign extension).
function SE(uint32 dat, uint32 idx) internal pure returns (uint32) { function SE(uint32 _dat, uint32 _idx) internal pure returns (uint32) {
bool isSigned = (dat >> (idx - 1)) != 0; bool isSigned = (_dat >> (_idx - 1)) != 0;
uint256 signed = ((1 << (32 - idx)) - 1) << idx; uint256 signed = ((1 << (32 - _idx)) - 1) << _idx;
uint256 mask = (1 << idx) - 1; uint256 mask = (1 << _idx) - 1;
return uint32(dat & mask | (isSigned ? signed : 0)); return uint32(_dat & mask | (isSigned ? signed : 0));
} }
/// @notice Computes the hash of the MIPS state. /// @notice Computes the hash of the MIPS state.
...@@ -113,23 +113,25 @@ contract MIPS { ...@@ -113,23 +113,25 @@ contract MIPS {
} }
/// @notice Handles a syscall. /// @notice Handles a syscall.
function handleSyscall() internal returns (bytes32) { function handleSyscall() internal returns (bytes32 out_) {
// Load state from memory // Load state from memory
State memory state; State memory state;
assembly { assembly {
state := 0x80 state := 0x80
} }
// Load the syscall number from the registers
uint32 syscall_no = state.registers[2]; uint32 syscall_no = state.registers[2];
uint32 v0 = 0; uint32 v0 = 0;
uint32 v1 = 0; uint32 v1 = 0;
// Load the syscall arguments from the registers
uint32 a0 = state.registers[4]; uint32 a0 = state.registers[4];
uint32 a1 = state.registers[5]; uint32 a1 = state.registers[5];
uint32 a2 = state.registers[6]; uint32 a2 = state.registers[6];
// mmap: Allocates a page from the heap.
if (syscall_no == 4090) { if (syscall_no == 4090) {
// mmap
uint32 sz = a1; uint32 sz = a1;
if (sz&4095 != 0) { // adjust size to align with page size if (sz&4095 != 0) { // adjust size to align with page size
sz += 4096 - (sz&4095); sz += 4096 - (sz&4095);
...@@ -140,27 +142,37 @@ contract MIPS { ...@@ -140,27 +142,37 @@ contract MIPS {
} else { } else {
v0 = a0; v0 = a0;
} }
} else if (syscall_no == 4045) { }
// brk // brk: Returns a fixed address for the program break at 0x40000000
else if (syscall_no == 4045) {
v0 = BRK_START; v0 = BRK_START;
} else if (syscall_no == 4120) { }
// clone (not supported) // clone (not supported) returns 1
else if (syscall_no == 4120) {
v0 = 1; v0 = 1;
} else if (syscall_no == 4246) { }
// exit group // exit group: Sets the Exited and ExitCode states to true and argument 0.
else if (syscall_no == 4246) {
state.exited = true; state.exited = true;
state.exitCode = uint8(a0); state.exitCode = uint8(a0);
return outputState(); return outputState();
} else if (syscall_no == 4003) { // read }
// read: Like Linux read syscall. Splits unaligned reads into aligned reads.
else if (syscall_no == 4003) {
// args: a0 = fd, a1 = addr, a2 = count // args: a0 = fd, a1 = addr, a2 = count
// returns: v0 = read, v1 = err code // returns: v0 = read, v1 = err code
if (a0 == FD_STDIN) { if (a0 == FD_STDIN) {
// leave v0 and v1 zero: read nothing, no error // Leave v0 and v1 zero: read nothing, no error
} else if (a0 == FD_PREIMAGE_READ) { // pre-image oracle }
// pre-image oracle read
else if (a0 == FD_PREIMAGE_READ) {
// verify proof 1 is correct, and get the existing memory. // verify proof 1 is correct, and get the existing memory.
uint32 mem = readMem(a1 & 0xFFffFFfc, 1); // mask the addr to align it to 4 bytes uint32 mem = readMem(a1 & 0xFFffFFfc, 1); // mask the addr to align it to 4 bytes
(bytes32 dat, uint256 datLen) = oracle.readPreimage(state.preimageKey, state.preimageOffset); (bytes32 dat, uint256 datLen) = oracle.readPreimage(state.preimageKey, state.preimageOffset);
assembly { // assembly for more precise ops, and no var count limit
// Transform data for writing to memory
// We use assembly for more precise ops, and no var count limit
assembly {
let alignment := and(a1, 3) // the read might not start at an aligned address let alignment := and(a1, 3) // the read might not start at an aligned address
let space := sub(4, alignment) // remaining space in memory word let space := sub(4, alignment) // remaining space in memory word
if lt(space, datLen) { datLen := space } // if less space than data, shorten data if lt(space, datLen) { datLen := space } // if less space than data, shorten data
...@@ -172,25 +184,38 @@ contract MIPS { ...@@ -172,25 +184,38 @@ contract MIPS {
mask := and(mask, not(suffixMask)) // reduce mask to just cover the data we insert 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 mem := or(and(mem, not(mask)), dat) // clear masked part of original memory, and insert data
} }
// Write memory back
writeMem(a1 & 0xFFffFFfc, 1, mem); writeMem(a1 & 0xFFffFFfc, 1, mem);
state.preimageOffset += uint32(datLen); state.preimageOffset += uint32(datLen);
v0 = uint32(datLen); v0 = uint32(datLen);
} else if (a0 == FD_HINT_READ) { // hint response }
// don't actually read into memory, just say we read it all, we ignore the result anyway // hint response
else if (a0 == FD_HINT_READ) {
// Don't read into memory, just say we read it all
// The result is ignored anyway
v0 = a2; v0 = a2;
} else { }
else {
v0 = 0xFFffFFff; v0 = 0xFFffFFff;
v1 = EBADF; v1 = EBADF;
} }
} else if (syscall_no == 4004) { // write }
// write: like Linux write syscall. Splits unaligned writes into aligned writes.
else if (syscall_no == 4004) {
// args: a0 = fd, a1 = addr, a2 = count // args: a0 = fd, a1 = addr, a2 = count
// returns: v0 = written, v1 = err code // returns: v0 = written, v1 = err code
if (a0 == FD_STDOUT || a0 == FD_STDERR || a0 == FD_HINT_WRITE) { if (a0 == FD_STDOUT || a0 == FD_STDERR || a0 == FD_HINT_WRITE) {
v0 = a2; // tell program we have written everything v0 = a2; // tell program we have written everything
} else if (a0 == FD_PREIMAGE_WRITE) { // pre-image oracle }
// pre-image oracle
else if (a0 == FD_PREIMAGE_WRITE) {
uint32 mem = readMem(a1 & 0xFFffFFfc, 1); // mask the addr to align it to 4 bytes uint32 mem = readMem(a1 & 0xFFffFFfc, 1); // mask the addr to align it to 4 bytes
bytes32 key = state.preimageKey; bytes32 key = state.preimageKey;
assembly { // assembly for more precise ops, and no var count limit
// Construct pre-image key from memory
// We use assembly for more precise ops, and no var count limit
assembly {
let alignment := and(a1, 3) // the read might not start at an aligned address let alignment := and(a1, 3) // the read might not start at an aligned address
let space := sub(4, alignment) // remaining space in memory word let space := sub(4, alignment) // remaining space in memory word
if lt(space, a2) { a2 := space } // if less space than data, shorten data if lt(space, a2) { a2 := space } // if less space than data, shorten data
...@@ -199,14 +224,20 @@ contract MIPS { ...@@ -199,14 +224,20 @@ contract MIPS {
mem := and(shr(mul(sub(space, a2), 8), mem), mask) // align value to right, mask it mem := and(shr(mul(sub(space, a2), 8), mem), mask) // align value to right, mask it
key := or(key, mem) // insert into key key := or(key, mem) // insert into key
} }
// Write pre-image key to oracle
state.preimageKey = key; state.preimageKey = key;
state.preimageOffset = 0; // reset offset, to read new pre-image data from the start state.preimageOffset = 0; // reset offset, to read new pre-image data from the start
v0 = a2; v0 = a2;
} else { }
else {
v0 = 0xFFffFFff; v0 = 0xFFffFFff;
v1 = EBADF; v1 = EBADF;
} }
} else if (syscall_no == 4055) { // fcntl }
// fcntl: Like linux fcntl syscall, but only supports minimal file-descriptor control commands,
// to retrieve the file-descriptor R/W flags.
else if (syscall_no == 4055) { // fcntl
// args: a0 = fd, a1 = cmd // args: a0 = fd, a1 = cmd
if (a1 == 3) { // F_GETFL: get file descriptor flags if (a1 == 3) { // F_GETFL: get file descriptor flags
if (a0 == FD_STDIN || a0 == FD_PREIMAGE_READ || a0 == FD_HINT_READ) { if (a0 == FD_STDIN || a0 == FD_PREIMAGE_READ || a0 == FD_HINT_READ) {
...@@ -223,13 +254,15 @@ contract MIPS { ...@@ -223,13 +254,15 @@ contract MIPS {
} }
} }
// Write the results back to the state registers
state.registers[2] = v0; state.registers[2] = v0;
state.registers[7] = v1; state.registers[7] = v1;
// Update the PC and nextPC
state.pc = state.nextPC; state.pc = state.nextPC;
state.nextPC = state.nextPC + 4; state.nextPC = state.nextPC + 4;
return outputState(); out_ = outputState();
} }
/// @notice Handles a branch instruction, updating the MIPS state PC where needed. /// @notice Handles a branch instruction, updating the MIPS state PC where needed.
......
...@@ -30,12 +30,12 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver { ...@@ -30,12 +30,12 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
/// @notice The max depth of the game. /// @notice The max depth of the game.
uint256 public immutable MAX_GAME_DEPTH; uint256 public immutable MAX_GAME_DEPTH;
/// @notice The duration of the game.
Duration public immutable GAME_DURATION;
/// @notice A hypervisor that performs single instruction steps on a fault proof program trace. /// @notice A hypervisor that performs single instruction steps on a fault proof program trace.
IBigStepper public immutable VM; IBigStepper public immutable VM;
/// @notice The duration of the game.
Duration internal constant GAME_DURATION = Duration.wrap(7 days);
/// @notice The root claim's position is always at gindex 1. /// @notice The root claim's position is always at gindex 1.
Position internal constant ROOT_POSITION = Position.wrap(1); Position internal constant ROOT_POSITION = Position.wrap(1);
...@@ -58,10 +58,12 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver { ...@@ -58,10 +58,12 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone, Semver {
constructor( constructor(
Claim _absolutePrestate, Claim _absolutePrestate,
uint256 _maxGameDepth, uint256 _maxGameDepth,
Duration _gameDuration,
IBigStepper _vm IBigStepper _vm
) Semver(0, 0, 3) { ) Semver(0, 0, 3) {
ABSOLUTE_PRESTATE = _absolutePrestate; ABSOLUTE_PRESTATE = _absolutePrestate;
MAX_GAME_DEPTH = _maxGameDepth; MAX_GAME_DEPTH = _maxGameDepth;
GAME_DURATION = _gameDuration;
VM = _vm; VM = _vm;
} }
......
...@@ -29,7 +29,12 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init { ...@@ -29,7 +29,12 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init {
function init(Claim rootClaim, Claim absolutePrestate) public { function init(Claim rootClaim, Claim absolutePrestate) public {
super.setUp(); super.setUp();
// Deploy an implementation of the fault game // Deploy an implementation of the fault game
gameImpl = new FaultDisputeGame(absolutePrestate, 4, new AlphabetVM(absolutePrestate)); gameImpl = new FaultDisputeGame(
absolutePrestate,
4,
Duration.wrap(7 days),
new AlphabetVM(absolutePrestate)
);
// Register the game implementation with the factory. // Register the game implementation with the factory.
factory.setImplementation(GAME_TYPE, gameImpl); factory.setImplementation(GAME_TYPE, gameImpl);
// Create a new game. // Create a new game.
......
...@@ -35,7 +35,7 @@ contract OptimismMintableERC20 is IOptimismMintableERC20, ILegacyMintableERC20, ...@@ -35,7 +35,7 @@ contract OptimismMintableERC20 is IOptimismMintableERC20, ILegacyMintableERC20,
_; _;
} }
/// @custom:semver 1.0.1 /// @custom:semver 1.0.2
/// @param _bridge Address of the L2 standard bridge. /// @param _bridge Address of the L2 standard bridge.
/// @param _remoteToken Address of the corresponding L1 token. /// @param _remoteToken Address of the corresponding L1 token.
/// @param _name ERC20 name. /// @param _name ERC20 name.
...@@ -45,7 +45,7 @@ contract OptimismMintableERC20 is IOptimismMintableERC20, ILegacyMintableERC20, ...@@ -45,7 +45,7 @@ contract OptimismMintableERC20 is IOptimismMintableERC20, ILegacyMintableERC20,
address _remoteToken, address _remoteToken,
string memory _name, string memory _name,
string memory _symbol string memory _symbol
) ERC20(_name, _symbol) Semver(1, 0, 1) { ) ERC20(_name, _symbol) Semver(1, 0, 2) {
REMOTE_TOKEN = _remoteToken; REMOTE_TOKEN = _remoteToken;
BRIDGE = _bridge; BRIDGE = _bridge;
} }
...@@ -79,7 +79,7 @@ contract OptimismMintableERC20 is IOptimismMintableERC20, ILegacyMintableERC20, ...@@ -79,7 +79,7 @@ contract OptimismMintableERC20 is IOptimismMintableERC20, ILegacyMintableERC20,
/// @notice ERC165 interface check function. /// @notice ERC165 interface check function.
/// @param _interfaceId Interface ID to check. /// @param _interfaceId Interface ID to check.
/// @return Whether or not the interface is supported by this contract. /// @return Whether or not the interface is supported by this contract.
function supportsInterface(bytes4 _interfaceId) external pure returns (bool) { function supportsInterface(bytes4 _interfaceId) external pure virtual returns (bool) {
bytes4 iface1 = type(IERC165).interfaceId; bytes4 iface1 = type(IERC165).interfaceId;
// Interface corresponding to the legacy L2StandardERC20. // Interface corresponding to the legacy L2StandardERC20.
bytes4 iface2 = type(ILegacyMintableERC20).interfaceId; bytes4 iface2 = type(ILegacyMintableERC20).interfaceId;
......
...@@ -45,5 +45,6 @@ ...@@ -45,5 +45,6 @@
"l1StartingBlockTag": "earliest", "l1StartingBlockTag": "earliest",
"l2GenesisRegolithTimeOffset": "0x0", "l2GenesisRegolithTimeOffset": "0x0",
"faultGameAbsolutePrestate": 140, "faultGameAbsolutePrestate": 140,
"faultGameMaxDepth": 4 "faultGameMaxDepth": 4,
} "faultGameMaxDuration": 604800
\ No newline at end of file }
...@@ -697,6 +697,7 @@ contract Deploy is Deployer { ...@@ -697,6 +697,7 @@ contract Deploy is Deployer {
factory.setImplementation(GameTypes.FAULT, new FaultDisputeGame({ factory.setImplementation(GameTypes.FAULT, new FaultDisputeGame({
_absolutePrestate: absolutePrestate, _absolutePrestate: absolutePrestate,
_maxGameDepth: cfg.faultGameMaxDepth(), _maxGameDepth: cfg.faultGameMaxDepth(),
_gameDuration: Duration.wrap(uint64(cfg.faultGameMaxDuration())),
_vm: faultVm _vm: faultVm
})); }));
console.log("DisputeGameFactory: set `FaultDisputeGame` implementation"); console.log("DisputeGameFactory: set `FaultDisputeGame` implementation");
......
...@@ -47,6 +47,7 @@ contract DeployConfig is Script { ...@@ -47,6 +47,7 @@ contract DeployConfig is Script {
uint256 public l2GenesisRegolithTimeOffset; uint256 public l2GenesisRegolithTimeOffset;
uint256 public faultGameAbsolutePrestate; uint256 public faultGameAbsolutePrestate;
uint256 public faultGameMaxDepth; uint256 public faultGameMaxDepth;
uint256 public faultGameMaxDuration;
constructor(string memory _path) { constructor(string memory _path) {
console.log("DeployConfig: reading file %s", _path); console.log("DeployConfig: reading file %s", _path);
...@@ -88,6 +89,7 @@ contract DeployConfig is Script { ...@@ -88,6 +89,7 @@ contract DeployConfig is Script {
if (block.chainid == 900) { if (block.chainid == 900) {
faultGameAbsolutePrestate = stdJson.readUint(_json, "$.faultGameAbsolutePrestate"); faultGameAbsolutePrestate = stdJson.readUint(_json, "$.faultGameAbsolutePrestate");
faultGameMaxDepth = stdJson.readUint(_json, "$.faultGameMaxDepth"); faultGameMaxDepth = stdJson.readUint(_json, "$.faultGameMaxDepth");
faultGameMaxDuration = stdJson.readUint(_json, "$.faultGameMaxDuration");
} }
} }
......
...@@ -14,9 +14,6 @@ importers: ...@@ -14,9 +14,6 @@ importers:
'@codechecks/client': '@codechecks/client':
specifier: ^0.1.11 specifier: ^0.1.11
version: 0.1.11(typescript@4.9.3) version: 0.1.11(typescript@4.9.3)
'@ethersproject/abstract-provider':
specifier: ^5.7.0
version: 5.7.0
devDependencies: devDependencies:
'@babel/eslint-parser': '@babel/eslint-parser':
specifier: ^7.18.2 specifier: ^7.18.2
...@@ -26,7 +23,7 @@ importers: ...@@ -26,7 +23,7 @@ importers:
version: 0.4.8 version: 0.4.8
'@nrwl/nx-cloud': '@nrwl/nx-cloud':
specifier: latest specifier: latest
version: 16.0.5 version: 16.1.0
'@types/chai': '@types/chai':
specifier: ^4.2.18 specifier: ^4.2.18
version: 4.2.21 version: 4.2.21
...@@ -2496,10 +2493,10 @@ packages: ...@@ -2496,10 +2493,10 @@ packages:
tslib: 2.6.0 tslib: 2.6.0
dev: true dev: true
/@nrwl/nx-cloud@16.0.5: /@nrwl/nx-cloud@16.1.0:
resolution: {integrity: sha512-1p82ym8WE9ziejwgPslstn19iV/VkHfHfKr/5YOnfCHQS+NxUf92ogcYhHXtqWLblVZ9Zs4W4pkSXK4e04wCmQ==} resolution: {integrity: sha512-OFjbSqdCuZq9KRYU/mOlIN8SYLZREsLlZYqYpObZqXJ5meUgBDJbUSwRweUSUvt73fgRixLEau2jPysiLHKxSQ==}
dependencies: dependencies:
nx-cloud: 16.0.5 nx-cloud: 16.1.0
transitivePeerDependencies: transitivePeerDependencies:
- debug - debug
dev: true dev: true
...@@ -12537,11 +12534,11 @@ packages: ...@@ -12537,11 +12534,11 @@ packages:
bn.js: 4.11.6 bn.js: 4.11.6
strip-hex-prefix: 1.0.0 strip-hex-prefix: 1.0.0
/nx-cloud@16.0.5: /nx-cloud@16.1.0:
resolution: {integrity: sha512-13P7r0aKikjBtmdZrNorwXzVPeVIV4MLEwqGY+DEG6doLBtI5KqEQk/d5B5l2dCF2BEi/LXEmLYCmf9gwbOJ+Q==} resolution: {integrity: sha512-2K5OuJ4MEDrn2solje2X+a3UxSCdfR5PIscCRQbBANyvJfl3hGJSTxz0n5xeJJX4cKcQlfAxDQFRH6DHNdTGPQ==}
hasBin: true hasBin: true
dependencies: dependencies:
'@nrwl/nx-cloud': 16.0.5 '@nrwl/nx-cloud': 16.1.0
axios: 1.1.3 axios: 1.1.3
chalk: 4.1.2 chalk: 4.1.2
dotenv: 10.0.0 dotenv: 10.0.0
......
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